Package org.datanucleus.metadata
Class MapMetaData
- java.lang.Object
-
- org.datanucleus.metadata.MetaData
-
- org.datanucleus.metadata.ContainerMetaData
-
- org.datanucleus.metadata.MapMetaData
-
- All Implemented Interfaces:
Serializable
public class MapMetaData extends ContainerMetaData
Representation of the Meta-Data for a Map.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapMetaData.MapType
-
Field Summary
Fields Modifier and Type Field Description protected org.datanucleus.metadata.ContainerComponent
key
Representation of the key of the map.protected MapMetaData.MapType
mapType
Type of map.protected org.datanucleus.metadata.ContainerComponent
value
Representation of the value of the map.-
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_DISABLE, EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE, 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_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, EXTENSION_MEMBER_CASCADE_DETACH, EXTENSION_MEMBER_CASCADE_PERSIST, EXTENSION_MEMBER_CASCADE_REFRESH, EXTENSION_MEMBER_CASCADE_UPDATE, EXTENSION_MEMBER_COMPARATOR_NAME, EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS, EXTENSION_MEMBER_ENUM_GETTER_BY_VALUE, 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_UPDATEABLE, EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES, EXTENSION_VERSION_NUMBER_INITIAL_VALUE, extensions, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME
-
-
Constructor Summary
Constructors Constructor Description MapMetaData()
Default constructor.MapMetaData(MapMetaData mapmd)
Constructor to create a copy of the passed metadata.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AbstractClassMetaData
getKeyClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Key ClassMetaData.String
getKeyType()
Accessor for the key-type tag value.String[]
getKeyTypes()
MapMetaData.MapType
getMapType()
AbstractClassMetaData
getValueClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Value ClassMetaDataString
getValueType()
Accessor for the value-type tag value.String[]
getValueTypes()
boolean
isDependentKey()
Accessor for the dependent-key attribute indicates that the map's key contains references that are to be deleted if the referring instance is deleted.boolean
isDependentValue()
Accessor for the dependent-value attribute indicates that the map's value contains references that are to be deleted if the referring instance is deleted.boolean
isEmbeddedKey()
Accessor for the embedded-key tag value.boolean
isEmbeddedValue()
Accessor for the embedded-value tag value.boolean
isSerializedKey()
Accessor for the serialized-key tag value.boolean
isSerializedValue()
Accessor for the serialized-value tag value.boolean
keyIsPersistent()
void
populate(ClassLoaderResolver clr, ClassLoader primary)
Method to populate any defaults, and check the validity of the MetaData.MapMetaData
setDependentKey(boolean dependent)
MapMetaData
setDependentValue(boolean dependent)
MapMetaData
setEmbeddedKey(boolean embedded)
MapMetaData
setEmbeddedValue(boolean embedded)
MapMetaData
setKeyType(String type)
MapMetaData
setSerializedKey(boolean serialized)
MapMetaData
setSerializedValue(boolean serialized)
MapMetaData
setValueType(String type)
String
toString()
boolean
valueIsPersistent()
-
Methods inherited from class org.datanucleus.metadata.ContainerMetaData
allowNulls, getFieldName, getMemberMetaData, 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
-
mapType
protected MapMetaData.MapType mapType
Type of map.
-
key
protected org.datanucleus.metadata.ContainerComponent key
Representation of the key of the map.
-
value
protected org.datanucleus.metadata.ContainerComponent value
Representation of the value of the map.
-
-
Constructor Detail
-
MapMetaData
public MapMetaData(MapMetaData mapmd)
Constructor to create a copy of the passed metadata.- Parameters:
mapmd
- The metadata to copy
-
MapMetaData
public MapMetaData()
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 loading any key/value typesprimary
- the primary ClassLoader to use (or null)
-
getMapType
public MapMetaData.MapType getMapType()
-
getKeyClassMetaData
public AbstractClassMetaData getKeyClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Key ClassMetaData.- Parameters:
clr
- ClassLoader resolver (in case we need to initialise it)- Returns:
- key ClassMetaData
-
keyIsPersistent
public boolean keyIsPersistent()
-
getValueClassMetaData
public AbstractClassMetaData getValueClassMetaData(ClassLoaderResolver clr)
Convenience accessor for the Value ClassMetaData- Parameters:
clr
- ClassLoader resolver (in case we need to initialise it)- Returns:
- value ClassMetaData
-
valueIsPersistent
public boolean valueIsPersistent()
-
isEmbeddedKey
public boolean isEmbeddedKey()
Accessor for the embedded-key tag value.- Returns:
- embedded-key tag value
-
isEmbeddedValue
public boolean isEmbeddedValue()
Accessor for the embedded-value tag value.- Returns:
- embedded-value tag value
-
isSerializedKey
public boolean isSerializedKey()
Accessor for the serialized-key tag value.- Returns:
- serialized-key tag value
-
isSerializedValue
public boolean isSerializedValue()
Accessor for the serialized-value tag value.- Returns:
- serialized-value tag value
-
isDependentKey
public boolean isDependentKey()
Accessor for the dependent-key attribute indicates that the map's key contains references that are to be deleted if the referring instance is deleted.- Returns:
- dependent-key tag value
-
isDependentValue
public boolean isDependentValue()
Accessor for the dependent-value attribute indicates that the map's value contains references that are to be deleted if the referring instance is deleted.- Returns:
- dependent-value tag value
-
getKeyType
public String getKeyType()
Accessor for the key-type tag value.- Returns:
- key-type tag value
-
getKeyTypes
public String[] getKeyTypes()
-
setKeyType
public MapMetaData setKeyType(String type)
-
setEmbeddedKey
public MapMetaData setEmbeddedKey(boolean embedded)
-
setSerializedKey
public MapMetaData setSerializedKey(boolean serialized)
-
setDependentKey
public MapMetaData setDependentKey(boolean dependent)
-
getValueType
public String getValueType()
Accessor for the value-type tag value.- Returns:
- value-type tag value
-
getValueTypes
public String[] getValueTypes()
-
setValueType
public MapMetaData setValueType(String type)
-
setEmbeddedValue
public MapMetaData setEmbeddedValue(boolean embedded)
-
setSerializedValue
public MapMetaData setSerializedValue(boolean serialized)
-
setDependentValue
public MapMetaData setDependentValue(boolean dependent)
-
-