Package org.datanucleus.metadata
Class EmbeddedMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.EmbeddedMetaData
- All Implemented Interfaces:
Serializable
This element specifies the mapping for an embedded type.
It contains multiple field elements, one for each field in the type.
The nullIndicatorColumn optionally identifies the name of the column used to indicate whether the embedded instance is null. By default, if the value of this column is null, then the embedded instance is null. This column might be mapped to a field of the embedded instance but might be a synthetic column for the sole purpose of indicating a null reference. The nullIndicatorValue specifies the value to indicate that the embedded instance is null. This is only used for non-nullable columns. If nullIndicatorColumn is omitted, then the embedded instance is assumed always to exist.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected DiscriminatorMetaData
Discriminator for use when embedding objects with inheritance.protected final List
<AbstractMemberMetaData> Member definition of the embedded object.protected String
Name of a column used for determining if the embedded object is nullprotected String
Value in the null column indicating that the embedded object is nullprotected String
Name of the field/property in the embedded object that refers to the owner (bidirectional relation).private static final long
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.EmbeddedMetaData
(EmbeddedMetaData embmd) Constructor to create a copy of the passed metadata. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Method to add a member to the embedded definition.final DiscriminatorMetaData
final List
<AbstractMemberMetaData> Accessor for metadata for the embedded members.final String
final String
final String
void
Method to initialise the object, creating all internal convenience arrays.Method to create a new discriminator metadata, assign it to this inheritance, and return it.newFieldMetaData
(String name) Method to create a new FieldMetaData, add it, and return it.newPropertyMetaData
(String name) Method to create a new PropertyMetaData, add it, and return it.void
populate
(ClassLoaderResolver clr, ClassLoader primary) Method to populate the embedded MetaData.setNullIndicatorColumn
(String column) setNullIndicatorValue
(String value) setOwnerMember
(String ownerMember) toString()
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:
-
ownerMember
Name of the field/property in the embedded object that refers to the owner (bidirectional relation). -
nullIndicatorColumn
Name of a column used for determining if the embedded object is null -
nullIndicatorValue
Value in the null column indicating that the embedded object is null -
discriminatorMetaData
Discriminator for use when embedding objects with inheritance. -
members
Member definition of the embedded object.
-
-
Constructor Details
-
EmbeddedMetaData
Constructor to create a copy of the passed metadata.- Parameters:
embmd
- The metadata to copy
-
EmbeddedMetaData
public EmbeddedMetaData()Default constructor. Use setters to set fields, before calling populate().
-
-
Method Details
-
populate
Method to populate the embedded MetaData. This performs checks on the validity of the field types for embedding.- Parameters:
clr
- The class loader to use where necessaryprimary
- the primary ClassLoader to use (or null)
-
initialise
Method to initialise the object, creating all internal convenience arrays.- Overrides:
initialise
in classMetaData
- Parameters:
clr
- ClassLoader resolver
-
getMemberMetaData
Accessor for metadata for the embedded members.- Returns:
- Returns the metadata for any defined members.
-
getOwnerMember
-
setOwnerMember
-
getNullIndicatorColumn
-
setNullIndicatorColumn
-
getNullIndicatorValue
-
setNullIndicatorValue
-
getDiscriminatorMetaData
-
setDiscriminatorMetaData
-
newDiscriminatorMetaData
Method to create a new discriminator metadata, assign it to this inheritance, and return it.- Returns:
- The discriminator metadata
-
addMember
Method to add a member to the embedded definition. Rejects the addition of duplicate named members, or when we have already initialised this embedded definition.- Parameters:
mmd
- Meta-Data for the member
-
newFieldMetaData
Method to create a new FieldMetaData, add it, and return it.- Parameters:
name
- Name of the field- Returns:
- The FieldMetaData
-
newPropertyMetaData
Method to create a new PropertyMetaData, add it, and return it.- Parameters:
name
- Name of the property- Returns:
- The PropertyMetaData
-
toString
-