public class MetaData extends Object implements Serializable
All MetaData elements are extensible with extensions for a "vendor-name". Extensions take the form of a key and a value.
Modifier and Type | Field and Description |
---|---|
static String |
EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH
Class : when using multitenancy, defines the length of column used for the mutitenancy discriminator.
|
static String |
EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME
Class : when using multitenancy, defines the column name used for the mutitenancy discriminator.
|
static String |
EXTENSION_CLASS_MULTITENANCY_DISABLE
Class : when using multitenancy, disables its use for this class.
|
static String |
EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE
Class : when using multitenancy, defines the jdbc-type used for the mutitenancy discriminator column.
|
static String |
EXTENSION_CLASS_READ_ONLY
Class : read only.
|
static String |
EXTENSION_CLASS_VERSION_FIELD_NAME
Class : define the name of a field that will store the version of this class.
|
static String |
EXTENSION_MEMBER_CACHEABLE
Member : whether the field is (L2) cacheable (for JPA).
|
static String |
EXTENSION_MEMBER_CALENDAR_ONE_COLUMN
Member : when the field is Calendar, signifies that it should be stored as a single column.
|
static String |
EXTENSION_MEMBER_CASCADE_PERSIST
Member : whether the field is cascade-persist (for JDO).
|
static String |
EXTENSION_MEMBER_CASCADE_REFRESH
Member : whether the field is cascade-refresh (for JDO).
|
static String |
EXTENSION_MEMBER_CASCADE_UPDATE
Member : whether the field is cascade-update (for JDO).
|
static String |
EXTENSION_MEMBER_COMPARATOR_NAME
Member : name of comparator class when of SortedSet/SortedMap type.
|
static String |
EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS
Member : whether this member (collection/map/array) should allow null elements/keys/values.
|
static String |
EXTENSION_MEMBER_ENUM_GETTER_BY_VALUE
Member : when field is enum, name of the method to return the enum given the value.
|
static String |
EXTENSION_MEMBER_ENUM_VALUE_GETTER
Member : when field is enum, name of the method to get the "value" of the enum.
|
static String |
EXTENSION_MEMBER_FETCH_FK_ONLY
Member : whether to fetch just the FK (and not populate the related object).
|
static String |
EXTENSION_MEMBER_IMPLEMENTATION_CLASSES
Member : implementation class names, when the member is of a interface/reference type.
|
static String |
EXTENSION_MEMBER_INSERTABLE
Member : whether the field is insertable (for JDO).
|
static String |
EXTENSION_MEMBER_LIST_ORDERING
Member : the ordering clause to use for this List field.
|
static String |
EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL
Member : when this field has a value generator, only apply it when the field is not set.
|
static String |
EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED |
static String |
EXTENSION_MEMBER_TYPE_CONVERTER_NAME
Member : name of type converter to use.
|
static String |
EXTENSION_MEMBER_UPDATEABLE
Member : whether the field is updateable (for JDO).
|
protected Collection<ExtensionMetaData> |
extensions
List of extensions for this MetaData element.
|
static int |
METADATA_CREATED_STATE
State representing the start state of MetaData, representing the initial values passed in.
|
static int |
METADATA_INITIALISED_STATE
State reflecting that MetaData object has been initialised with any internal info required.
|
static int |
METADATA_POPULATED_STATE
State reflecting that MetaData has been populated with real class definition adding any defaulted info.
|
static int |
METADATA_USED_STATE
State reflecting that MetaData object has been modified with usage information (e.g defaulted column names).
|
protected int |
metaDataState
State of the MetaData.
|
protected MetaData |
parent
Parent MetaData object, allowing hierarchical MetaData structure.
|
static String |
VENDOR_NAME
Vendor name (DataNucleus) used for extensions.
|
Constructor and Description |
---|
MetaData() |
MetaData(MetaData parent)
Constructor.
|
MetaData(MetaData parent,
MetaData copy)
Copy constructor.
|
Modifier and Type | Method and Description |
---|---|
MetaData |
addExtension(String key,
String value) |
MetaData |
addExtension(String vendor,
String key,
String value) |
ExtensionMetaData[] |
getExtensions() |
int |
getNoOfExtensions() |
MetaData |
getParent() |
String |
getValueForExtension(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.
|
boolean |
hasExtension(String key) |
void |
initialise(ClassLoaderResolver clr,
MetaDataManager mmgr) |
boolean |
isInitialised() |
boolean |
isPopulated() |
boolean |
isUsed() |
ExtensionMetaData |
newExtensionMetaData(String vendor,
String key,
String value)
Method to create a new ExtensionMetaData, add it, and return it.
|
MetaData |
removeExtension(String key) |
void |
setParent(MetaData md) |
String |
toString()
Accessor for a string representation of the object.
|
String |
toString(String prefix,
String indent)
Returns a string representation of the object.
|
public static final int METADATA_CREATED_STATE
public static final int METADATA_POPULATED_STATE
public static final int METADATA_INITIALISED_STATE
public static final int METADATA_USED_STATE
protected int metaDataState
protected MetaData parent
public static final String VENDOR_NAME
public static final String EXTENSION_CLASS_READ_ONLY
public static final String EXTENSION_CLASS_MULTITENANCY_DISABLE
public static final String EXTENSION_CLASS_MULTITENANCY_COLUMN_NAME
public static final String EXTENSION_CLASS_MULTITENANCY_COLUMN_LENGTH
public static final String EXTENSION_CLASS_MULTITENANCY_JDBC_TYPE
public static final String EXTENSION_CLASS_VERSION_FIELD_NAME
public static final String EXTENSION_MEMBER_TYPE_CONVERTER_NAME
public static final String EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED
public static final String EXTENSION_MEMBER_COMPARATOR_NAME
public static final String EXTENSION_MEMBER_IMPLEMENTATION_CLASSES
public static final String EXTENSION_MEMBER_ENUM_VALUE_GETTER
public static final String EXTENSION_MEMBER_ENUM_GETTER_BY_VALUE
public static final String EXTENSION_MEMBER_CALENDAR_ONE_COLUMN
public static final String EXTENSION_MEMBER_INSERTABLE
public static final String EXTENSION_MEMBER_UPDATEABLE
public static final String EXTENSION_MEMBER_CASCADE_PERSIST
public static final String EXTENSION_MEMBER_CASCADE_UPDATE
public static final String EXTENSION_MEMBER_CASCADE_REFRESH
public static final String EXTENSION_MEMBER_CACHEABLE
public static final String EXTENSION_MEMBER_FETCH_FK_ONLY
public static final String EXTENSION_MEMBER_CONTAINER_ALLOW_NULLS
public static final String EXTENSION_MEMBER_LIST_ORDERING
public static final String EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL
protected Collection<ExtensionMetaData> extensions
public MetaData()
public MetaData(MetaData parent)
parent
- The parent MetaData object.public void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
public void setParent(MetaData md)
public ExtensionMetaData newExtensionMetaData(String vendor, String key, String value)
vendor
- The vendor namekey
- Key of the extensionvalue
- Valuepublic MetaData getParent()
public boolean isPopulated()
public boolean isInitialised()
public boolean isUsed()
public int getNoOfExtensions()
public ExtensionMetaData[] getExtensions()
public boolean hasExtension(String key)
public String getValueForExtension(String key)
key
- The key of the extensionpublic String[] getValuesForExtension(String key)
key
- The key of the extensionpublic String toString()
Copyright © 2017. All rights reserved.