public abstract class AbstractClassMetaData extends MetaData
Modifier and Type | Field and Description |
---|---|
protected Boolean |
accessViaField |
protected int[] |
allMemberPositions
Positions of all fields/properties (inc superclasses).
|
protected Boolean |
cacheable
cacheable tag value.
|
protected String |
catalog
Catalog name (O/R mapping).
|
protected boolean |
detachable
detachable tag value.
|
protected boolean[] |
dfgMemberFlags
Flags of the default-fetch-group state for all fields/properties.
|
protected int[] |
dfgMemberPositions
Positions of the default-fetch-group fields/properties (inc superclasses).
|
protected boolean |
embeddedOnly
embedded-only tag value.
|
protected String |
entityName
Entity name.
|
protected Boolean |
excludeDefaultListeners
Flag to exclude default listeners.
|
protected Boolean |
excludeSuperClassListeners
Flag to exclude superclass listeners.
|
protected Map<String,FetchGroupMetaData> |
fetchGroupMetaDataByName
Convenience lookup map of fetch group by the name.
|
protected Boolean |
fetchGroupMetaWithPostLoad
Cached result of
hasFetchGroupWithPostLoad() |
protected Set<FetchGroupMetaData> |
fetchGroups |
protected ForeignKeyMetaData[] |
foreignKeyMetaData
ForeignKeyMetaData
|
protected List<ForeignKeyMetaData> |
foreignKeys
List of foreign-key
|
protected String |
fullName
Full name (e.g org.datanucleus.MyClass)
|
static String |
GENERATED_PK_SUFFIX
Suffix to add on to the class name for any generated primary key class.
|
protected Boolean |
hasRelations
Cached result of
hasRelations(ClassLoaderResolver, MetaDataManager) |
protected IdentityMetaData |
identityMetaData
Identity MetaData
|
protected boolean |
identitySpecified
Flag whether the identity was specified by the user.
|
protected IdentityType |
identityType
Identity-type tag value.
|
protected boolean |
implementationOfPersistentDefinition |
protected List<IndexMetaData> |
indexes
List of indexes
|
protected IndexMetaData[] |
indexMetaData
IndexMetaData
|
protected InheritanceMetaData |
inheritanceMetaData
Inheritance MetaData
|
protected boolean |
instantiable
Whether the class is fully defined, and hence instantiable.
|
protected JoinMetaData[] |
joinMetaData
JoinMetaData
|
protected List<JoinMetaData> |
joins
List of joins
|
protected List |
listeners
EventListeners.
|
protected AbstractMemberMetaData[] |
managedMembers
Managed fields/properties of this class.
|
protected boolean |
mappedSuperclass
Whether this class is explicitly marked as MappedSuperclass.
|
protected int |
memberCount
number of managed fields/properties from this class plus inherited classes.
|
protected Map<String,Integer> |
memberPositionsByName
Position numbers of members mapped by the name of the field/property.
|
protected List<AbstractMemberMetaData> |
members
List of members (fields/properties).
|
protected boolean |
metaDataComplete
Flag for whether the MetaData here is complete without annotations.
|
protected String |
name
Class name
|
protected boolean[] |
nonPkMemberFlags
Flags of the non-primary key fields/properties (inc superclasses).
|
protected int[] |
nonPkMemberPositions
Positions of the non-primary-key fields/properties (inc superclasses).
|
protected int |
noOfInheritedManagedMembers
No of managed fields/properties in superclasses, that are inherited by this class.
|
protected String |
objectidClass
objectid-class tag value.
|
protected AbstractMemberMetaData[] |
overriddenMembers
Fields/properties for superclasses that are overridden in this class.
|
protected AbstractClassMetaData |
pcSuperclassMetaData
Class MetaData for the persistable superclass (if any)
|
protected String |
persistableSuperclass
persistable-superclass tag value (deprecated).
|
protected ClassPersistenceModifier |
persistenceModifier
persistence-modifier tag value.
|
protected boolean |
persistentInterfaceImplNeedingTableFromSubclass
Implementation of "persistent-interface" needing table setting from subclass.
|
protected boolean |
persistentInterfaceImplNeedingTableFromSuperclass
Implementation of "persistent-interface" needing table setting from superclass.
|
protected Boolean |
pkIsDatastoreAttributed
Cached result of
pkIsDatastoreAttributed(StoreManager) |
protected int[] |
pkMemberPositions
Positions of the primary-key fields/properties (inc superclasses).
|
protected PrimaryKeyMetaData |
primaryKeyMetaData
PrimaryKey MetaData
|
protected Collection<QueryMetaData> |
queries
Named queries
|
protected Collection<QueryResultMetaData> |
queryResultMetaData
List of query result MetaData defined for this file.
|
protected int[] |
relationPositions
Absolute positions of the fields/properties that have relations.
|
protected boolean |
requiresExtent
requires-extent tag value.
|
protected String |
schema
Schema name (O/R mapping).
|
protected boolean[] |
scoMutableMemberFlags
Flags of the SCO mutable state for all fields/properties.
|
protected int[] |
scoMutableMemberPositions
Positions of the SCO mutable fields/properties (inc superclasses).
|
protected int[] |
scoNonContainerMemberPositions
Absolute positions of all SCO fields/properties that aren't containers.
|
protected int[] |
secondClassContainerMemberPositions
Positions of all SCO fields/properties that are containers.
|
protected boolean |
serializeRead
Whether to lock objects of this type on read operations.
|
protected Collection<StoredProcQueryMetaData> |
storedProcQueries
Named stored procs
|
protected String |
table
Table name (O/R mapping).
|
protected List<UniqueMetaData> |
uniqueConstraints
List of uniqueConstraints
|
protected UniqueMetaData[] |
uniqueMetaData
UniqueMetaData
|
protected List<ColumnMetaData> |
unmappedColumns
The columns that are present in the datastore yet not mapped to fields in this class.
|
protected boolean |
usesSingleFieldIdentityClass
if this persistable class uses SingleFieldIdentity
|
protected VersionMetaData |
versionMetaData
Version MetaData
|
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_VERSION_FIELD_NAME, EXTENSION_MEMBER_CACHEABLE, EXTENSION_MEMBER_CALENDAR_ONE_COLUMN, 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_LIST_ORDERING, EXTENSION_MEMBER_STRATEGY_WHEN_NOTNULL, EXTENSION_MEMBER_TYPE_CONVERTER_DISABLED, EXTENSION_MEMBER_TYPE_CONVERTER_NAME, EXTENSION_MEMBER_UPDATEABLE, extensions, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME
Modifier | Constructor and Description |
---|---|
|
AbstractClassMetaData(ClassMetaData cmd,
String implClassName)
Constructor for creating the ClassMetaData for an implementation of a "persistent-abstract-class".
|
|
AbstractClassMetaData(InterfaceMetaData imd,
String implClassName,
boolean copyMembers)
Constructor for creating the ClassMetaData for an implementation of a "persistent-interface".
|
protected |
AbstractClassMetaData(PackageMetaData parent,
String name)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addFetchGroup(FetchGroupMetaData fgmd)
Method to add a fetch-group to this class.
|
void |
addForeignKey(ForeignKeyMetaData fkmd)
Method to add an foreign-key to this class.
|
void |
addIndex(IndexMetaData idxmd)
Method to add an index to this class.
|
void |
addJoin(JoinMetaData jnmd)
Method to add a join to this class.
|
void |
addListener(EventListenerMetaData listener)
Add a listener class name
|
void |
addMember(AbstractMemberMetaData mmd)
Method to add a field/property to this interface.
|
void |
addQuery(QueryMetaData qmd)
Method to add a named query to this class.
|
void |
addQueryResultMetaData(QueryResultMetaData resultMetaData)
Method to register a query-result MetaData.
|
void |
addStoredProcQuery(StoredProcQueryMetaData qmd)
Method to add a named stored proc query to this class.
|
void |
addUniqueConstraint(UniqueMetaData unimd)
Method to add a unique constraint to this class.
|
void |
addUnmappedColumn(ColumnMetaData colmd)
Method to add an unmapped column.
|
protected void |
applyDefaultDiscriminatorValueWhenNotSpecified(MetaDataManager mmgr) |
protected void |
checkInitialised()
Method to check whether the Meta-Data has been initialised.
|
protected void |
checkNotYetPopulated()
Method to check that the Meta-Data has not been populated yet.
|
protected void |
checkPopulated()
Method to check whether the Meta-Data has been populated.
|
protected void |
copyMembersFromInterface(InterfaceMetaData imd)
Convenience method to copy the properties from an existing interface.
|
protected void |
determineIdentity()
Determines the identity based on MetaData defaults or user defined MetaData
|
protected void |
determineInheritanceMetaData(MetaDataManager mmgr)
Impose a default inheritance strategy when one is not already specified.
|
protected void |
determineObjectIdClass(MetaDataManager mmgr)
Determine the object id class.
|
protected void |
determineSuperClassName(ClassLoaderResolver clr,
Class cls,
MetaDataManager mmgr)
Determine the nearest superclass that is persistable (if any).
|
void |
excludeDefaultListeners()
Method to exclude default listeners.
|
void |
excludeSuperClassListeners()
Toogle exclude super class listeners
|
int |
getAbsoluteMemberPositionForRelativePosition(int relativePosition)
Accessor for the absolute position for a relative position.
|
int |
getAbsolutePositionOfMember(String memberName)
Accessor for the absolute position of the field/property with the specified name.
|
int |
getAbsolutePositionOfMember(String className,
String memberName)
Accessor for the absolute position of the field/property with the specified name.
|
Boolean |
getAccessViaField() |
int[] |
getAllMemberPositions()
Accessor for all field/property positions.
|
AbstractClassMetaData |
getBaseAbstractClassMetaData()
Convenience accessor for the AbstractClassMetaData of the base object in this hierarchy.
|
IdentityMetaData |
getBaseIdentityMetaData()
Convenience method to return the root identity metadata for this inheritance tree.
|
protected String |
getBaseInheritanceStrategy() |
int[] |
getBasicMemberPositions(ClassLoaderResolver clr,
MetaDataManager mmgr)
Accessor for the absolute positions of fields/properties that are considered basic.
|
int[] |
getBidirectionalRelationMemberPositions(ClassLoaderResolver clr,
MetaDataManager mmgr)
Convenience method to return the absolute positions of fields/properties that have bidirectional
relations.
|
String |
getCatalog() |
boolean[] |
getDFGMemberFlags()
Accessor for the flags of the DFG fields/properties (inc superclass).
|
int[] |
getDFGMemberPositions()
Accessor for the absolute positions of the default fetch group fields/properties (inc superclasses).
|
ColumnMetaData |
getDiscriminatorColumnMetaData()
Return the metadata for the discriminator column if defined in metadata.
|
String |
getDiscriminatorColumnName()
Return the name of the discriminator column if defined in metadata.
|
DiscriminatorMetaData |
getDiscriminatorMetaData()
Convenience accessor for the discriminator metadata applying to this class.
|
DiscriminatorMetaData |
getDiscriminatorMetaDataForTable()
Convenience method to find the discriminator MetaData defining the discrim for the same table
as this class is using.
|
DiscriminatorMetaData |
getDiscriminatorMetaDataRoot()
Convenience method to return the "root" discriminator metadata definition (that defines the strategy, column etc).
|
DiscriminatorStrategy |
getDiscriminatorStrategy()
Method to return the discriminator strategy being used by this class.
|
DiscriminatorStrategy |
getDiscriminatorStrategyForTable()
Convenience accessor for the discriminator strategy applying to this class.
|
Object |
getDiscriminatorValue()
Method returning the discriminator value to apply to an instance of this class.
|
String |
getEntityName() |
Set<FetchGroupMetaData> |
getFetchGroupMetaData()
Accessor for all MetaData defined for fetch groups for this class.
|
Set<FetchGroupMetaData> |
getFetchGroupMetaData(Collection groupNames)
Accessor for fetch group metadata for the specified groups (if present).
|
FetchGroupMetaData |
getFetchGroupMetaData(String groupname)
Accessor for the fetch group metadata for the group specified.
|
ForeignKeyMetaData[] |
getForeignKeyMetaData()
Accessor for foreignKeyMetaData
|
String |
getFullClassName()
Accessor for the full class name including any package name.
|
IdentityMetaData |
getIdentityMetaData()
Accessor for identityMetaData
|
IdentityType |
getIdentityType() |
IndexMetaData[] |
getIndexMetaData()
Accessor for indexMetaData
|
InheritanceMetaData |
getInheritanceMetaData()
Accessor for inheritanceMetaData
|
JoinMetaData[] |
getJoinMetaData()
Accessor for joinMetaData
|
EventListenerMetaData |
getListenerForClass(String className)
Accessor for the EventListener info for an EventListener class name
|
List |
getListeners()
Get the event listeners
|
AbstractMemberMetaData[] |
getManagedMembers()
Accessor for the managed fields/properties in this class (not including superclass, but including overridden).
|
protected AbstractMemberMetaData |
getMemberBeingOverridden(String name)
Convenience method that navigates up a MetaData inheritance tree until it finds the base field/property definition.
|
int |
getMemberCount()
Accessor for the number of managed fields/properties from this class plus inherited classes.
|
AbstractMemberMetaData |
getMetaDataForManagedMemberAtAbsolutePosition(int abs_position)
Accessor for a managed field/property including superclass fields.
|
protected AbstractMemberMetaData |
getMetaDataForManagedMemberAtAbsolutePositionInternal(int abs_position)
Internal method to get the field/property for an absolute field number.
|
AbstractMemberMetaData |
getMetaDataForManagedMemberAtRelativePosition(int position)
Accessor for MetaData for a managed field/property in this class.
|
AbstractMemberMetaData |
getMetaDataForMember(String name)
Accessor for the Meta-Data for a field/property.
|
AbstractMemberMetaData |
getMetaDataForMemberAtRelativePosition(int index)
Accessor for the metadata of a field/property.
|
int[] |
getMultivaluedMemberPositions()
Accessor for the absolute positions of fields/properties that are considered multi-valued
This category includes members of all multi-valued types, including
Collection, array, and Map types of basic and relationship types.
|
String |
getName()
Accessor for the simple class name (without package name).
|
boolean[] |
getNonPKMemberFlags()
Accessor for the flags of the non primary key fields/properties (inc superclass members).
|
int[] |
getNonPKMemberPositions()
Accessor for the positions of the non primary key fields/properties (inc superclass fields).
|
int[] |
getNonRelationMemberPositions(ClassLoaderResolver clr,
MetaDataManager mmgr) |
int |
getNoOfInheritedManagedMembers()
Accessor for the number of inherited managed fields/properties in superclasses.
|
int |
getNoOfManagedMembers()
Accessor for the number of managed fields/properties (this class only).
|
int |
getNoOfMembers()
Accessor for the number of fields/properties.
|
int |
getNoOfOverriddenMembers()
Accessor for the number of overridden fields/properties (this class only).
|
int |
getNoOfPrimaryKeyMembers()
Accessor for the number of primary key fields/properties.
|
int |
getNoOfQueries()
Accessor for the number of named queries.
|
int |
getNoOfStoredProcQueries()
Accessor for the number of named stored proc queries.
|
String |
getObjectidClass() |
AbstractMemberMetaData |
getOverriddenMember(String name)
Accessor for an overridden field/property with the specified name.
|
AbstractMemberMetaData[] |
getOverriddenMembers()
Accessor for the overridden fields/properties in this class.
|
PackageMetaData |
getPackageMetaData()
Convenience accessor for the parent Package MetaData.
|
String |
getPackageName()
Convenience accessor for the package name.
|
String |
getPersistableSuperclass() |
ClassPersistenceModifier |
getPersistenceModifier() |
int[] |
getPKMemberPositions()
Accessor for the field numbers of the primary key fields/properties.
|
String[] |
getPrimaryKeyMemberNames()
Accessor for the names of the primary key fields/properties.
|
PrimaryKeyMetaData |
getPrimaryKeyMetaData()
Accessor for primaryKeyMetaData
|
QueryMetaData[] |
getQueries()
Accessor for the metadata of the named queries.
|
QueryResultMetaData[] |
getQueryResultMetaData()
Get the query result MetaData registered for this class.
|
int[] |
getRelationMemberPositions(ClassLoaderResolver clr,
MetaDataManager mmgr)
Convenience method to return the absolute positions of all fields/properties that have relations.
|
int |
getRelativePositionOfMember(String memberName)
Accessor for the position of the field/property with the specified name.
|
protected AbstractClassMetaData |
getRootInstantiableClass() |
String |
getSchema() |
int[] |
getSCOContainerMemberPositions()
Accessor for the absolute positions of all SCO fields/properties that are containers.
|
boolean[] |
getSCOMutableMemberFlags()
Accessor for the flags of the SCO mutable fields (inc superclass fields).
|
int[] |
getSCOMutableMemberPositions()
Accessor for the absolute positions of the second class mutable fields/properties.
|
int[] |
getSCONonContainerMemberPositions()
Accessor for the absolute positions of all SCO fields/properties that are NOT containers (e.g Dates, Points, etc)
|
StoredProcQueryMetaData[] |
getStoredProcQueries()
Accessor for the metadata of the named stored proc queries.
|
AbstractClassMetaData |
getSuperAbstractClassMetaData()
Accessor for the Meta-Data for the superclass of this class.
|
String |
getTable() |
UniqueMetaData[] |
getUniqueMetaData()
Accessor for UniqueMetaData
|
List<ColumnMetaData> |
getUnmappedColumns()
Accessor for the unmapped columns require for the datastore table.
|
VersionMetaData |
getVersionMetaData()
Accessor for Version MetaData for this class specifically.
|
VersionMetaData |
getVersionMetaDataForClass()
Convenience accessor for the version metadata applying to this class.
|
VersionMetaData |
getVersionMetaDataForTable()
Convenience method to find the version MetaData defining versioning for the same 'table'
as this class is using.
|
boolean |
hasDiscriminatorStrategy()
Accessor for whether we have a discriminator defined for this class (may be in superclasses).
|
boolean |
hasFetchGroupWithPostLoad()
Whether this class or any super class has any fetch group definition
with
FetchGroupMetaData.getPostLoad() ==true. |
boolean |
hasMember(String memberName)
Method to check if a field/property exists in this classes definition.
|
boolean |
hasRelations(ClassLoaderResolver clr,
MetaDataManager mmgr)
Convenience method to return if the class has relations to other objects.
|
protected void |
inheritIdentity()
Inherit the identity definition from super classes.
|
abstract void |
initialise(ClassLoaderResolver clr,
MetaDataManager mmgr)
Method to initialise the sub-objects of this class metadata.
|
protected void |
initialiseMemberPositionInformation(MetaDataManager mmgr)
Method to initialise all convenience information about member positions and what role
each position performs.
|
Boolean |
isCacheable() |
boolean |
isDescendantOf(AbstractClassMetaData cmd)
Convenience method to return if this class is a descendant of the supplied class metadata.
|
boolean |
isDetachable() |
boolean |
isEmbeddedOnly() |
boolean |
isExcludeDefaultListeners()
Whether default listeners are not going to be invoked
|
boolean |
isExcludeSuperClassListeners()
Whether super classes listeners are not going to be invoked
|
boolean |
isImplementationOfPersistentDefinition()
Return whether this MetaData is for an implementation of a persistent definition.
|
boolean |
isInstantiable() |
boolean |
isMappedSuperclass() |
boolean |
isMetaDataComplete()
Accessor for whether this class is fully specified by this metadata and that any
annotations should be ignored.
|
boolean |
isRequiresExtent() |
boolean |
isRootInstantiableClass() |
boolean |
isSameOrAncestorOf(AbstractClassMetaData cmd)
Check if the argument cmd is the same as this or a descedent.
|
boolean |
isSerializeRead() |
boolean |
isVersioned()
Returns whether objects of this type are versioned.
|
protected Class |
loadClass(ClassLoaderResolver clr,
ClassLoader primary,
MetaDataManager mmgr)
Load the persistent interface/class
|
protected AbstractMemberMetaData |
newDefaultedProperty(String name)
Utility to add a defaulted PropertyMetaData to the class.
|
FetchGroupMetaData |
newFetchGroupMetaData(String name)
Method to create a new fetchgroup metadata, add it, and return it.
|
FieldMetaData |
newFieldMetadata(String fieldName)
Method to create a new field metadata, add it, and return it.
|
ForeignKeyMetaData |
newForeignKeyMetadata()
Method to create a new FK metadata, add it, and return it.
|
IdentityMetaData |
newIdentityMetadata()
Method to create a new identity metadata, set to use it, and return it.
|
IndexMetaData |
newIndexMetadata()
Method to create a new index metadata, add it, and return it.
|
InheritanceMetaData |
newInheritanceMetadata()
Method to create a new inheritance metadata, set to use it, and return it.
|
JoinMetaData |
newJoinMetaData()
Method to create a new join metadata, add it, and return it.
|
PrimaryKeyMetaData |
newPrimaryKeyMetadata()
Method to create a new primary key metadata, set to use it, and return it.
|
PropertyMetaData |
newPropertyMetadata(String propName)
Method to create a new property metadata, add it, and return it.
|
QueryMetaData |
newQueryMetadata(String queryName)
Method to create a new QueryMetadata, add it to the registered queries and return it.
|
StoredProcQueryMetaData |
newStoredProcQueryMetadata(String queryName)
Method to create a new StoredProcQueryMetadata, add it to the registered queries and return it.
|
UniqueMetaData |
newUniqueMetadata()
Method to create a new unique metadata, add it, and return it.
|
ColumnMetaData |
newUnmappedColumnMetaData() |
VersionMetaData |
newVersionMetadata()
Method to create a new version metadata, set to use it, and return it.
|
boolean |
pkIsDatastoreAttributed(StoreManager storeMgr)
Convenience method to calculate and return if the pk has some component that is generated in the datastore.
|
abstract void |
populate(ClassLoaderResolver clr,
ClassLoader primary,
MetaDataManager mmgr)
Method to provide the details of the class being represented by this
MetaData.
|
void |
setAccessViaField(boolean flag) |
AbstractClassMetaData |
setCacheable(boolean cache) |
AbstractClassMetaData |
setCacheable(String cache) |
AbstractClassMetaData |
setCatalog(String catalog) |
AbstractClassMetaData |
setDetachable(boolean flag) |
AbstractClassMetaData |
setDetachable(String flag) |
AbstractClassMetaData |
setEmbeddedOnly(boolean flag) |
AbstractClassMetaData |
setEmbeddedOnly(String flag) |
AbstractClassMetaData |
setEntityName(String name) |
void |
setIdentityMetaData(IdentityMetaData identityMetaData)
Mutator for the identity MetaData.
|
void |
setIdentityType(IdentityType type) |
void |
setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
Mutator for the inheritance MetaData.
|
void |
setMappedSuperclass(boolean mapped) |
void |
setMetaDataComplete()
Method to set that this class is "metadata complete" (see JPA spec).
|
AbstractClassMetaData |
setObjectIdClass(String objectidClass) |
AbstractClassMetaData |
setPersistenceModifier(ClassPersistenceModifier modifier) |
void |
setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
Mutator for the PrimaryKey MetaData.
|
AbstractClassMetaData |
setRequiresExtent(boolean flag) |
AbstractClassMetaData |
setRequiresExtent(String flag) |
AbstractClassMetaData |
setSchema(String schema) |
void |
setSerializeRead(boolean serialise) |
AbstractClassMetaData |
setTable(String table) |
void |
setVersionMetaData(VersionMetaData versionMetaData)
Mutator for the Version MetaData.
|
boolean |
usesSingleFieldIdentityClass()
Whether this persistable class uses SingleFieldIdentity
|
protected void |
validateObjectIdClass(ClassLoaderResolver clr,
MetaDataManager mmgr)
Validate the objectid-class of this class.
|
protected void |
validateUnmappedColumns()
Convenience method to validate the specified "unmapped" columns.
|
protected void |
validateUserInputForIdentity()
Check for conflicts on super class and this class MetaData identity
|
protected void |
validateUserInputForInheritanceMetaData(boolean isAbstract)
Check if the inheritance MetaData is credible.
|
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString, toString
public static final String GENERATED_PK_SUFFIX
protected final String name
protected String entityName
protected boolean mappedSuperclass
protected boolean instantiable
protected Boolean accessViaField
protected IdentityType identityType
protected ClassPersistenceModifier persistenceModifier
protected String persistableSuperclass
protected String objectidClass
protected boolean requiresExtent
protected boolean detachable
protected boolean embeddedOnly
protected String catalog
protected String schema
protected String table
protected Boolean cacheable
protected final String fullName
protected VersionMetaData versionMetaData
protected IdentityMetaData identityMetaData
protected boolean identitySpecified
protected InheritanceMetaData inheritanceMetaData
protected PrimaryKeyMetaData primaryKeyMetaData
protected List listeners
protected Boolean excludeSuperClassListeners
protected Boolean excludeDefaultListeners
protected Map<String,FetchGroupMetaData> fetchGroupMetaDataByName
protected AbstractClassMetaData pcSuperclassMetaData
protected boolean metaDataComplete
protected boolean serializeRead
protected Collection<QueryMetaData> queries
protected Collection<StoredProcQueryMetaData> storedProcQueries
protected Collection<QueryResultMetaData> queryResultMetaData
protected JoinMetaData[] joinMetaData
protected IndexMetaData[] indexMetaData
protected ForeignKeyMetaData[] foreignKeyMetaData
protected UniqueMetaData[] uniqueMetaData
protected List<AbstractMemberMetaData> members
protected List<ColumnMetaData> unmappedColumns
protected Set<FetchGroupMetaData> fetchGroups
protected List<JoinMetaData> joins
protected List<ForeignKeyMetaData> foreignKeys
protected List<IndexMetaData> indexes
protected List<UniqueMetaData> uniqueConstraints
protected AbstractMemberMetaData[] managedMembers
protected AbstractMemberMetaData[] overriddenMembers
protected Map<String,Integer> memberPositionsByName
protected int[] allMemberPositions
protected int[] pkMemberPositions
protected int[] nonPkMemberPositions
protected boolean[] nonPkMemberFlags
protected int[] dfgMemberPositions
protected boolean[] dfgMemberFlags
protected int[] scoMutableMemberPositions
protected boolean[] scoMutableMemberFlags
protected int[] scoNonContainerMemberPositions
protected int[] relationPositions
protected int noOfInheritedManagedMembers
protected boolean usesSingleFieldIdentityClass
protected int memberCount
protected boolean implementationOfPersistentDefinition
protected Boolean fetchGroupMetaWithPostLoad
hasFetchGroupWithPostLoad()
protected Boolean pkIsDatastoreAttributed
pkIsDatastoreAttributed(StoreManager)
protected Boolean hasRelations
hasRelations(ClassLoaderResolver, MetaDataManager)
protected transient boolean persistentInterfaceImplNeedingTableFromSuperclass
protected transient boolean persistentInterfaceImplNeedingTableFromSubclass
protected int[] secondClassContainerMemberPositions
protected AbstractClassMetaData(PackageMetaData parent, String name)
parent
- The package to which this class/interface belongsname
- (Simple) name of class (omitting the package name)public AbstractClassMetaData(InterfaceMetaData imd, String implClassName, boolean copyMembers)
imd
- MetaData for the "persistent-interface"implClassName
- Name of the implementation classcopyMembers
- Whether to copy the fields/properties of the interface toopublic AbstractClassMetaData(ClassMetaData cmd, String implClassName)
cmd
- MetaData for the implementation of the "persistent-abstract-class"implClassName
- Name of the implementation classpublic boolean isInstantiable()
protected AbstractClassMetaData getRootInstantiableClass()
public boolean isRootInstantiableClass()
public boolean isImplementationOfPersistentDefinition()
protected void copyMembersFromInterface(InterfaceMetaData imd)
imd
- The interface that we copy fromprotected void checkInitialised()
NucleusException
- Thrown if the Meta-Data hasn't been initialised.protected void checkPopulated()
NucleusException
- Thrown if the Meta-Data hasn't been populated.protected void checkNotYetPopulated()
NucleusUserException
- Thrown if the Meta-Data has already been populated.protected Class loadClass(ClassLoaderResolver clr, ClassLoader primary, MetaDataManager mmgr)
clr
- the ClassLoaderprimary
- the primary ClassLoader to use (or null)mmgr
- MetaData managerprotected void determineIdentity()
protected void determineSuperClassName(ClassLoaderResolver clr, Class cls, MetaDataManager mmgr)
clr
- The ClassLoaderResolvercls
- This classmmgr
- MetaData managerInvalidMetaDataException
- if the super class cannot be loaded by the clr
.InvalidMetaDataException
- if the declared persistence-capable-superclass
is not actually assignable from cls
InvalidMetaDataException
- if any of the super classes is persistable, but the MetaData says that class is not persistent.protected void validateUserInputForIdentity()
InvalidMetaDataException
- if the user tries to overwrite a superclass identity / strategypublic AbstractClassMetaData getBaseAbstractClassMetaData()
public boolean isDescendantOf(AbstractClassMetaData cmd)
cmd
- The class to check againstprotected String getBaseInheritanceStrategy()
protected void inheritIdentity()
InvalidMetaDataException
- if the MetaData of this class conflicts with super classes definitionprotected AbstractMemberMetaData newDefaultedProperty(String name)
name
- name of propertyprotected void validateUserInputForInheritanceMetaData(boolean isAbstract)
isAbstract
- Whether this class is abstractInvalidMetaDataException
- if the strategy is superclass-table, yet there are no super classInvalidMetaDataException
- if the strategy is superclass-table, yet the super class has not
specified a discriminatorInvalidMetaDataException
- if the strategy is superclass-table and discriminator is "value-map",
yet no value for the discriminator has been specifiedprotected void determineInheritanceMetaData(MetaDataManager mmgr)
mmgr
- MetaData managerprotected void applyDefaultDiscriminatorValueWhenNotSpecified(MetaDataManager mmgr)
protected void validateUnmappedColumns()
InvalidMetaDataException
- if a column is specified without its name.public final AbstractClassMetaData getSuperAbstractClassMetaData()
public boolean pkIsDatastoreAttributed(StoreManager storeMgr)
storeMgr
- The storeManagerprotected void determineObjectIdClass(MetaDataManager mmgr)
mmgr
- MetaData managerInvalidMetaDataException
- if the class 0 or more that one primary key field and no objectid-class
has been declared in the MetaDataInvalidMetaDataException
- if the objectid-class
has not been set and the primary key field does
not match a supported SingleFieldIdentityInvalidMetaDataException
- if the identity type is APPLICATION but not primary key fields have been setInvalidMetaDataException
- if the objectid-class
cannot be loaded by the clr
protected void validateObjectIdClass(ClassLoaderResolver clr, MetaDataManager mmgr)
clr
- ClassLoader resolvermmgr
- MetaData managerpublic abstract void populate(ClassLoaderResolver clr, ClassLoader primary, MetaDataManager mmgr)
This method must be invoked by subclasses during populate operations
clr
- ClassLoaderResolver to use in loading any classesprimary
- the primary ClassLoader to use (or null)mmgr
- MetaData managerpublic abstract void initialise(ClassLoaderResolver clr, MetaDataManager mmgr)
initialise
in class MetaData
clr
- ClassLoader resolvermmgr
- MetaData managerprotected void initialiseMemberPositionInformation(MetaDataManager mmgr)
mmgr
- MetaDataManagerpublic int getNoOfQueries()
public QueryMetaData[] getQueries()
public int getNoOfStoredProcQueries()
public StoredProcQueryMetaData[] getStoredProcQueries()
public QueryResultMetaData[] getQueryResultMetaData()
public final VersionMetaData getVersionMetaData()
public final VersionMetaData getVersionMetaDataForClass()
public final boolean isVersioned()
public final VersionMetaData getVersionMetaDataForTable()
public final DiscriminatorMetaData getDiscriminatorMetaDataForTable()
public final DiscriminatorStrategy getDiscriminatorStrategyForTable()
public final DiscriminatorMetaData getDiscriminatorMetaData()
public final DiscriminatorMetaData getDiscriminatorMetaDataRoot()
public final boolean hasDiscriminatorStrategy()
public final DiscriminatorStrategy getDiscriminatorStrategy()
public String getDiscriminatorColumnName()
public ColumnMetaData getDiscriminatorColumnMetaData()
public Object getDiscriminatorValue()
public final JoinMetaData[] getJoinMetaData()
public final Set<FetchGroupMetaData> getFetchGroupMetaData()
public Set<FetchGroupMetaData> getFetchGroupMetaData(Collection groupNames)
groupNames
- Names of the fetch groupspublic FetchGroupMetaData getFetchGroupMetaData(String groupname)
groupname
- Name of the fetch grouppublic IdentityType getIdentityType()
public void setIdentityType(IdentityType type)
public final IndexMetaData[] getIndexMetaData()
public final ForeignKeyMetaData[] getForeignKeyMetaData()
public final UniqueMetaData[] getUniqueMetaData()
public final List<ColumnMetaData> getUnmappedColumns()
public String getName()
public String getFullClassName()
public String getObjectidClass()
public AbstractClassMetaData setObjectIdClass(String objectidClass)
public String getEntityName()
public AbstractClassMetaData setEntityName(String name)
public String getCatalog()
public AbstractClassMetaData setCatalog(String catalog)
public String getSchema()
public AbstractClassMetaData setSchema(String schema)
public String getTable()
public AbstractClassMetaData setTable(String table)
public boolean isRequiresExtent()
public AbstractClassMetaData setRequiresExtent(boolean flag)
public AbstractClassMetaData setRequiresExtent(String flag)
public boolean isDetachable()
public AbstractClassMetaData setDetachable(boolean flag)
public AbstractClassMetaData setDetachable(String flag)
public Boolean isCacheable()
public AbstractClassMetaData setCacheable(boolean cache)
public AbstractClassMetaData setCacheable(String cache)
public boolean isEmbeddedOnly()
public AbstractClassMetaData setEmbeddedOnly(boolean flag)
public AbstractClassMetaData setEmbeddedOnly(String flag)
public final IdentityMetaData getIdentityMetaData()
public final IdentityMetaData getBaseIdentityMetaData()
public final InheritanceMetaData getInheritanceMetaData()
public final PrimaryKeyMetaData getPrimaryKeyMetaData()
public PackageMetaData getPackageMetaData()
public String getPackageName()
public int getNoOfMembers()
public AbstractMemberMetaData getMetaDataForMemberAtRelativePosition(int index)
index
- field index relative to this class only starting from 0public ClassPersistenceModifier getPersistenceModifier()
public AbstractClassMetaData setPersistenceModifier(ClassPersistenceModifier modifier)
public String getPersistableSuperclass()
public boolean usesSingleFieldIdentityClass()
public boolean isMetaDataComplete()
public boolean isMappedSuperclass()
public boolean isSerializeRead()
public boolean isSameOrAncestorOf(AbstractClassMetaData cmd)
cmd
- the AbstractClassMetaData to be verify if this is an ancestorpublic String[] getPrimaryKeyMemberNames()
public boolean hasMember(String memberName)
memberName
- Name of field/propertypublic AbstractMemberMetaData getMetaDataForMember(String name)
name
- the name of the field/propertypublic int getNoOfManagedMembers()
public AbstractMemberMetaData[] getManagedMembers()
public int getNoOfOverriddenMembers()
public AbstractMemberMetaData[] getOverriddenMembers()
public AbstractMemberMetaData getOverriddenMember(String name)
name
- Name of the field/propertyprotected AbstractMemberMetaData getMemberBeingOverridden(String name)
name
- Name of the field/property we requirepublic int getNoOfInheritedManagedMembers()
public int getMemberCount()
public AbstractMemberMetaData getMetaDataForManagedMemberAtRelativePosition(int position)
position
- The position of the managed field. 0 = first in the classpublic AbstractMemberMetaData getMetaDataForManagedMemberAtAbsolutePosition(int abs_position)
abs_position
- The position of the managed member including the
superclass. Fields are numbered from 0 in the root superclass.protected AbstractMemberMetaData getMetaDataForManagedMemberAtAbsolutePositionInternal(int abs_position)
abs_position
- The position of the managed field including the
superclass. Fields are numbered from 0 in the root superclass.public int getAbsoluteMemberPositionForRelativePosition(int relativePosition)
relativePosition
- The relative field numberpublic int getRelativePositionOfMember(String memberName)
memberName
- Name of the field/propertypublic int getAbsolutePositionOfMember(String memberName)
memberName
- Name of the field/propertypublic int getAbsolutePositionOfMember(String className, String memberName)
field_name
is of type given by class_name
.className
- Name of the classmemberName
- Name of the field/propertypublic int getNoOfPrimaryKeyMembers()
public int[] getAllMemberPositions()
public int[] getPKMemberPositions()
public int[] getNonPKMemberPositions()
public boolean[] getNonPKMemberFlags()
public int[] getDFGMemberPositions()
public boolean[] getDFGMemberFlags()
public int[] getBasicMemberPositions(ClassLoaderResolver clr, MetaDataManager mmgr)
clr
- ClassLoader resolvermmgr
- MetaData managerpublic int[] getMultivaluedMemberPositions()
public int[] getSCOMutableMemberPositions()
public int[] getSCONonContainerMemberPositions()
public int[] getSCOContainerMemberPositions()
public boolean[] getSCOMutableMemberFlags()
public boolean hasRelations(ClassLoaderResolver clr, MetaDataManager mmgr)
clr
- ClassLoader resolvermmgr
- MetaData managerpublic int[] getNonRelationMemberPositions(ClassLoaderResolver clr, MetaDataManager mmgr)
public int[] getRelationMemberPositions(ClassLoaderResolver clr, MetaDataManager mmgr)
clr
- ClassLoader resolvermmgr
- MetaData managerpublic int[] getBidirectionalRelationMemberPositions(ClassLoaderResolver clr, MetaDataManager mmgr)
clr
- ClassLoader resolvermmgr
- MetaData managerpublic void setAccessViaField(boolean flag)
public Boolean getAccessViaField()
public void setMappedSuperclass(boolean mapped)
public void setSerializeRead(boolean serialise)
public void setMetaDataComplete()
public void addQuery(QueryMetaData qmd)
qmd
- Meta-Data for the query.public QueryMetaData newQueryMetadata(String queryName)
queryName
- Name of the querypublic void addStoredProcQuery(StoredProcQueryMetaData qmd)
qmd
- Meta-Data for the query.public StoredProcQueryMetaData newStoredProcQueryMetadata(String queryName)
queryName
- Name of the proc querypublic void addQueryResultMetaData(QueryResultMetaData resultMetaData)
resultMetaData
- Query-Result MetaData to registerpublic void addIndex(IndexMetaData idxmd)
idxmd
- Meta-Data for the index.public IndexMetaData newIndexMetadata()
public void addForeignKey(ForeignKeyMetaData fkmd)
fkmd
- Meta-Data for the foreign-key.public ForeignKeyMetaData newForeignKeyMetadata()
public void addUniqueConstraint(UniqueMetaData unimd)
unimd
- Meta-Data for the unique constraint.public UniqueMetaData newUniqueMetadata()
public final void addUnmappedColumn(ColumnMetaData colmd)
colmd
- The metadata for the unmapped columnpublic ColumnMetaData newUnmappedColumnMetaData()
public FieldMetaData newFieldMetadata(String fieldName)
fieldName
- Name of the fieldpublic PropertyMetaData newPropertyMetadata(String propName)
propName
- Name of the propertypublic void addMember(AbstractMemberMetaData mmd)
mmd
- Field/Property MetaDatapublic void addFetchGroup(FetchGroupMetaData fgmd)
fgmd
- Meta-Data for the fetch-group.public FetchGroupMetaData newFetchGroupMetaData(String name)
name
- Name of the grouppublic void addJoin(JoinMetaData jnmd)
jnmd
- Meta-Data for the join.public JoinMetaData newJoinMetaData()
public void addListener(EventListenerMetaData listener)
listener
- the listener metadata. Duplicated classes are ignoredpublic EventListenerMetaData getListenerForClass(String className)
className
- Name of the event listener classpublic List getListeners()
public void excludeSuperClassListeners()
public boolean isExcludeSuperClassListeners()
public void excludeDefaultListeners()
public boolean isExcludeDefaultListeners()
public final void setVersionMetaData(VersionMetaData versionMetaData)
versionMetaData
- The versionMetaData to set.public VersionMetaData newVersionMetadata()
public final void setIdentityMetaData(IdentityMetaData identityMetaData)
identityMetaData
- The identityMetaData to set.public IdentityMetaData newIdentityMetadata()
public final void setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
inheritanceMetaData
- The inheritanceMetaData to set.public InheritanceMetaData newInheritanceMetadata()
public final void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
primaryKeyMetaData
- The PrimaryKey MetaData to set.public PrimaryKeyMetaData newPrimaryKeyMetadata()
public final boolean hasFetchGroupWithPostLoad()
FetchGroupMetaData.getPostLoad()
==true.Copyright © 2017. All rights reserved.