Class AbstractElementMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.AbstractElementMetaData
- All Implemented Interfaces:
Serializable, ColumnMetaDataContainer
- Direct Known Subclasses:
ElementMetaData, KeyMetaData, ValueMetaData
This element specifies the mapping for the element component of arrays and collections.
If only one column is mapped, and no additional information is needed for the column, then the
column attribute can be used. Otherwise, the column element(s) are used.
The serialized attribute specifies that the key values are to be serialized into the named column.
The foreign-key attribute specifies the name of a foreign key to be generated.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Stringprotected List<ColumnMetaData> protected EmbeddedMetaDataDefinition of embedding of the element/key/value.protected ForeignKeyMetaDataForeignKeyMetaDataprotected IndexedValueThe indexing valueprotected IndexMetaDataIndexMetaDataprotected StringField that this is mapped to.private static final longprotected Stringprotected booleanWhether to add a unique constraintprotected UniqueMetaDataUniqueMetaData.Fields inherited from class MetaData
EXTENSION_CLASS_CREATETIMESTAMP, EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_CREATEUSER, EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_CREATEUSER_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH, EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, EXTENSION_CLASS_MULTITENANT, EXTENSION_CLASS_READ_ONLY, EXTENSION_CLASS_SOFTDELETE, EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME, EXTENSION_CLASS_UPDATETIMESTAMP, EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME, EXTENSION_CLASS_UPDATEUSER, EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH, EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME, EXTENSION_CLASS_VERSION_FIELD_NAME, EXTENSION_CLASS_VIEW_DEFINITION, EXTENSION_CLASS_VIEW_IMPORTS, EXTENSION_INDEX_COLUMN_ORDERING, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_ATTACH, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_CREATE_TIMESTAMP, EXTENSION_MEMBER_CREATE_USER, EXTENSION_MEMBER_ENUM_VALUE_GETTER, EXTENSION_MEMBER_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_INSERTABLE, EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES, EXTENSION_MEMBER_LIST_ORDERING, EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN, EXTENSION_MEMBER_RELATION_DISCRIM_PK, EXTENSION_MEMBER_RELATION_DISCRIM_VALUE, EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL, EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED, EXTENSION_MEMBER_TYPE_CONVERTER_NAME, EXTENSION_MEMBER_UPDATE_TIMESTAMP, EXTENSION_MEMBER_UPDATE_USER, EXTENSION_MEMBER_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, metaDataState, parent, VENDOR_NAME -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.Constructor to create a copy of the passed metadata object. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddColumn(ColumnMetaData colmd) Add a new ColumnMetaData elementfinal ColumnMetaData[]Accessor for columnMetaDatafinal Stringfinal EmbeddedMetaDataAccessor for embeddedMetaDatafinal ForeignKeyMetaDataAccessor for foreignKeyMetaDatafinal IndexMetaDataAccessor for indexMetaDatagetTable()final UniqueMetaDataAccessor for uniqueMetaDatavoidMethod to initialise the object, creating any convenience arrays needed.booleanisUnique()Method to create a column metadata, add it, and return it.Method to create an embedded metadata, add it, and return it.Method to create a unique metadata, add it, and return it.Method to create an index metadata, add it, and return it.Method to create a unique metadata, add it, and return it.voidpopulate(ClassLoaderResolver clr, ClassLoader primary) Populate the metadata.voidsetColumnName(String columnName) voidsetDeleteAction(String deleteAction) voidsetDeleteAction(ForeignKeyAction deleteAction) final voidsetEmbeddedMetaData(EmbeddedMetaData embeddedMetaData) Mutator for the Embedded MetaDatafinal voidsetForeignKeyMetaData(ForeignKeyMetaData foreignKeyMetaData) Mutator for the Foreign Key MetaDatavoidsetIndexed(IndexedValue indexed) final voidsetIndexMetaData(IndexMetaData indexMetaData) Mutator for the Index MetaDatavoidsetMappedBy(String mappedBy) voidvoidsetUnique(boolean unique) final voidsetUniqueMetaData(UniqueMetaData uniqueMetaData) Mutator for the Unique MetaDatavoidsetUpdateAction(String updateAction) voidsetUpdateAction(ForeignKeyAction updateAction) Methods inherited from class MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setInitialised, setParent, setPopulated, setUsed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
unique
protected boolean uniqueWhether to add a unique constraint -
mappedBy
Field that this is mapped to. -
indexed
The indexing value -
indexMetaData
IndexMetaData -
uniqueMetaData
UniqueMetaData. -
foreignKeyMetaData
ForeignKeyMetaData -
embeddedMetaData
Definition of embedding of the element/key/value. Only present if defined by user. -
table
-
columnName
-
columns
-
-
Constructor Details
-
AbstractElementMetaData
Constructor to create a copy of the passed metadata object.- Parameters:
aemd- The metadata to copy
-
AbstractElementMetaData
public AbstractElementMetaData()Default constructor. Set the fields using setters, before populate().
-
-
Method Details
-
populate
Populate the metadata.- Parameters:
clr- the ClassLoaderResolverprimary- the primary ClassLoader to use (or null)
-
initialise
Method to initialise the object, creating any convenience arrays needed. Initialises all sub-objects.- Overrides:
initialisein classMetaData
-
getTable
-
setTable
-
getMappedBy
-
setMappedBy
-
getIndexed
-
setIndexed
-
isUnique
public boolean isUnique() -
setUnique
public void setUnique(boolean unique) -
getForeignKeyMetaData
Accessor for foreignKeyMetaData- Returns:
- Returns the foreignKeyMetaData.
-
getDeleteAction
-
setDeleteAction
-
setDeleteAction
-
getUpdateAction
-
setUpdateAction
-
setUpdateAction
-
getColumnName
-
setColumnName
-
getColumnMetaData
Accessor for columnMetaData- Specified by:
getColumnMetaDatain interfaceColumnMetaDataContainer- Returns:
- Returns the columnMetaData.
-
addColumn
Add a new ColumnMetaData element- Specified by:
addColumnin interfaceColumnMetaDataContainer- Parameters:
colmd- The Column MetaData
-
newColumnMetaData
Method to create a column metadata, add it, and return it.- Returns:
- The column metadata
-
getEmbeddedMetaData
Accessor for embeddedMetaData- Returns:
- Returns the embeddedMetaData.
-
setEmbeddedMetaData
Mutator for the Embedded MetaData- Parameters:
embeddedMetaData- The embeddedMetaData to set.
-
newEmbeddedMetaData
Method to create an embedded metadata, add it, and return it.- Returns:
- The embedded metadata
-
setForeignKeyMetaData
Mutator for the Foreign Key MetaData- Parameters:
foreignKeyMetaData- The foreignKeyMetaData to set.
-
newForeignKeyMetaData
Method to create a unique metadata, add it, and return it.- Returns:
- The unique metadata
-
getIndexMetaData
Accessor for indexMetaData- Returns:
- Returns the indexMetaData.
-
setIndexMetaData
Mutator for the Index MetaData- Parameters:
indexMetaData- The indexMetaData to set.
-
newIndexMetaData
Method to create an index metadata, add it, and return it.- Returns:
- The index metadata
-
getUniqueMetaData
Accessor for uniqueMetaData- Returns:
- Returns the uniqueMetaData.
-
setUniqueMetaData
Mutator for the Unique MetaData- Parameters:
uniqueMetaData- The uniqueMetaData to set.
-
newUniqueMetaData
Method to create a unique metadata, add it, and return it.- Returns:
- The unique metadata
-