- java.lang.Object
-
- org.datanucleus.metadata.MetaData
-
- org.datanucleus.metadata.ContainerMetaData
-
- org.datanucleus.metadata.CollectionMetaData
-
- All Implemented Interfaces:
Serializable
public class CollectionMetaData extends ContainerMetaData
Representation of the MetaData of a collection.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected org.datanucleus.metadata.ContainerComponent
element
Representation of the element of the collection.protected boolean
singleElement
Whether this collection handles more than one element.-
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_FETCH_FK_ONLY, 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
Constructors Constructor Description CollectionMetaData()
Default constructor.CollectionMetaData(CollectionMetaData collmd)
Constructor to create a copy of the passed metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
elementIsPersistent()
AbstractClassMetaData
getElementClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Element ClassMetaData.String
getElementType()
Accessor for the element-type tag value.String[]
getElementTypes()
boolean
isDependentElement()
Accessor for The dependent-element attribute indicates that the collection's element contains a reference that is to be deleted if the referring instance is deleted.boolean
isEmbeddedElement()
Accessor for the embedded-element tag valueboolean
isSerializedElement()
Accessor for the serialized-element tag valuevoid
populate(ClassLoaderResolver clr, ClassLoader primary)
Method to populate any defaults, and check the validity of the MetaData.CollectionMetaData
setDependentElement(boolean dependent)
CollectionMetaData
setElementType(String type)
CollectionMetaData
setEmbeddedElement(boolean embedded)
CollectionMetaData
setSerializedElement(boolean serialized)
CollectionMetaData
setSingleElement(boolean singleElement)
String
toString()
-
Methods inherited from class org.datanucleus.metadata.ContainerMetaData
allowNulls, getMemberMetaData, getMemberName, populate
-
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtensions, getExtensions, getMetaDataManager, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setParent
-
-
-
-
Field Detail
-
element
protected org.datanucleus.metadata.ContainerComponent element
Representation of the element of the collection.
-
singleElement
protected boolean singleElement
Whether this collection handles more than one element. Some collection, e.g. java.lang.Optional, will always hold only one element.
-
-
Constructor Detail
-
CollectionMetaData
public CollectionMetaData(CollectionMetaData collmd)
Constructor to create a copy of the passed metadata.- Parameters:
collmd
- The metadata to copy
-
CollectionMetaData
public CollectionMetaData()
Default constructor. Set the fields using setters, before populate().
-
-
Method Detail
-
populate
public void populate(ClassLoaderResolver clr, ClassLoader primary)
Method to populate any defaults, and check the validity of the MetaData.- Parameters:
clr
- ClassLoaderResolver to use for any loading operationsprimary
- the primary ClassLoader to use (or null)
-
elementIsPersistent
public boolean elementIsPersistent()
-
getElementClassMetaData
public AbstractClassMetaData getElementClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Element ClassMetaData.- Parameters:
clr
- ClassLoader resolver (in case we need to initialise it)- Returns:
- element ClassMetaData
-
isEmbeddedElement
public boolean isEmbeddedElement()
Accessor for the embedded-element tag value- Returns:
- embedded-element tag value
-
isDependentElement
public boolean isDependentElement()
Accessor for The dependent-element attribute indicates that the collection's element contains a reference that is to be deleted if the referring instance is deleted.- Returns:
- dependent-element tag value
-
isSerializedElement
public boolean isSerializedElement()
Accessor for the serialized-element tag value- Returns:
- serialized-element tag value
-
getElementType
public String getElementType()
Accessor for the element-type tag value.- Returns:
- element-type tag value
-
getElementTypes
public String[] getElementTypes()
-
setElementType
public CollectionMetaData setElementType(String type)
-
setEmbeddedElement
public CollectionMetaData setEmbeddedElement(boolean embedded)
-
setSerializedElement
public CollectionMetaData setSerializedElement(boolean serialized)
-
setDependentElement
public CollectionMetaData setDependentElement(boolean dependent)
-
setSingleElement
public CollectionMetaData setSingleElement(boolean singleElement)
-
-