org.jpox.metadata
Class AbstractPropertyMetaData

java.lang.Object
  extended byorg.jpox.metadata.MetaData
      extended byorg.jpox.metadata.ExtendableMetaData
          extended byorg.jpox.metadata.AbstractPropertyMetaData
All Implemented Interfaces:
ColumnMetaDataContainer, java.lang.Comparable, java.io.Serializable
Direct Known Subclasses:
FieldMetaData, PropertyMetaData

public class AbstractPropertyMetaData
extends ExtendableMetaData
implements java.lang.Comparable, ColumnMetaDataContainer

The property element declares mapping between a virtual field of an implemented interface and the corresponding persistent field of a persistence-capable class. The name attribute is required, and declares the name for the property. The naming conventions for JavaBeans property names is used: the property name is the same as the corresponding get method for the property with the get removed and the resulting name lowercased. The field-name attribute is required; it associates a persistent field with the named property.

MetaData Element

The MetaData Element represented here is as follows
 
 
 
 

Version:
$Revision$
See Also:
Serialized Form

Field Summary
protected  java.lang.String className
          Name of the class to which this field really belongs.
protected  java.lang.String column
          column tag value.
protected  ColumnMetaData[] columnMetaData
          Contains the metadata for column(s).
protected  java.util.List columns
          Columns ColumnMetaData
protected  ContainerMetaData container
          Meta-Data of any container.
static int DEFAULT_RECURSION_DEPTH
          Default recursion-depth according to proposed final draft spec, [12.7.2].
protected  java.lang.Boolean defaultFetchGroup
          default-fetch-group tag value.
protected  java.lang.Boolean dependent
          dependent tag value.
protected  ElementMetaData elementMetaData
          ElementMetaData.
protected  java.lang.Boolean embedded
          embedded tag value.
protected  EmbeddedMetaData embeddedMetaData
          EmbeddedMetaData.
protected  int fieldId
          Id of the field in its class (only for fields managed by JDO).
protected  java.lang.String fieldType
          The field-type attribute is used to specify a more restrictive type than the field definition in the class.
protected  ForeignKeyMetaData foreignKeyMetaData
          ForeignKeyMetaData.
protected  IndexedValue indexed
          The indexing value
protected  IndexMetaData indexMetaData
          IndexMetaData.
protected  JoinMetaData joinMetaData
          JoinMetaData.
protected  KeyMetaData keyMetaData
          KeyMetaData.
protected  java.lang.String loadFetchGroup
          load-fetch-group value.
protected  java.lang.String mappedBy
          mapped-by tag value.
protected  int modifiers
          Field modifiers
protected  java.lang.String name
          Field name.
protected  NullValue nullValue
          null-value tag value (default is NONE).
protected  OrderMetaData orderMetaData
          OrderMetaData.
protected  FieldPersistenceModifier persistenceModifier
          persistence-modifier tag value.
protected  java.lang.Boolean primaryKey
          primary key tag value.
protected  int recursionDepth
          recursion-depth value.
protected  AbstractPropertyMetaData relatedFieldMetaData
          FieldMetaData for the other end of a relation when this field is a bidirectional relation.
protected  int relationType
          The relation type of this field (1-1, 1-N, M-N, N-1).
protected  java.lang.String sequence
          If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.
protected  java.lang.Boolean serialized
          serialized tag value.
protected  java.lang.String table
          Table name for this field.
protected  java.lang.Class type
          Field type being represented by this MetaData.
static int UNDEFINED_RECURSION_DEPTH
          Indicates the recursion-depth is not defined.
protected  boolean uniqueConstraint
          Whether to add a unique constraint.
protected  UniqueMetaData uniqueMetaData
          UniqueMetaData.
protected  ValueMetaData valueMetaData
          ValueMetaData.
protected  IdentityStrategy valueStrategy
          The value-strategy attribute specifies the strategy used to generate values for the field.
 
Fields inherited from class org.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
Constructor Summary
AbstractPropertyMetaData(MetaData parent, AbstractPropertyMetaData fmd)
          Convenience constructor to copy the specification from the passed field.
AbstractPropertyMetaData(MetaData parent, java.lang.String name)
          Convenience constructor taking defaults
