public abstract class AbstractClassMetaData extends MetaData
Modifier and Type | Field and Description |
---|---|
protected Boolean |
accessViaField
Whether the class has been explicitly marked as using FIELD access (JPA).
|
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 List<ForeignKeyMetaData> |
foreignKeys
List of foreign-keys
|
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) |
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 InheritanceMetaData |
inheritanceMetaData
Inheritance MetaData
|
protected boolean |
instantiable
Whether the class is fully defined, and hence instantiable.
|
protected List<JoinMetaData> |
joins
List of joins
|
protected List<EventListenerMetaData> |
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 all members (fields/properties).
|
protected boolean |
metaDataComplete
Flag for whether the MetaData here is complete without annotations.
|
protected MetaDataManager |
mmgr
Manager for this metadata.
|
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 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_SOFTDELETE, EXTENSION_CLASS_SOFTDELETE_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
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() |
protected static void |
checkForCircularViewReferences(Map<String,Set<String>> viewReferences,
String referencerName,
String referenceeName,
List<String> referenceChain)
Check for any circular view references between referencer and referencee.
|
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 |
determineIdentity()
Determines the identity based on MetaData defaults or user defined MetaData
|
protected void |
determineInheritanceMetaData()
Impose a default inheritance strategy when one is not already specified.
|
protected void |
determineObjectIdClass()
Determine the object id class.
|
protected void |
determineSuperClassName(ClassLoaderResolver clr,
Class cls)
Determine the nearest superclass that is persistable (if any).
|
void |
excludeDefaultListeners()
Method to exclude default listeners.
|
void |
excludeSuperClassListeners()
Toogle exclude super class listeners
|
int |
getAbsolutePositionOfMember(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)
Accessor for the absolute positions of fields/properties that are considered basic.
|
int[] |
getBidirectionalRelationMemberPositions(ClassLoaderResolver clr)
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<String> 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.
|
List<ForeignKeyMetaData> |
getForeignKeyMetaData() |
String |
getFullClassName()
Accessor for the full class name including any package name.
|
IdentityMetaData |
getIdentityMetaData()
Accessor for identityMetaData
|
IdentityType |
getIdentityType() |
List<IndexMetaData> |
getIndexMetaData() |
InheritanceMetaData |
getInheritanceMetaData()
Accessor for inheritanceMetaData
|
List<JoinMetaData> |
getJoinMetaData() |
EventListenerMetaData |
getListenerForClass(String className)
Accessor for the EventListener info for an EventListener class name
|
List<EventListenerMetaData> |
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 member definition for the specified name.
|
int |
getMemberCount()
Accessor for the number of managed members from this class plus inherited classes.
|
AbstractMemberMetaData |
getMetaDataForManagedMemberAtAbsolutePosition(int position)
Accessor for a managed member including superclass members.
|
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 member in this class.
|
AbstractMemberMetaData |
getMetaDataForMember(String name)
Accessor for the Meta-Data for a member.
|
AbstractMemberMetaData |
getMetaDataForMemberAtRelativePosition(int index)
Accessor for the metadata of a member.
|
MetaDataManager |
getMetaDataManager() |
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) |
int |
getNoOfInheritedManagedMembers()
Accessor for the number of inherited managed members in superclasses.
|
int |
getNoOfManagedMembers()
Accessor for the number of managed members (this class only).
|
int |
getNoOfMembers()
Accessor for the number of members defined for this class (including overrides).
|
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)
Convenience method to return the absolute positions of all fields/properties that have relations.
|
int |
getRelativePositionOfMember(String memberName)
Accessor for the (relative) 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() |
List<UniqueMetaData> |
getUniqueMetaData() |
List<ColumnMetaData> |
getUnmappedColumns()
Accessor for the unmapped columns required 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 member exists in this classes definition.
|
boolean |
hasRelations(ClassLoaderResolver clr)
Convenience method to return if the class has relations to other objects.
|
protected void |
inheritIdentity()
Inherit the identity definition from super classes.
|
protected void |
initialiseMemberPositionInformation()
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)
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)
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, addExtensions, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, initialise, isInitialised, isPopulated, isUsed, removeExtension, setExtensions, setParent
public static final String GENERATED_PK_SUFFIX
protected transient MetaDataManager mmgr
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<EventListenerMetaData> 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 List<ColumnMetaData> unmappedColumns
protected Set<FetchGroupMetaData> fetchGroups
protected List<ForeignKeyMetaData> foreignKeys
protected List<IndexMetaData> indexes
protected List<UniqueMetaData> uniqueConstraints
protected List<JoinMetaData> joins
protected List<AbstractMemberMetaData> members
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)
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 MetaDataManager getMetaDataManager()
getMetaDataManager
in class MetaData
public boolean isInstantiable()
protected AbstractClassMetaData getRootInstantiableClass()
public boolean isRootInstantiableClass()
public boolean isImplementationOfPersistentDefinition()
protected 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)
clr
- the ClassLoaderprimary
- the primary ClassLoader to use (or null)protected void determineIdentity()
protected void determineSuperClassName(ClassLoaderResolver clr, Class cls)
clr
- The ClassLoaderResolvercls
- This classInvalidMetaDataException
- 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()
protected void applyDefaultDiscriminatorValueWhenNotSpecified()
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()
InvalidMetaDataException
- 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)
clr
- ClassLoader resolverpublic abstract void populate(ClassLoaderResolver clr, ClassLoader primary, MetaDataManager mmgr)
clr
- ClassLoaderResolver to use in loading any classesprimary
- the primary ClassLoader to use (or null)mmgr
- MetaData managerprotected void initialiseMemberPositionInformation()
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 IdentityType getIdentityType()
public void setIdentityType(IdentityType type)
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 PackageMetaData getPackageMetaData()
public String getPackageName()
public ClassPersistenceModifier getPersistenceModifier()
public AbstractClassMetaData setPersistenceModifier(ClassPersistenceModifier modifier)
public String getPersistableSuperclass()
public boolean usesSingleFieldIdentityClass()
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 memberpublic int getNoOfMembers()
public AbstractMemberMetaData getMetaDataForMember(String name)
name
- the name of the memberpublic int getNoOfManagedMembers()
public AbstractMemberMetaData[] getManagedMembers()
public AbstractMemberMetaData[] getOverriddenMembers()
public AbstractMemberMetaData getOverriddenMember(String name)
name
- Name of the field/propertyprotected AbstractMemberMetaData getMemberBeingOverridden(String name)
name
- Name of the member we requirepublic int getNoOfInheritedManagedMembers()
public int getMemberCount()
public AbstractMemberMetaData getMetaDataForMemberAtRelativePosition(int index)
index
- field index relative to this class only starting from 0public AbstractMemberMetaData getMetaDataForManagedMemberAtRelativePosition(int position)
position
- The position of the managed field. 0 = first in the classpublic AbstractMemberMetaData getMetaDataForManagedMemberAtAbsolutePosition(int position)
position
- The position of the managed member including the superclass. Fields are numbered from 0 in the root persistable 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 getRelativePositionOfMember(String memberName)
memberName
- Name of the memberpublic int getAbsolutePositionOfMember(String memberName)
memberName
- Name of the memberpublic 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)
clr
- ClassLoader resolverpublic int[] getMultivaluedMemberPositions()
public int[] getSCOMutableMemberPositions()
public int[] getSCONonContainerMemberPositions()
public int[] getSCOContainerMemberPositions()
public boolean[] getSCOMutableMemberFlags()
public boolean hasRelations(ClassLoaderResolver clr)
clr
- ClassLoader resolverpublic int[] getNonRelationMemberPositions(ClassLoaderResolver clr)
public int[] getRelationMemberPositions(ClassLoaderResolver clr)
clr
- ClassLoader resolverpublic int[] getBidirectionalRelationMemberPositions(ClassLoaderResolver clr)
clr
- ClassLoader resolverpublic void setAccessViaField(boolean flag)
public Boolean getAccessViaField()
public void setMappedSuperclass(boolean mapped)
public boolean isMappedSuperclass()
public void setSerializeRead(boolean serialise)
public boolean isSerializeRead()
public void setMetaDataComplete()
public boolean isMetaDataComplete()
public void addQuery(QueryMetaData qmd)
qmd
- Meta-Data for the query.public int getNoOfQueries()
public QueryMetaData[] getQueries()
public QueryMetaData newQueryMetadata(String queryName)
queryName
- Name of the querypublic void addStoredProcQuery(StoredProcQueryMetaData qmd)
qmd
- Meta-Data for the query.public int getNoOfStoredProcQueries()
public StoredProcQueryMetaData[] getStoredProcQueries()
public StoredProcQueryMetaData newStoredProcQueryMetadata(String queryName)
queryName
- Name of the proc querypublic void addQueryResultMetaData(QueryResultMetaData resultMetaData)
resultMetaData
- Query-Result MetaData to registerpublic QueryResultMetaData[] getQueryResultMetaData()
public void addIndex(IndexMetaData idxmd)
idxmd
- Meta-Data for the index.public final List<IndexMetaData> getIndexMetaData()
public IndexMetaData newIndexMetadata()
public void addForeignKey(ForeignKeyMetaData fkmd)
fkmd
- Meta-Data for the foreign-key.public final List<ForeignKeyMetaData> getForeignKeyMetaData()
public ForeignKeyMetaData newForeignKeyMetadata()
public void addUniqueConstraint(UniqueMetaData unimd)
unimd
- Meta-Data for the unique constraint.public final List<UniqueMetaData> getUniqueMetaData()
public UniqueMetaData newUniqueMetadata()
public final void addUnmappedColumn(ColumnMetaData colmd)
colmd
- The metadata for the unmapped columnpublic final List<ColumnMetaData> getUnmappedColumns()
public 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 Set<FetchGroupMetaData> getFetchGroupMetaData(Collection<String> groupNames)
groupNames
- Names of the fetch groupspublic FetchGroupMetaData getFetchGroupMetaData(String groupname)
groupname
- Name of the fetch grouppublic final Set<FetchGroupMetaData> getFetchGroupMetaData()
public final boolean hasFetchGroupWithPostLoad()
FetchGroupMetaData.getPostLoad()
==true.public void addJoin(JoinMetaData jnmd)
jnmd
- Meta-Data for the join.public final List<JoinMetaData> getJoinMetaData()
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<EventListenerMetaData> 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 final VersionMetaData getVersionMetaData()
public final VersionMetaData getVersionMetaDataForClass()
public final boolean isVersioned()
public final VersionMetaData getVersionMetaDataForTable()
public VersionMetaData newVersionMetadata()
public final void setIdentityMetaData(IdentityMetaData identityMetaData)
identityMetaData
- The identityMetaData to set.public final IdentityMetaData getIdentityMetaData()
public final IdentityMetaData getBaseIdentityMetaData()
public IdentityMetaData newIdentityMetadata()
public final void setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
inheritanceMetaData
- The inheritanceMetaData to set.public final InheritanceMetaData getInheritanceMetaData()
public InheritanceMetaData newInheritanceMetadata()
public final void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
primaryKeyMetaData
- The PrimaryKey MetaData to set.public final PrimaryKeyMetaData getPrimaryKeyMetaData()
public PrimaryKeyMetaData newPrimaryKeyMetadata()
protected static void checkForCircularViewReferences(Map<String,Set<String>> viewReferences, String referencerName, String referenceeName, List<String> referenceChain)
viewReferences
- The Map of view references to check.referencerName
- Name of the class that has the reference.referenceeName
- Name of the class that is being referenced.referenceChain
- The List of class names that have been referencedNucleusUserException
- If a circular reference is found in the view definitions.Copyright © 2019. All rights reserved.