org.datanucleus.metadata
Class FieldMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractMemberMetaData
          extended by org.datanucleus.metadata.FieldMetaData
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable, ColumnMetaDataContainer

public class FieldMetaData
extends AbstractMemberMetaData

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.

Field Management

Each field can be managed by us or not. The class provides a method for identifying if a field is managed by us (isJdoField()). If a field is managed by us, 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).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.datanucleus.metadata.AbstractMemberMetaData
cacheable, cascadeDelete, cascadePersist, cascadeRefresh, cascadeRemoveOrphans, cascadeUpdate, catalog, className, column, columnMetaData, columns, containerMetaData, DEFAULT_RECURSION_DEPTH, defaultFetchGroup, dependent, elementMetaData, embedded, embeddedMetaData, fieldId, fieldTypes, foreignKeyMetaData, fullFieldName, indexed, indexMetaData, joinMetaData, keyMetaData, loadFetchGroup, mappedBy, memberRepresented, name, nullValue, ordered, orderMetaData, persistenceFlags, persistenceModifier, persistFinal, persistStatic, persistTransient, primaryKey, recursionDepth, relatedMemberMetaData, relationType, schema, sequence, serialized, storeInLob, table, targetClassName, type, UNDEFINED_RECURSION_DEPTH, uniqueConstraint, uniqueMetaData, valueGeneratorName, valueMetaData, valueStrategy
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
FieldMetaData(MetaData parent, AbstractMemberMetaData fmd)
          Convenience constructor to copy the specification from the passed field.
FieldMetaData(MetaData parent, java.lang.String name)
          Constructor.
 
Method Summary
 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.datanucleus.metadata.AbstractMemberMetaData
addColumn, calcIsSecondClassMutable, compareTo, fetchFKOnly, fieldBelongsToClass, getAbsoluteFieldNumber, getAbstractClassMetaData, getArray, getCatalog, getClassName, getClassName, getCollection, getColumn, getColumnMetaData, getContainer, getDefaultFieldPersistenceModifier, getElementMetaData, getEmbeddedMetaData, getFieldId, getFieldTypes, getForeignKeyMetaData, getFullFieldName, getIndexed, getIndexMetaData, getJoinMetaData, getKeyMetaData, getLoadFetchGroup, getMap, getMappedBy, getMemberRepresented, getName, getNullValue, getOrderMetaData, getOverallParentClassMetaData, getPersistenceFlags, getPersistenceModifier, getRecursionDepth, getRelatedMemberMetaData, getRelatedMemberMetaDataForObject, getRelationType, getSchema, getSequence, getTable, getType, getTypeName, getUniqueMetaData, getValueGeneratorName, getValueMetaData, getValueStrategy, hasArray, hasCollection, hasContainer, hasMap, initialise, isAbstract, isCacheable, isCascadeDelete, isCascadePersist, isCascadeRefresh, isCascadeRemoveOrphans, isCascadeUpdate, isDefaultFetchGroup, isDependent, isEmbedded, isFieldArrayTypePersistable, isFieldToBePersisted, isFinal, isPersistentInterface, isPrimaryKey, isPrivate, isProtected, isPublic, isRelationOwner, isSerialized, isStatic, isTransient, isUnique, newArrayMetaData, newCollectionMetaData, newColumnMetaData, newElementMetaData, newEmbeddedMetaData, newForeignKeyMetaData, newIndexMetaData, newJoinMetadata, newJoinMetaData, newKeyMetaData, newMapMetaData, newOrderMetaData, newUniqueMetaData, newValueMetaData, populate, setCacheable, setCascadeDelete, setCascadePersist, setCascadeRefresh, setCascadeRemoveOrphans, setCascadeUpdate, setCatalog, setColumn, setContainer, setDefaultFetchGroup, setDefaultFetchGroup, setDeleteAction, setDependent, setDependent, setElementMetaData, setEmbedded, setEmbedded, setEmbeddedMetaData, setFieldTypes, setForeignKeyMetaData, setIndexed, setIndexMetaData, setJoinMetaData, setKeyMetaData, setLoadFetchGroup, setMappedBy, setNotPersistent, setNullValue, setOrdered, setOrderMetaData, setPersistenceModifier, setPrimaryKey, setPrimaryKey, setRecursionDepth, setRecursionDepth, setRelation, setSchema, setSequence, setSerialised, setSerialised, setStoreInLob, setTable, setTargetClassName, setTransactional, setUnique, setUnique, setUniqueMetaData, setValueGeneratorName, setValueMetaData, setValueStrategy, setValueStrategy
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FieldMetaData

public FieldMetaData(MetaData parent,
                     AbstractMemberMetaData 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

FieldMetaData

public FieldMetaData(MetaData parent,
                     java.lang.String name)
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
Method Detail

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 AbstractMemberMetaData
Parameters:
prefix - prefix string
indent - indent string
Returns:
a string representation of the object.


Copyright © 2011. All Rights Reserved.