AbstractPropertyMetaData(MetaData parent, java.lang.String name, java.lang.String pk, java.lang.String modifier, java.lang.String defaultFetchGroup, java.lang.String nullValue, java.lang.String embedded, java.lang.String serialized, java.lang.String dependent, java.lang.String mappedBy, java.lang.String column, java.lang.String table, java.lang.String deleteAction, java.lang.String indexed, java.lang.String unique, java.lang.String recursionDepth, java.lang.String loadFetchGroup, java.lang.String valueStrategy, java.lang.String foreignKey, java.lang.String sequence, java.lang.String fieldType)
          Constructor.
 
Method Summary
 void addColumn(ColumnMetaData colmd)
          Add a new ColumnMetaData element
 int compareTo(java.lang.Object o)
          Comparator method.
 boolean fieldBelongsToClass()
          Accessor for whether the field is for a superclass, and not for this class.
 int getAbsoluteFieldNumber()
          Accessor for the field id
 AbstractClassMetaData getAbstractClassMetaData()
          Convenience accessor for the MetaData of the parent class.
 ArrayMetaData getArray()
          Accessor for an array container for this field.
 java.lang.String getClassName()
          Accessor for the fully-qualified class name owning this field.
 java.lang.String getClassName(boolean fully_qualified)
          Convenience to return the class name that this a field of.
 CollectionMetaData getCollection()
          Accessor for a collection container for this field.
 java.lang.String getColumn()
          Accessor for the column
 ColumnMetaData[] getColumnMetaData()
          Acessor for the columns
 ContainerMetaData getContainer()
          Accessor for the container for this field.
 ElementMetaData getElementMetaData()
          Accessor for elementMetaData
 EmbeddedMetaData getEmbeddedMetaData()
          Accessor for embeddedMetaData
 int getFieldId()
          Accessor for the field id.
 java.lang.String getFieldType()
          Accessor for the implementation type(s) that can be stored in this field when it is a reference type.
 ForeignKeyMetaData getForeignKeyMetaData()
          Accessor for foreignKeyMetaData
 java.lang.String getFullFieldName()
          Accessor for the full field name.
 IndexMetaData getIndexMetaData()
          Accessor for indexMetaData
 JoinMetaData getJoinMetaData()
          Accessor for joinMetaData
 KeyMetaData getKeyMetaData()
          Accessor for keyMetaData
 java.lang.String getLoadFetchGroup()
          Accessor for the (additional) fetch group for loading this field
 MapMetaData getMap()
          Accessor for a map container for this field.
 java.lang.String getMappedBy()
          Accessor for mappedBy
 MetaDataManager getMetaDataManager()
          Convenience accessor for the MetaData Manager in use.
 java.lang.String getName()
          Accessor for the field name
 NullValue getNullValue()
          Accessor for the null-value tag
 OrderMetaData getOrderMetaData()
          Accessor for orderMetaData
 FieldPersistenceModifier getPersistenceModifier()
          Accessor for the persistence-modifier tag value
 int getRecursionDepth()
          Accessor for the depth of the fetch when recursing
 AbstractPropertyMetaData getRelatedFieldMetaData(ClassLoaderResolver clr)
          Accessor for the FieldMetaData of any related field (where this field is part of a bidirectional relation).
 int getRelationType(ClassLoaderResolver clr)
          Accessor for the relation type for this field.
 java.lang.String getSequence()
          If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.
 java.lang.String getTable()
          Accessor for the table name
 java.lang.Class getType()
          Accessor for the field type
 java.lang.String getTypeName()
          Accessor for the field type name
 UniqueMetaData getUniqueMetaData()
          Accessor for uniqueMetaData
 ValueMetaData getValueMetaData()
          Accessor for valueMetaData
 IdentityStrategy getValueStrategy()
          The value-strategy attribute specifies the strategy used to generate values for the field.
 boolean hasArray()
          Accessor for whether the field has an array
 boolean hasCollection()
          Accessor for whether the field has a collection
 boolean hasContainer()
          Accessor for whether the field has a container.
 boolean hasMap()
          Accessor for whether the field has a map.
 void initialise()
          Initialisation method.
 boolean isDefaultFetchGroup()
          Accessor for the default-fetch-group tag value
 boolean isDependent()
          Accessor for the dependent attribute indicates that the field contains a reference that is to be deleted from the datastore if the referring instance in which the field is declared is deleted, or if the referring field is nullified.
 boolean isEmbedded()
          Accessor for the embedded tag value.
 boolean isFieldArrayTypePersistenceCapable()
          Utility to return if this array field has elements that are PersistenceCapable.
 boolean isFieldTypePersistenceCapable()
          Utility to return if this field is PersistenceCapable.
 boolean isFinal()
          Convenience method to return if this field represents a final field.
 boolean isJdoField()
          Accessor for whether the field is to be managed by JDO.
 boolean isPrimaryKey()
          Accessor for the primary-key tag value.
 boolean isSerialized()
          Accessor for the serialized tag value
 boolean isStatic()
          Convenience method to return if this field represents a static field.
 boolean isTransient()
          Convenience method to return if this field represents a transient field.
 void mergeORMData(AbstractPropertyMetaData ormFmd)
          Method to merge in the associated metadata from the ORM definition
 void populate(ClassLoaderResolver clr, java.lang.Class fieldType, int modifiers)
          Method to provide the details of the field being represented by this MetaData.
 void setContainer(ContainerMetaData conmd)
          Method to set the container for this field (if this field represents a container (collection, map, array).
 void setDependent(boolean dependent)
          Mutator for dependent attribute.
 void setElementMetaData(ElementMetaData elementMetaData)
          Mutator for the element MetaData
 void setEmbeddedMetaData(EmbeddedMetaData embeddedMetaData)
          Mutator for the embedded MetaData
 void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
          Mutator for the foreignKey MetaData
 void setIndexMetaData(IndexMetaData indexMetaData)
          Mutator for the index MetaData
 void setJoinMetaData(JoinMetaData joinMetaData)
          Mutator for the join MetaData
 void setKeyMetaData(KeyMetaData keyMetaData)
          Mutator for the key MetaData
 void setMappedBy(java.lang.String mappedby)
          Mutator for mappedBy
 void setOrderMetaData(OrderMetaData orderMetaData)
          Mutator for the order MetaData
protected  void setRelation(ClassLoaderResolver clr)
          Convenience method that sets up the relation type of this field, and the reference to any related field when it is bidirectional.
 void setSequence(java.lang.String sequence)
          If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.
 void setTable(java.lang.String table)
          Mutator for the table name
 void setUniqueMetaData(UniqueMetaData uniqueMetaData)
          Mutator for the unique MetaData
 void setValueMetaData(ValueMetaData valueMetaData)
          Mutator for the value MetaData
 void setValueStrategy(IdentityStrategy valueStrategy)
          The value-strategy attribute specifies the strategy used to generate values for the field.
 java.lang.String toString()
          Accessor for a string representation of the object.
 java.lang.String toString(java.lang.String prefix, java.lang.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.
 
Methods inherited from class org.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

columnMetaData

protected ColumnMetaData[] columnMetaData
Contains the metadata for column(s).


container

protected ContainerMetaData container
Meta-Data of any container.


embeddedMetaData

protected EmbeddedMetaData embeddedMetaData
EmbeddedMetaData.


joinMetaData

protected JoinMetaData joinMetaData
JoinMetaData.


elementMetaData

protected ElementMetaData elementMetaData
ElementMetaData.


keyMetaData

protected KeyMetaData keyMetaData
KeyMetaData.


valueMetaData

protected ValueMetaData valueMetaData
ValueMetaData.


indexMetaData

protected IndexMetaData indexMetaData
IndexMetaData.


indexed

protected IndexedValue indexed
The indexing value


uniqueMetaData

protected UniqueMetaData uniqueMetaData
UniqueMetaData.


uniqueConstraint

protected final boolean uniqueConstraint
Whether to add a unique constraint.


orderMetaData

protected OrderMetaData orderMetaData
OrderMetaData.


foreignKeyMetaData

protected ForeignKeyMetaData foreignKeyMetaData
ForeignKeyMetaData.


defaultFetchGroup

protected java.lang.Boolean defaultFetchGroup
default-fetch-group tag value.


column

protected java.lang.String column
column tag value.


mappedBy

protected java.lang.String mappedBy
mapped-by tag value.


embedded

protected java.lang.Boolean embedded
embedded tag value.


dependent

protected java.lang.Boolean dependent
dependent tag value. The dependent attribute indicates that the field contains a reference that is to be deleted from the datastore if the referring instance in which the field is declared is deleted, or if the referring field is nullified.


serialized

protected java.lang.Boolean serialized
serialized tag value.


loadFetchGroup

protected final java.lang.String loadFetchGroup
load-fetch-group value.


DEFAULT_RECURSION_DEPTH

public static final int DEFAULT_RECURSION_DEPTH
Default recursion-depth according to proposed final draft spec, [12.7.2].

See Also:
Constant Field Values

UNDEFINED_RECURSION_DEPTH

public static final int UNDEFINED_RECURSION_DEPTH
Indicates the recursion-depth is not defined. Use default value.

See Also:
Constant Field Values

recursionDepth

protected int recursionDepth
recursion-depth value.


name

protected final java.lang.String name
Field name.


nullValue

protected NullValue nullValue
null-value tag value (default is NONE).


persistenceModifier

protected FieldPersistenceModifier persistenceModifier
persistence-modifier tag value.


primaryKey

protected java.lang.Boolean primaryKey
primary key tag value.


table

protected java.lang.String table
Table name for this field.


valueStrategy

protected IdentityStrategy valueStrategy
The value-strategy attribute specifies the strategy used to generate values for the field. This attribute has the same values and meaning as the strategy attribute in datastoreidentity.


sequence

protected java.lang.String sequence
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.


className

protected java.lang.String className
Name of the class to which this field really belongs. Will be null if the field belongs to the parent ClassMetaData, and will have a value if it is an overriding field.


fieldType

protected java.lang.String fieldType
The field-type attribute is used to specify a more restrictive type than the field definition in the class. This might be required in order to map the field to the datastore. To be portable, specify the name of a single type that is itself able to be mapped to the datastore (e.g. a field of type Object can specify field-type=”Integer”). To specify multiple types that the field might contain, use a comma-separated list of types, although this cannot be portably mapped. Rules for type names are as specified in collection elementtype.


type

protected java.lang.Class type
Field type being represented by this MetaData.


modifiers

protected int modifiers
Field modifiers


fieldId

protected int fieldId
Id of the field in its class (only for fields managed by JDO). If the value is -1, the field is NOT managed by JDO or the object hasn't been populated.


relationType

protected int relationType
The relation type of this field (1-1, 1-N, M-N, N-1).


relatedFieldMetaData

protected AbstractPropertyMetaData relatedFieldMetaData
FieldMetaData for the other end of a relation when this field is a bidirectional relation.


columns

protected java.util.List columns
Columns ColumnMetaData

Constructor Detail

AbstractPropertyMetaData

public AbstractPropertyMetaData(MetaData parent,
                                java.lang.String name)
Convenience constructor taking defaults

Parameters:
parent - Parent component
name - Name of the field

AbstractPropertyMetaData

public AbstractPropertyMetaData(MetaData parent,
                                AbstractPropertyMetaData fmd)
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
fmd - The field to copy

AbstractPropertyMetaData

public AbstractPropertyMetaData(MetaData parent,
                                java.lang.String name,
                                java.lang.String pk,
                                java.lang.String modifier,
                                java.lang.String defaultFetchGroup,
                                java.lang.String nullValue,
                                java.lang.String embedded,
                                java.lang.String serialized,
                                java.lang.String dependent,
                                java.lang.String mappedBy,
                                java.lang.String column,
                                java.lang.String table,
                                java.lang.String deleteAction,
                                java.lang.String indexed,
                                java.lang.String unique,
                                java.lang.String recursionDepth,
                                java.lang.String loadFetchGroup,
                                java.lang.String valueStrategy,
                                java.lang.String foreignKey,
                                java.lang.String sequence,
                                java.lang.String fieldType)
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
name - field name
pk - attribute primary-key value
modifier - attribute persistence-modifier value
defaultFetchGroup - attribute default-fetch-group value
nullValue - attribute null-value value
embedded - attribute embedded value
serialized - attribute serialized value
dependent - attribute dependent value
mappedBy - attribute mapped-by value
column - attribute column value
table - attribute table value
deleteAction - attribute delete-action value
indexed - Whether this is indexed
unique - Apply a unique constraint
recursionDepth - The depth of fetch to use when recursing
loadFetchGroup - Name of the additional fetch group to use when loading
valueStrategy - attribute value-strategy value
foreignKey - The foreign key name
sequence - attribute sequence value
fieldType - Implementation type(s) for field.
Method Detail

mergeORMData

public void mergeORMData(AbstractPropertyMetaData ormFmd)
Method to merge in the associated metadata from the ORM definition

Parameters:
ormFmd - The ORM Field definition

populate

public void populate(ClassLoaderResolver clr,
                     java.lang.Class fieldType,
                     int modifiers)
Method to provide the details of the field being represented by this MetaData. This can be used to firstly provide defaults for attributes that aren't specified in the MetaData, and secondly to report any errors with attributes that have been specifed that are inconsistent with the field being represented.

Parameters:
clr - ClassLoaderResolver to use for any class loading
fieldType - The type of the field being represented
modifiers - The modifiers of the field being represented (Static, Abstract, Final, Volatile, etc)

initialise

public void initialise()
Initialisation method. This should be called AFTER using the populate method if you are going to use populate. It creates the internal convenience arrays etc needed for normal operation.

Overrides:
initialise in class MetaData

isFieldTypePersistenceCapable

public boolean isFieldTypePersistenceCapable()
Utility to return if this field is PersistenceCapable. Not valid for use by the enhancer. Must be overridden for that mode.

Returns:
Whether the field type is persistence capable.

isFieldArrayTypePersistenceCapable

public boolean isFieldArrayTypePersistenceCapable()
Utility to return if this array field has elements that are PersistenceCapable. Not valid for use by the enhancer. Must be overridden for that mode. If the field is not an array will return false.

Returns:
Whether the field type is persistence capable.

isStatic

public boolean isStatic()
Convenience method to return if this field represents a static field. When the object is not "populated" always returns false;

Returns:
Whether the field is static

isFinal

public boolean isFinal()
Convenience method to return if this field represents a final field. When the object is not "populated" always returns false;

Returns:
Whether the field is final

isTransient

public boolean isTransient()
Convenience method to return if this field represents a transient field. When the object is not "populated" always returns false;

Returns:
Whether the field is transient

getValueStrategy

public IdentityStrategy getValueStrategy()
The value-strategy attribute specifies the strategy used to generate values for the field. This attribute has the same values and meaning as the strategy attribute in datastoreidentity.

Returns:
the value strategy

getSequence

public java.lang.String getSequence()
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.

Returns:
the sequence name

getLoadFetchGroup

public java.lang.String getLoadFetchGroup()
Accessor for the (additional) fetch group for loading this field

Returns:
Returns the load fetch group

getRecursionDepth

public int getRecursionDepth()
Accessor for the depth of the fetch when recursing

Returns:
Returns the depth of the fetch when recursing

getAbstractClassMetaData

public AbstractClassMetaData getAbstractClassMetaData()
Convenience accessor for the MetaData of the parent class.

Returns:
Returns the MetaData of the parent class.

getOrderMetaData

public final OrderMetaData getOrderMetaData()
Accessor for orderMetaData

Returns:
Returns the orderMetaData.

getName

public java.lang.String getName()
Accessor for the field name

Returns:
field name

getFullFieldName

public java.lang.String getFullFieldName()
Accessor for the full field name. This prepends the class name.

Returns:
full field name.

fieldBelongsToClass

public boolean fieldBelongsToClass()
Accessor for whether the field is for a superclass, and not for this class.

Returns:
Whether the field belongs to a superclass

getClassName

public java.lang.String getClassName()
Accessor for the fully-qualified class name owning this field.

Returns:
The class name

getClassName

public java.lang.String getClassName(boolean fully_qualified)
Convenience to return the class name that this a field of.

Parameters:
fully_qualified - Whether the name should be fully qualified.
Returns:
Class name

getNullValue

public NullValue getNullValue()
Accessor for the null-value tag

Returns:
null-value tag

getPersistenceModifier

public FieldPersistenceModifier getPersistenceModifier()
Accessor for the persistence-modifier tag value

Returns:
persistence-modifier tag value

isDefaultFetchGroup

public boolean isDefaultFetchGroup()
Accessor for the default-fetch-group tag value

Returns:
default-fetch-group tag value

isDependent

public boolean isDependent()
Accessor for the dependent attribute indicates that the field contains a reference that is to be deleted from the datastore if the referring instance in which the field is declared is deleted, or if the referring field is nullified.

Returns:
dependent tag value

isEmbedded

public boolean isEmbedded()
Accessor for the embedded tag value. This value is a hint only to the implementation so will not mean that the type is certainly embedded.

Returns:
embedded tag value

isSerialized

public boolean isSerialized()
Accessor for the serialized tag value

Returns:
serialized tag value

isPrimaryKey

public boolean isPrimaryKey()
Accessor for the primary-key tag value.

Returns:
primary-key tag value.

getTable

public java.lang.String getTable()
Accessor for the table name

Returns:
table name

getFieldId

public int getFieldId()
Accessor for the field id. Not set when the field is an overriding field.

Returns:
field id

getFieldType

public final java.lang.String getFieldType()
Accessor for the implementation type(s) that can be stored in this field when it is a reference type. When more than one type is valid will be comma-separated.

Returns:
Returns the implementation type(s) for the field.

getAbsoluteFieldNumber

public int getAbsoluteFieldNumber()
Accessor for the field id

Returns:
field id

getType

public java.lang.Class getType()
Accessor for the field type

Returns:
Reflection field type

getTypeName

public java.lang.String getTypeName()
Accessor for the field type name

Returns:
Reflection field type name

getContainer

public ContainerMetaData getContainer()
Accessor for the container for this field.

Returns:
The MetaData of the container for this field.

getArray

public ArrayMetaData getArray()
Accessor for an array container for this field. Returns null if no array attached.

Returns:
The MetaData of the container for this field if an array

getCollection

public CollectionMetaData getCollection()
Accessor for a collection container for this field. Returns null if no collection attached.

Returns:
The MetaData of the container for this field if a Collection.

getMap

public MapMetaData getMap()
Accessor for a map container for this field. Returns null if no map attached.

Returns:
The MetaData of the container for this field if a Map.

getColumn

public final java.lang.String getColumn()
Accessor for the column

Returns:
Returns the column.

getMappedBy

public final java.lang.String getMappedBy()
Accessor for mappedBy

Returns:
Returns the mappedBy.

getColumnMetaData

public final ColumnMetaData[] getColumnMetaData()
Acessor for the columns

Specified by:
getColumnMetaData in interface ColumnMetaDataContainer
Returns:
Returns the columnMetaData.

getElementMetaData

public final ElementMetaData getElementMetaData()
Accessor for elementMetaData

Returns:
Returns the elementMetaData.

getKeyMetaData

public final KeyMetaData getKeyMetaData()
Accessor for keyMetaData

Returns:
Returns the keyMetaData.

getValueMetaData

public final ValueMetaData getValueMetaData()
Accessor for valueMetaData

Returns:
Returns the valueMetaData.

getEmbeddedMetaData

public final EmbeddedMetaData getEmbeddedMetaData()
Accessor for embeddedMetaData

Returns:
Returns the embeddedMetaData.

getForeignKeyMetaData

public final ForeignKeyMetaData getForeignKeyMetaData()
Accessor for foreignKeyMetaData

Returns:
Returns the foreignKeyMetaData.

getIndexMetaData

public final IndexMetaData getIndexMetaData()
Accessor for indexMetaData

Returns:
Returns the indexMetaData.

getUniqueMetaData

public final UniqueMetaData getUniqueMetaData()
Accessor for uniqueMetaData

Returns:
Returns the uniqueMetaData.

getJoinMetaData

public final JoinMetaData getJoinMetaData()
Accessor for joinMetaData

Returns:
Returns the joinMetaData.

addColumn

public void addColumn(ColumnMetaData colmd)
Add a new ColumnMetaData element

Specified by:
addColumn in interface ColumnMetaDataContainer
Parameters:
colmd - the ColumnMetaData to add

hasContainer

public boolean hasContainer()
Accessor for whether the field has a container.

Returns:
Whether it represents a container.

hasArray

public boolean hasArray()
Accessor for whether the field has an array

Returns:
return true if has array

hasCollection

public boolean hasCollection()
Accessor for whether the field has a collection

Returns:
return true if has collection

hasMap

public boolean hasMap()
Accessor for whether the field has a map.

Returns:
return true if has map

isJdoField

public boolean isJdoField()
Accessor for whether the field is to be managed by JDO.

Returns:
Whether it is JDO managed

setValueStrategy

public void setValueStrategy(IdentityStrategy valueStrategy)
The value-strategy attribute specifies the strategy used to generate values for the field. This attribute has the same values and meaning as the strategy attribute in datastoreidentity.

Parameters:
valueStrategy - the value strategy

setSequence

public void setSequence(java.lang.String sequence)
If the value-strategy is sequence, the sequence attribute specifies the name of the sequence to use to automatically generate a value for the field.

Parameters:
sequence - the sequence name

setDependent

public void setDependent(boolean dependent)
Mutator for dependent attribute.

Parameters:
dependent - Whether it is dependent.

setMappedBy

public void setMappedBy(java.lang.String mappedby)
Mutator for mappedBy

Parameters:
mappedby - The mapped-by field.

setContainer

public void setContainer(ContainerMetaData conmd)
Method to set the container for this field (if this field represents a container (collection, map, array).

Parameters:
conmd - The MetaData of the container for this field.

setElementMetaData

public final void setElementMetaData(ElementMetaData elementMetaData)
Mutator for the element MetaData

Parameters:
elementMetaData - The elementMetaData to set.

setKeyMetaData

public final void setKeyMetaData(KeyMetaData keyMetaData)
Mutator for the key MetaData

Parameters:
keyMetaData - The keyMetaData to set.

setOrderMetaData

public final void setOrderMetaData(OrderMetaData orderMetaData)
Mutator for the order MetaData

Parameters:
orderMetaData - The orderMetaData to set.

setValueMetaData

public final void setValueMetaData(ValueMetaData valueMetaData)
Mutator for the value MetaData

Parameters:
valueMetaData - The valueMetaData to set.

setEmbeddedMetaData

public final void setEmbeddedMetaData(EmbeddedMetaData embeddedMetaData)
Mutator for the embedded MetaData

Parameters:
embeddedMetaData - The embeddedMetaData to set.

setForeignKeyMetaData

public final void setForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData)
Mutator for the foreignKey MetaData

Parameters:
foreignKeyMetaData - The foreignKeyMetaData to set.

setIndexMetaData

public final void setIndexMetaData(IndexMetaData indexMetaData)
Mutator for the index MetaData

Parameters:
indexMetaData - The indexMetaData to set.

setUniqueMetaData

public final void setUniqueMetaData(UniqueMetaData uniqueMetaData)
Mutator for the unique MetaData

Parameters:
uniqueMetaData - The uniqueMetaData to set.

setJoinMetaData

public final void setJoinMetaData(JoinMetaData joinMetaData)
Mutator for the join MetaData

Parameters:
joinMetaData - The joinMetaData to set.

setTable

public void setTable(java.lang.String table)
Mutator for the table name

Parameters:
table - The table name

setRelation

protected void setRelation(ClassLoaderResolver clr)
Convenience method that sets up the relation type of this field, and the reference to any related field when it is bidirectional. If the relation is bidirectional then will also set the other side of the relation (to relate to this side).

Parameters:
clr - ClassLoader resolver

getRelationType

public int getRelationType(ClassLoaderResolver clr)
Accessor for the relation type for this field.

Parameters:
clr - ClassLoader resolver
Returns:
The relation type.

getRelatedFieldMetaData

public AbstractPropertyMetaData getRelatedFieldMetaData(ClassLoaderResolver clr)
Accessor for the FieldMetaData of any related field (where this field is part of a bidirectional relation). Allows for 1-1, 1-N, and M-N. If this field is not part of a bidirectional relation (no "mapped-by" at either end) then it returns null.

Parameters:
clr - the ClassLoaderResolver
Returns:
The FieldMetaData for the "other end".

toString

public java.lang.String toString()
Accessor for a string representation of the object.

Overrides:
toString in class ExtendableMetaData
Returns:
a string representation of the object.

toString

public java.lang.String toString(java.lang.String prefix,
                                 java.lang.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.

Overrides:
toString in class ExtendableMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.

compareTo

public int compareTo(java.lang.Object o)
Comparator method. This allows the ClassMetaData to search for a FieldMetaData with a particular name.

Specified by:
compareTo in interface java.lang.Comparable
Parameters:
o - The object to compare against
Returns:
The comparison result

getMetaDataManager

public MetaDataManager getMetaDataManager()
Convenience accessor for the MetaData Manager in use.

Returns:
MetaDataManager.


Copyright © -2007 . All Rights Reserved.