Package org.datanucleus.metadata
Class MetaData
- java.lang.Object
-
- org.datanucleus.metadata.MetaData
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
AbstractClassMetaData,AbstractElementMetaData,AbstractMemberMetaData,ColumnMetaData,ConstraintMetaData,ContainerMetaData,DatastoreIdentityMetaData,DiscriminatorMetaData,EmbeddedMetaData,EventListenerMetaData,FetchGroupMemberMetaData,FetchGroupMetaData,FetchPlanMetaData,FileMetaData,ImplementsMetaData,InheritanceMetaData,JoinMetaData,MultitenancyMetaData,OrderMetaData,PackageMetaData,PersistenceFileMetaData,PersistenceUnitMetaData,PrimaryKeyMetaData,QueryMetaData,QueryResultMetaData,SequenceMetaData,SoftDeleteMetaData,StoredProcQueryMetaData,StoredProcQueryParameterMetaData,TableGeneratorMetaData,VersionMetaData
public class MetaData extends Object implements Serializable
Base class for all MetaData.MetaData Lifecycle
The states represent the lifecycle of a MetaData object. The lifecycle goes as follows :- MetaData object is created (values passed in from a parsed file, or manually generated)
- MetaData object is populated (maybe pass in a class that it represents, creating any additional information that wasn't in the initial data).
- MetaData object is initialised (any internal arrays are set up, and additions of data is blocked from this point).
- MetaData object is added to with runtime information like actual column names and types in use.
MetaData Extensibility
All MetaData elements are extensible with extensions. We only store the DataNucleus vendor extensions here.
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static StringEXTENSION_CLASS_CREATETIMESTAMPClass : when the class will have a create-timestamp column for auditing.static StringEXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAMEClass : when the class will have a create-timestamp column for auditing, specifies the column name to use.static StringEXTENSION_CLASS_CREATEUSERClass : when the class will have a create-user column for auditing.static StringEXTENSION_CLASS_CREATEUSER_COLUMN_LENGTHClass : when the class will have a create-user column for auditing, defines the length of column to use.static StringEXTENSION_CLASS_CREATEUSER_COLUMN_NAMEClass : when the class will have a create-user column for auditing, specifies the column name to use.static StringEXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTHClass : when using multitenancy, defines the length of column used for the mutitenancy discriminator.static StringEXTENSION_CLASS_MULTITENANCY_COLUMN_NAMEClass : when using multitenancy, defines the column name used for the mutitenancy discriminator.static StringEXTENSION_CLASS_MULTITENANCY_JDBC_TYPEClass : when using multitenancy, defines the jdbc-type used for the mutitenancy discriminator column.static StringEXTENSION_CLASS_MULTITENANTClass : when using multitenancy for this class.static StringEXTENSION_CLASS_READ_ONLYClass : read only.static StringEXTENSION_CLASS_SOFTDELETEClass : when the class will use soft deletion (deletion flag column) rather than actually deleting objects.static StringEXTENSION_CLASS_SOFTDELETE_COLUMN_NAMEClass : when the class will use soft deletion, specifies the column name to use.static StringEXTENSION_CLASS_UPDATETIMESTAMPClass : when the class will have a update-timestamp column for auditing.static StringEXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAMEClass : when the class will have a update-timestamp column for auditing, specifies the column name to use.static StringEXTENSION_CLASS_UPDATEUSERClass : when the class will have a update-user column for auditing.static StringEXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTHClass : when the class will have a update-user column for auditing, defines the length of column to use.static StringEXTENSION_CLASS_UPDATEUSER_COLUMN_NAMEClass : when the class will have a update-user column for auditing, specifies the column name to use.static StringEXTENSION_CLASS_VERSION_FIELD_NAMEClass : define the name of a member that will store the version of this class.static StringEXTENSION_CLASS_VIEW_DEFINITIONClass : definition of VIEW (when mapping to a view).static StringEXTENSION_CLASS_VIEW_IMPORTSClass : definition of imports for VIEW (when mapping to a view).static StringEXTENSION_INDEX_COLUMN_ORDERINGIndex : orderings of columns in an index, comma separated series of "ASC", "DESC" etc.static StringEXTENSION_MEMBER_CACHEABLEMember : whether the field is (L2) cacheable (for JPA).static StringEXTENSION_MEMBER_CALENDAR_ONE_COLUMNMember : when the field is Calendar, signifies that it should be stored as a single column.static StringEXTENSION_MEMBER_CASCADE_ATTACHMember : whether the field is cascade-attach (for JDO).static StringEXTENSION_MEMBER_CASCADE_DETACHMember : whether the field is cascade-detach (for JDO).static StringEXTENSION_MEMBER_CASCADE_PERSISTMember : whether the field is cascade-persist (for JDO).static StringEXTENSION_MEMBER_CASCADE_REFRESHMember : whether the field is cascade-refresh (for JDO).static StringEXTENSION_MEMBER_COMPARATOR_NAMEMember : name of comparator class when of SortedSet/SortedMap type.static StringEXTENSION_MEMBER_CONTAINER_ALLOW_NULLSMember : whether this member (collection/map/array) should allow null elements/keys/values.static StringEXTENSION_MEMBER_CREATE_TIMESTAMPMember : create timestamp extension.static StringEXTENSION_MEMBER_CREATE_USERMember : create user extension.static StringEXTENSION_MEMBER_ENUM_VALUE_GETTERMember : when field is enum, name of the method to get the "value" of the enum.static StringEXTENSION_MEMBER_IMPLEMENTATION_CLASSESMember : implementation class names, when the member is of a interface/reference type.static StringEXTENSION_MEMBER_INSERTABLEMember : whether the field is insertable (for JDO).static StringEXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSESMember : implementation class names, when the member is of a interface/reference type.static StringEXTENSION_MEMBER_LIST_ORDERINGMember : the ordering clause to use for this List field.static StringEXTENSION_MEMBER_RELATION_DISCRIM_COLUMNMember : shared relation, column name for relation discriminator column.static StringEXTENSION_MEMBER_RELATION_DISCRIM_PKMember : shared relation, where the relation discriminator column is part of the PK.static StringEXTENSION_MEMBER_RELATION_DISCRIM_VALUEMember : shared relation, value for this class for relation discriminator column.static StringEXTENSION_MEMBER_STRATEGY_WHEN_NOTNULLMember : when this field has a value generator, only apply it when the field is not set.static StringEXTENSION_MEMBER_TYPE_CONVERTER_DISABLEDstatic StringEXTENSION_MEMBER_TYPE_CONVERTER_NAMEMember : name of type converter to use.static StringEXTENSION_MEMBER_UPDATE_TIMESTAMPMember : create timestamp extension.static StringEXTENSION_MEMBER_UPDATE_USERMember : create user extension.static StringEXTENSION_MEMBER_UPDATEABLEMember : whether the field is updateable (for JDO).static StringEXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSESMember : implementation class names, when the member is of a interface/reference type.static StringEXTENSION_VERSION_NUMBER_INITIAL_VALUEClass : initial value to use for this class for versioning (when using version-number strategy).protected Map<String,String>extensionsExtensions for this MetaData element.protected org.datanucleus.metadata.MetaData.StatemetaDataStateState of the MetaData.protected MetaDataparentParent MetaData object, allowing hierarchical MetaData structure.static StringVENDOR_NAMEVendor name (DataNucleus) used for extensions.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description MetaDataaddExtension(String key, String value)MetaDataaddExtensions(Map<String,String> exts)Map<String,String>getExtensions()MetaDataManagergetMetaDataManager()intgetNoOfExtensions()MetaDatagetParent()StringgetValueForExtension(String key)Accessor for the value of a particular extension.String[]getValuesForExtension(String key)Accessor for the value of a particular extension, but splitting it into separate parts.booleanhasExtension(String key)voidinitialise(ClassLoaderResolver clr)booleanisInitialised()booleanisPopulated()booleanisUsed()MetaDataremoveExtension(String key)MetaDatasetExtensions(Map<String,String> exts)voidsetParent(MetaData md)
-
-
-
Field Detail
-
VENDOR_NAME
public static final String VENDOR_NAME
Vendor name (DataNucleus) used for extensions.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_READ_ONLY
public static final String EXTENSION_CLASS_READ_ONLY
Class : read only.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_MULTITENANT
public static final String EXTENSION_CLASS_MULTITENANT
Class : when using multitenancy for this class.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME
public static final String EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME
Class : when using multitenancy, defines the column name used for the mutitenancy discriminator.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH
public static final String EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH
Class : when using multitenancy, defines the length of column used for the mutitenancy discriminator.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE
public static final String EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE
Class : when using multitenancy, defines the jdbc-type used for the mutitenancy discriminator column.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_SOFTDELETE
public static final String EXTENSION_CLASS_SOFTDELETE
Class : when the class will use soft deletion (deletion flag column) rather than actually deleting objects.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME
public static final String EXTENSION_CLASS_SOFTDELETE_COLUMN_NAME
Class : when the class will use soft deletion, specifies the column name to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_CREATEUSER
public static final String EXTENSION_CLASS_CREATEUSER
Class : when the class will have a create-user column for auditing.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_CREATEUSER_COLUMN_NAME
public static final String EXTENSION_CLASS_CREATEUSER_COLUMN_NAME
Class : when the class will have a create-user column for auditing, specifies the column name to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH
public static final String EXTENSION_CLASS_CREATEUSER_COLUMN_LENGTH
Class : when the class will have a create-user column for auditing, defines the length of column to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_UPDATEUSER
public static final String EXTENSION_CLASS_UPDATEUSER
Class : when the class will have a update-user column for auditing.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME
public static final String EXTENSION_CLASS_UPDATEUSER_COLUMN_NAME
Class : when the class will have a update-user column for auditing, specifies the column name to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH
public static final String EXTENSION_CLASS_UPDATEUSER_COLUMN_LENGTH
Class : when the class will have a update-user column for auditing, defines the length of column to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_CREATETIMESTAMP
public static final String EXTENSION_CLASS_CREATETIMESTAMP
Class : when the class will have a create-timestamp column for auditing.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME
public static final String EXTENSION_CLASS_CREATETIMESTAMP_COLUMN_NAME
Class : when the class will have a create-timestamp column for auditing, specifies the column name to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_UPDATETIMESTAMP
public static final String EXTENSION_CLASS_UPDATETIMESTAMP
Class : when the class will have a update-timestamp column for auditing.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME
public static final String EXTENSION_CLASS_UPDATETIMESTAMP_COLUMN_NAME
Class : when the class will have a update-timestamp column for auditing, specifies the column name to use.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_VERSION_FIELD_NAME
public static final String EXTENSION_CLASS_VERSION_FIELD_NAME
Class : define the name of a member that will store the version of this class.- See Also:
- Constant Field Values
-
EXTENSION_VERSION_NUMBER_INITIAL_VALUE
public static final String EXTENSION_VERSION_NUMBER_INITIAL_VALUE
Class : initial value to use for this class for versioning (when using version-number strategy).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_TYPE_CONVERTER_NAME
public static final String EXTENSION_MEMBER_TYPE_CONVERTER_NAME
Member : name of type converter to use.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED
public static final String EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED
- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_COMPARATOR_NAME
public static final String EXTENSION_MEMBER_COMPARATOR_NAME
Member : name of comparator class when of SortedSet/SortedMap type.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_IMPLEMENTATION_CLASSES
public static final String EXTENSION_MEMBER_IMPLEMENTATION_CLASSES
Member : implementation class names, when the member is of a interface/reference type.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES
public static final String EXTENSION_MEMBER_KEY_IMPLEMENTATION_CLASSES
Member : implementation class names, when the member is of a interface/reference type.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES
public static final String EXTENSION_MEMBER_VALUE_IMPLEMENTATION_CLASSES
Member : implementation class names, when the member is of a interface/reference type.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_ENUM_VALUE_GETTER
public static final String EXTENSION_MEMBER_ENUM_VALUE_GETTER
Member : when field is enum, name of the method to get the "value" of the enum.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CALENDAR_ONE_COLUMN
public static final String EXTENSION_MEMBER_CALENDAR_ONE_COLUMN
Member : when the field is Calendar, signifies that it should be stored as a single column.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_INSERTABLE
public static final String EXTENSION_MEMBER_INSERTABLE
Member : whether the field is insertable (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_UPDATEABLE
public static final String EXTENSION_MEMBER_UPDATEABLE
Member : whether the field is updateable (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CASCADE_PERSIST
public static final String EXTENSION_MEMBER_CASCADE_PERSIST
Member : whether the field is cascade-persist (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CASCADE_ATTACH
public static final String EXTENSION_MEMBER_CASCADE_ATTACH
Member : whether the field is cascade-attach (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CASCADE_DETACH
public static final String EXTENSION_MEMBER_CASCADE_DETACH
Member : whether the field is cascade-detach (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CASCADE_REFRESH
public static final String EXTENSION_MEMBER_CASCADE_REFRESH
Member : whether the field is cascade-refresh (for JDO).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CACHEABLE
public static final String EXTENSION_MEMBER_CACHEABLE
Member : whether the field is (L2) cacheable (for JPA).- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS
public static final String EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS
Member : whether this member (collection/map/array) should allow null elements/keys/values.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_LIST_ORDERING
public static final String EXTENSION_MEMBER_LIST_ORDERING
Member : the ordering clause to use for this List field.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL
public static final String EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL
Member : when this field has a value generator, only apply it when the field is not set.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN
public static final String EXTENSION_MEMBER_RELATION_DISCRIM_COLUMN
Member : shared relation, column name for relation discriminator column.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_RELATION_DISCRIM_VALUE
public static final String EXTENSION_MEMBER_RELATION_DISCRIM_VALUE
Member : shared relation, value for this class for relation discriminator column.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_RELATION_DISCRIM_PK
public static final String EXTENSION_MEMBER_RELATION_DISCRIM_PK
Member : shared relation, where the relation discriminator column is part of the PK.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CREATE_USER
public static final String EXTENSION_MEMBER_CREATE_USER
Member : create user extension.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_CREATE_TIMESTAMP
public static final String EXTENSION_MEMBER_CREATE_TIMESTAMP
Member : create timestamp extension.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_UPDATE_USER
public static final String EXTENSION_MEMBER_UPDATE_USER
Member : create user extension.- See Also:
- Constant Field Values
-
EXTENSION_MEMBER_UPDATE_TIMESTAMP
public static final String EXTENSION_MEMBER_UPDATE_TIMESTAMP
Member : create timestamp extension.- See Also:
- Constant Field Values
-
EXTENSION_CLASS_VIEW_DEFINITION
public static final String EXTENSION_CLASS_VIEW_DEFINITION
Class : definition of VIEW (when mapping to a view).- See Also:
- Constant Field Values
-
EXTENSION_CLASS_VIEW_IMPORTS
public static final String EXTENSION_CLASS_VIEW_IMPORTS
Class : definition of imports for VIEW (when mapping to a view).- See Also:
- Constant Field Values
-
EXTENSION_INDEX_COLUMN_ORDERING
public static final String EXTENSION_INDEX_COLUMN_ORDERING
Index : orderings of columns in an index, comma separated series of "ASC", "DESC" etc.- See Also:
- Constant Field Values
-
metaDataState
protected org.datanucleus.metadata.MetaData.State metaDataState
State of the MetaData.
-
parent
protected MetaData parent
Parent MetaData object, allowing hierarchical MetaData structure.
-
-
Constructor Detail
-
MetaData
public MetaData()
-
MetaData
public MetaData(MetaData parent)
Constructor. Taking the parent MetaData object (if any).- Parameters:
parent- The parent MetaData object.
-
-
Method Detail
-
initialise
public void initialise(ClassLoaderResolver clr)
-
isPopulated
public boolean isPopulated()
-
isInitialised
public boolean isInitialised()
-
isUsed
public boolean isUsed()
-
getMetaDataManager
public MetaDataManager getMetaDataManager()
-
setParent
public void setParent(MetaData md)
-
getParent
public MetaData getParent()
-
getNoOfExtensions
public int getNoOfExtensions()
-
hasExtension
public boolean hasExtension(String key)
-
getValueForExtension
public String getValueForExtension(String key)
Accessor for the value of a particular extension.- Parameters:
key- The key of the extension- Returns:
- The value of the extension (null if not existing)
-
getValuesForExtension
public String[] getValuesForExtension(String key)
Accessor for the value of a particular extension, but splitting it into separate parts. This is for extension tags that have a value as comma separated.- Parameters:
key- The key of the extension- Returns:
- The value(s) of the extension (null if not existing)
-
-