Package org.datanucleus.metadata
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 String
protected List
<ColumnMetaData> protected EmbeddedMetaData
Definition of embedding of the element/key/value.protected ForeignKeyMetaData
ForeignKeyMetaDataprotected IndexedValue
The indexing valueprotected IndexMetaData
IndexMetaDataprotected String
Field that this is mapped to.private static final long
protected String
protected boolean
Whether to add a unique constraintprotected UniqueMetaData
UniqueMetaData.Fields inherited from class org.datanucleus.metadata.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 TypeMethodDescriptionvoid
addColumn
(ColumnMetaData colmd) Add a new ColumnMetaData elementfinal ColumnMetaData[]
Accessor for columnMetaDatafinal String
final EmbeddedMetaData
Accessor for embeddedMetaDatafinal ForeignKeyMetaData
Accessor for foreignKeyMetaDatafinal IndexMetaData
Accessor for indexMetaDatagetTable()
final UniqueMetaData
Accessor for uniqueMetaDatavoid
Method to initialise the object, creating any convenience arrays needed.boolean
isUnique()
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.void
populate
(ClassLoaderResolver clr, ClassLoader primary) Populate the metadata.void
setColumnName
(String columnName) void
setDeleteAction
(String deleteAction) void
setDeleteAction
(ForeignKeyAction deleteAction) final void
setEmbeddedMetaData
(EmbeddedMetaData embeddedMetaData) Mutator for the Embedded MetaDatafinal void
setForeignKeyMetaData
(ForeignKeyMetaData foreignKeyMetaData) Mutator for the Foreign Key MetaDatavoid
setIndexed
(IndexedValue indexed) final void
setIndexMetaData
(IndexMetaData indexMetaData) Mutator for the Index MetaDatavoid
setMappedBy
(String mappedBy) void
void
setUnique
(boolean unique) final void
setUniqueMetaData
(UniqueMetaData uniqueMetaData) Mutator for the Unique MetaDatavoid
setUpdateAction
(String updateAction) void
setUpdateAction
(ForeignKeyAction updateAction) Methods inherited from class org.datanucleus.metadata.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:
initialise
in 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:
getColumnMetaData
in interfaceColumnMetaDataContainer
- Returns:
- Returns the columnMetaData.
-
addColumn
Add a new ColumnMetaData element- Specified by:
addColumn
in 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
-