com.revusky.oreo
Interface RecordDescriptor
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- RecordMetadata
- public interface RecordDescriptor
- extends java.io.Serializable
A metadata object that describes what is in a record.
- Author:
- Jonathan Revusky
getType
public java.lang.String getType()
- Returns:
- a string representing the type of record this is.
getFieldDescriptors
public java.util.Enumeration getFieldDescriptors()
- Returns:
- a java.util.Enumeration of the
descriptors of the fields that comprise
this record. NB: For a variety of hypertechnical reasons,
it is required that the primary key field be the
first field that comes out of the enumeration.
getField
public FieldDescriptor getField(java.lang.String name)
- Returns:
- the FieldDescriptor based
on name, or null if none is found.
getField
public FieldDescriptor getField(int i)
- Returns:
- the FieldDescriptor based
on ordinal index.
getPrimaryKeyField
public FieldDescriptor getPrimaryKeyField()
- Returns:
- the FieldDescriptor
for the primary key.
indexOf
public int indexOf(java.lang.String name)
- Returns:
- the ordinal index of the field
of the given name, -1 if there is no
field of that name.
size
public int size()
- The number of fields in the record.
getPresentationWrapperClass
public java.lang.Class getPresentationWrapperClass()
- Returns:
- a custom class that is used to
"wrap" this record for presentation.
I anticipate that many (if not most)
implementations will simply return null
here and a default wrapper class will
be used.
getRecordClass
public java.lang.Class getRecordClass()
- Returns:
- the Java class that corresponds
to this record type.
newRecord
public Record newRecord()
- Returns:
- a Record that corresponds to
this record descriptor in its
default uninitialized state.
getTableName
public java.lang.String getTableName()
- Returns:
- the name of the table that this
record type is stored in in a backing RDBMS.
Under most circumstances, this will
return the same as getType(), since there is
little reason not to name the table the same as
the underlying type.
getProperty
public java.lang.String getProperty(java.lang.String propertyName)
- a hook so that implementors can add other
properties