Package org.datanucleus.metadata
Class CollectionMetaData
java.lang.Object
org.datanucleus.metadata.MetaData
org.datanucleus.metadata.ContainerMetaData
org.datanucleus.metadata.CollectionMetaData
- All Implemented Interfaces:
Serializable
Representation of the MetaData of a collection.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected ContainerComponent
Representation of the element of the collection.private static final long
protected boolean
Whether this collection handles more than one element.Fields inherited from class org.datanucleus.metadata.ContainerMetaData
allowNulls
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.CollectionMetaData
(CollectionMetaData collmd) Constructor to create a copy of the passed metadata. -
Method Summary
Modifier and TypeMethodDescriptionboolean
Convenience accessor for the Element ClassMetaData.Accessor for the element-type tag value.String[]
(package private) void
getReferencedClassMetaData
(List<AbstractClassMetaData> orderedCmds, Set<AbstractClassMetaData> referencedCmds, ClassLoaderResolver clr) Accessor for all ClassMetaData referenced by this array.boolean
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
Accessor for the embedded-element tag valueboolean
Accessor for the serialized-element tag valuevoid
populate
(ClassLoaderResolver clr, ClassLoader primary) Method to populate any defaults, and check the validity of the MetaData.setDependentElement
(boolean dependent) setElementType
(String type) setEmbeddedElement
(boolean embedded) setSerializedElement
(boolean serialized) setSingleElement
(boolean singleElement) 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, setInitialised, setParent, setPopulated, setUsed
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
element
Representation of the element of the collection. -
singleElement
protected boolean singleElementWhether this collection handles more than one element. Some collection, e.g. java.lang.Optional, will always hold only one element.
-
-
Constructor Details
-
CollectionMetaData
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 Details
-
populate
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
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
Accessor for the element-type tag value.- Returns:
- element-type tag value
-
getElementTypes
-
setElementType
-
setEmbeddedElement
-
setSerializedElement
-
setDependentElement
-
setSingleElement
-
getReferencedClassMetaData
void getReferencedClassMetaData(List<AbstractClassMetaData> orderedCmds, Set<AbstractClassMetaData> referencedCmds, ClassLoaderResolver clr) Accessor for all ClassMetaData referenced by this array.- Parameters:
orderedCmds
- List of ordered ClassMetaData objects (added to).referencedCmds
- Set of all ClassMetaData objects (added to).clr
- the ClassLoaderResolver
-
toString
-