| java.lang.Object org.jpox.metadata.MetaData org.jpox.metadata.AbstractMemberMetaData org.jpox.metadata.FieldMetaData
FieldMetaData | public class FieldMetaData extends AbstractMemberMetaData (Code) | | Representation of the Meta-Data for a field of a class.
Lifecycle state
An object of this type has 2 lifecycle states. The first is the raw
constructed object which represents pure MetaData (maybe from a MetaData
file). The second is a "populated" object which represents MetaData for a
Field of a class with the metadata aligned to be appropriate for that Field.
Containers
Each field can represent a container. The container can be an array, a
Collection or a Map. The field type must be of the correct type to represent
these.
JPOX Management
Each field can be managed by JPOX or not. The class provides a method for
identifying if a field is managed by JPOX (isJdoField()). If a field
is managed by JPOX, it will have a field "id" (within its class). In a class
the field "id" will start at 0 (for the first field, in alphabetical order).
MetaData Element
The MetaData element represented here is as follows
<!ELEMENT field (extension*, (collection|map|array|(column*))?, join?, element?,
key?, value?, fetch-group*, order?, embedded?, index?, unique?, foreign-key?,
delete-action?, extension*)?>
<!ATTLIST field name CDATA #REQUIRED>
<!ATTLIST field persistence-modifier (persistent|transactional|none)
#IMPLIED>
<!ATTLIST field table CDATA #IMPLIED>
<!ATTLIST field null-value (exception|default|none) 'none'>
<!ATTLIST field default-fetch-group (true|false) #IMPLIED>
<!ATTLIST field embedded (true|false) #IMPLIED>
<!ATTLIST field serialized (true|false) #IMPLIED>
<!ATTLIST field dependent (true|false) #IMPLIED>
<!ATTLIST field indexed (true|false|unique) #IMPLIED>
<!ATTLIST field unique (true|false) #IMPLIED>
<!ATTLIST field load-fetch-group CDATA #IMPLIED>
<!ATTLIST field recursion-depth CDATA #IMPLIED>
<!ATTLIST field primary-key (true|false) 'false'>
<!ATTLIST field mapped-by CDATA #IMPLIED>
<!ATTLIST field value-strategy CDATA #IMPLIED>
<!ATTLIST field delete-action (restrict|cascade|null|default|none) #IMPLIED>
<!ATTLIST field sequence CDATA #IMPLIED>
<!ATTLIST field field-type CDATA #IMPLIED>
since: 1.1 version: $Revision: 1.83 $ |
Constructor Summary | |
public | FieldMetaData(MetaData parent, String name) | public | FieldMetaData(MetaData parent, AbstractMemberMetaData fmd) Convenience constructor to copy the specification from the passed field. | public | FieldMetaData(MetaData parent, String name, String pk, String modifier, String defaultFetchGroup, String nullValue, String embedded, String serialized, String dependent, String mappedBy, String column, String table, String catalog, String schema, String deleteAction, String indexed, String unique, String recursionDepth, String loadFetchGroup, String valueStrategy, String sequence, String fieldType) Constructor. |
Method Summary | |
public int | compareTo(Object o) Comparator method. | public boolean | isProperty() | public String | toString(String prefix, String indent) Returns a string representation of the object using a prefix
This can be used as part of a facility to output a MetaData file. |
FieldMetaData | public FieldMetaData(MetaData parent, String name)(Code) | | Convenience constructor taking defaults
Parameters: parent - Parent component Parameters: name - Name of the field |
FieldMetaData | public FieldMetaData(MetaData parent, AbstractMemberMetaData fmd)(Code) | | Convenience constructor to copy the specification from the passed field.
This is used when we have an overriding field and we make a copy of the baseline
field as a starting point.
Parameters: parent - The parent Parameters: fmd - The field to copy |
FieldMetaData | public FieldMetaData(MetaData parent, String name, String pk, String modifier, String defaultFetchGroup, String nullValue, String embedded, String serialized, String dependent, String mappedBy, String column, String table, String catalog, String schema, String deleteAction, String indexed, String unique, String recursionDepth, String loadFetchGroup, String valueStrategy, String sequence, String fieldType)(Code) | | Constructor. Saves the MetaData with the specified values. The object is
then in an "unpopulated" state. It can become "populated" by calling the
populate() method which compares it against the field it is to
represent and updates any unset attributes and flags up any errors.
Parameters: parent - parent MetaData instance Parameters: name - field name Parameters: pk - attribute primary-key value Parameters: modifier - attribute persistence-modifier value Parameters: defaultFetchGroup - attribute default-fetch-group value Parameters: nullValue - attribute null-value value Parameters: embedded - attribute embedded value Parameters: serialized - attribute serialized value Parameters: dependent - attribute dependent value Parameters: mappedBy - attribute mapped-by value Parameters: column - attribute column value Parameters: table - attribute table value Parameters: catalog - attribute catalog value Parameters: schema - attribute schema value Parameters: deleteAction - attribute delete-action value Parameters: indexed - Whether this is indexed Parameters: unique - Apply a unique constraint Parameters: recursionDepth - The depth of fetch to use when recursing Parameters: loadFetchGroup - Name of the additional fetch group to use when loading Parameters: valueStrategy - attribute value-strategy value Parameters: sequence - attribute sequence value Parameters: fieldType - Implementation type(s) for field. |
compareTo | public int compareTo(Object o)(Code) | | Comparator method. This allows the ClassMetaData to search for a
FieldMetaData with a particular name.
Parameters: o - The object to compare against The comparison result |
isProperty | public boolean isProperty()(Code) | | Whether this uses getter/setter accessors (Property) or
used field based access (Field)
true if this is a property |
toString | public String toString(String prefix, String indent)(Code) | | Returns a string representation of the object using a prefix
This can be used as part of a facility to output a MetaData file.
Parameters: prefix - prefix string Parameters: indent - indent string a string representation of the object. |
|
|