org.datanucleus.metadata
Class AbstractClassMetaData

java.lang.Object
  extended by org.datanucleus.metadata.MetaData
      extended by org.datanucleus.metadata.AbstractClassMetaData
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
ClassMetaData, InterfaceMetaData

public abstract class AbstractClassMetaData
extends MetaData

Abstract representation of the MetaData of a class/interface. Has a parent PackageMetaData that can contain the metadata for several classes/interfaces. Is extended by ClassMetaData and InterfaceMetaData. Of the things that it contains the main one are the "members" which are the MetaData for all fields and properties that are persistable.

See Also:
Serialized Form

Field Summary
protected  int[] allMemberPositions
          Positions of all fields/properties (inc superclasses).
protected  boolean cacheable
          cacheable tag value.
protected  java.lang.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  java.lang.String entityName
          Entity name.
protected  java.lang.Boolean excludeDefaultListeners
          Flag to exclude default listeners.
protected  java.lang.Boolean excludeSuperClassListeners
          Flag to exclude superclass listeners.
protected  FetchGroupMetaData[] fetchGroupMetaData
          Fetch Groups for this class.
protected  java.util.Map<java.lang.String,FetchGroupMetaData> fetchGroupMetaDataByName
          Convenience lookup map of fetch group by the name.
protected  java.lang.Boolean fetchGroupMetaWithPostLoad
          Cached result of hasFetchGroupWithPostLoad()
protected  java.util.List<FetchGroupMetaData> fetchGroups
          List of fetch-group
protected  ForeignKeyMetaData[] foreignKeyMetaData
          ForeignKeyMetaData
protected  java.util.List<ForeignKeyMetaData> foreignKeys
          List of foreign-key
protected  java.lang.String fullName
          Full name (e.g org.datanucleus.MyClass)
static java.lang.String GENERATED_PK_SUFFIX
          Suffix to add on to the class name for any generated primary key class.
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  java.util.List<IndexMetaData> indexes
          List of indexes
protected  IndexMetaData[] indexMetaData
          IndexMetaData
protected  InheritanceMetaData inheritanceMetaData
          Inheritance MetaData
protected  JoinMetaData[] joinMetaData
          JoinMetaData
protected  java.util.List<JoinMetaData> joins
          List of joins
protected  java.util.List listeners
          EventListeners.
protected static Localiser LOCALISER_API
           
protected  AbstractMemberMetaData[] managedMembers
          Managed fields/properties of this class.
protected  int memberCount
          number of managed fields/properties from this class plus inherited classes.
protected  java.util.Map<java.lang.String,java.lang.Integer> memberPositionsByName
          Position numbers of members mapped by the name of the field/property.
protected  java.util.List members
          List of members (fields/properties).
protected  boolean metaDataComplete
          Flag for whether the MetaData here is complete without annotations.
protected  java.lang.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  java.lang.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  java.lang.String persistenceCapableSuperclass
          persistence-capable-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  int[] pkMemberPositions
          Positions of the primary-key fields/properties (inc superclasses).
protected  PrimaryKeyMetaData primaryKeyMetaData
          PrimaryKey MetaData
protected  java.util.Collection<QueryMetaData> queries
          Named queries
protected  java.util.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  java.lang.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  java.lang.String table
          Table name (O/R mapping).
protected  java.util.List<UniqueMetaData> uniqueConstraints
          List of uniqueConstraints
protected  UniqueMetaData[] uniqueMetaData
          UniqueMetaData
protected  java.util.List<ColumnMetaData> unmappedColumns
          The columns that are present in the datastore yet not mapped to fields in this class.
protected  boolean usesSingleFieldIdentityClass
          if this PersistenceCapable class uses SingleFieldIdentity
protected  VersionMetaData versionMetaData
          Version MetaData
 
Fields inherited from class org.datanucleus.metadata.MetaData
extensions, LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent, VENDOR_NAME, VENDOR_NAME_OLD
 
Constructor Summary
  AbstractClassMetaData(ClassMetaData cmd, java.lang.String implClassName)
          Constructor for creating the ClassMetaData for an implementation of a "persistent-abstract-class".
  AbstractClassMetaData(InterfaceMetaData imd, java.lang.String implClassName, boolean copyMembers)
          Constructor for creating the ClassMetaData for an implementation of a "persistent-interface".
protected AbstractClassMetaData(PackageMetaData parent, java.lang.String name)
          Constructor.
 
Method Summary
 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 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  void checkInitialised()
          Method to check whether the Meta-Data has been initialised.
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, java.lang.Class cls, MetaDataManager mmgr)
          Determine the super PersistenceCapable class.
 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(java.lang.String memberName)
          Accessor for the absolute position of the field/property with the specified name.
 int getAbsolutePositionOfMember(java.lang.String className, java.lang.String memberName)
          Accessor for the absolute position of the field/property with the specified name.
 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  java.lang.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.
 java.lang.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).
 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.
 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.
 java.lang.String getEntityName()
           
 FetchGroupMetaData[] getFetchGroupMetaData()
          Accessor for all MetaData defined for fetch groups for this class.
 FetchGroupMetaData[] getFetchGroupMetaData(java.util.Collection groupNames)
          Accessor for fetch group metadata for the specified groups (if present).
 FetchGroupMetaData getFetchGroupMetaData(java.lang.String groupname)
          Accessor for the fetch group metadata for the group specified.
 ForeignKeyMetaData[] getForeignKeyMetaData()
          Accessor for foreignKeyMetaData
 java.lang.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(java.lang.String className)
          Accessor for the EventListener info for an EventListener class name
 java.util.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(java.lang.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 getMetaDataForManagedMemberAtPosition(int position)
          Accessor for MetaData for a managed field/property in this class.
 AbstractMemberMetaData getMetaDataForMember(java.lang.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.
 java.lang.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 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.
 java.lang.String getObjectidClass()
           
 AbstractMemberMetaData getOverriddenMember(int position)
          Accessor for MetaData for an overridden field/property in this class.
 AbstractMemberMetaData getOverriddenMember(java.lang.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.
 java.lang.String getPackageName()
          Convenience accessor for the package name.
 java.lang.String getPersistenceCapableSuperclass()
           
 ClassPersistenceModifier getPersistenceModifier()
           
 int[] getPKMemberPositions()
          Accessor for the field numbers of the primary key fields/properties.
 java.lang.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(java.lang.String memberName)
          Accessor for the position of the field/property with the specified name.
 java.lang.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)
 AbstractClassMetaData getSuperAbstractClassMetaData()
          Accessor for the Meta-Data for the superclass of this class.
 java.lang.String getTable()
           
 UniqueMetaData[] getUniqueMetaData()
          Accessor for UniqueMetaData
 java.util.List getUnmappedColumns()
          Accessor for the unmapped columns require for the datastore table.
 VersionMetaData getVersionMetaData()
          Accessor for Version MetaData for objects stored in this table
 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(java.lang.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.
 boolean hasVersionStrategy()
           
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 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 isMetaDataComplete()
          Accessor for whether this class is fully specified by this metadata and that any annotations should be ignored.
 boolean isRequiresExtent()
           
 boolean isSameOrAncestorOf(AbstractClassMetaData cmd)
          Check if the argument cmd is the same as this or a descedent.
 boolean isSerializeRead()
          Whether objects of this type should default to serialize read (lock).
protected  java.lang.Class loadClass(ClassLoaderResolver clr, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Load the persistent interface/class
protected  AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted PropertyMetaData to the class.
 FetchGroupMetaData newFetchGroupMetaData(java.lang.String name)
          Method to create a new fetchgroup metadata, add it, and return it.
 FieldMetaData newFieldMetadata(java.lang.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(java.lang.String propName)
          Method to create a new property metadata, add it, and return it.
 QueryMetaData newQueryMetadata(java.lang.String queryName)
          Method to create a new QueryMetadata, 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.
abstract  void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary, MetaDataManager mmgr)
          Method to provide the details of the class being represented by this MetaData.
 AbstractClassMetaData setCacheable(boolean cache)
           
 AbstractClassMetaData setCacheable(java.lang.String cache)
           
 AbstractClassMetaData setCatalog(java.lang.String catalog)
           
 AbstractClassMetaData setDetachable(boolean flag)
           
 AbstractClassMetaData setDetachable(java.lang.String flag)
           
 AbstractClassMetaData setEmbeddedOnly(boolean flag)
           
 AbstractClassMetaData setEmbeddedOnly(java.lang.String flag)
           
 AbstractClassMetaData setEntityName(java.lang.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 setMetaDataComplete()
          Method to set that this class is "metadata complete" (see JPA spec).
 AbstractClassMetaData setObjectIdClass(java.lang.String objectidClass)
           
 void setPersistenceCapableSuperclass(java.lang.String pcSuperclassName)
           
 AbstractClassMetaData setPersistenceModifier(ClassPersistenceModifier modifier)
           
 void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
          Mutator for the PrimaryKey MetaData.
 AbstractClassMetaData setRequiresExtent(boolean flag)
           
 AbstractClassMetaData setRequiresExtent(java.lang.String flag)
           
 AbstractClassMetaData setSchema(java.lang.String schema)
           
 void setSerializeRead(boolean serialise)
           
 AbstractClassMetaData setTable(java.lang.String table)
           
 void setVersionMetaData(VersionMetaData versionMetaData)
          Mutator for the Version MetaData.
 boolean usesSingleFieldIdentityClass()
          Whether this PersistenceCapable 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()
          Check if the inheritance MetaData is credible.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, assertIfInitialised, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, newExtensionMetaData, removeExtension, setParent, toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

LOCALISER_API

protected static Localiser LOCALISER_API

GENERATED_PK_SUFFIX

public static java.lang.String GENERATED_PK_SUFFIX
Suffix to add on to the class name for any generated primary key class.


name

protected final java.lang.String name
Class name


entityName

protected java.lang.String entityName
Entity name. Required by JPA1 $4.3.1 for accessing this class in queries.


identityType

protected IdentityType identityType
Identity-type tag value.


persistenceModifier

protected ClassPersistenceModifier persistenceModifier
persistence-modifier tag value.


persistenceCapableSuperclass

protected java.lang.String persistenceCapableSuperclass
persistence-capable-superclass tag value (deprecated).


objectidClass

protected java.lang.String objectidClass
objectid-class tag value.


requiresExtent

protected boolean requiresExtent
requires-extent tag value.


detachable

protected boolean detachable
detachable tag value.


embeddedOnly

protected boolean embeddedOnly
embedded-only tag value.


catalog

protected java.lang.String catalog
Catalog name (O/R mapping).


schema

protected java.lang.String schema
Schema name (O/R mapping).


table

protected java.lang.String table
Table name (O/R mapping). This may be of the form "[database].[catalog].[schema].table"


cacheable

protected boolean cacheable
cacheable tag value.


fullName

protected final java.lang.String fullName
Full name (e.g org.datanucleus.MyClass)


versionMetaData

protected VersionMetaData versionMetaData
Version MetaData


identityMetaData

protected IdentityMetaData identityMetaData
Identity MetaData


identitySpecified

protected boolean identitySpecified
Flag whether the identity was specified by the user.


inheritanceMetaData

protected InheritanceMetaData inheritanceMetaData
Inheritance MetaData


primaryKeyMetaData

protected PrimaryKeyMetaData primaryKeyMetaData
PrimaryKey MetaData


listeners

protected java.util.List listeners
EventListeners. Use a list to preserve ordering.


excludeSuperClassListeners

protected java.lang.Boolean excludeSuperClassListeners
Flag to exclude superclass listeners.


excludeDefaultListeners

protected java.lang.Boolean excludeDefaultListeners
Flag to exclude default listeners.


fetchGroupMetaData

protected FetchGroupMetaData[] fetchGroupMetaData
Fetch Groups for this class. Available to be used in queries and when detaching.


fetchGroupMetaDataByName

protected java.util.Map<java.lang.String,FetchGroupMetaData> fetchGroupMetaDataByName
Convenience lookup map of fetch group by the name.


pcSuperclassMetaData

protected AbstractClassMetaData pcSuperclassMetaData
Class MetaData for the persistable superclass (if any)


metaDataComplete

protected boolean metaDataComplete
Flag for whether the MetaData here is complete without annotations. Used by JPA.


serializeRead

protected boolean serializeRead
Whether to lock objects of this type on read operations.


queries

protected java.util.Collection<QueryMetaData> queries
Named queries


queryResultMetaData

protected java.util.Collection<QueryResultMetaData> queryResultMetaData
List of query result MetaData defined for this file.


joinMetaData

protected JoinMetaData[] joinMetaData
JoinMetaData


indexMetaData

protected IndexMetaData[] indexMetaData
IndexMetaData


foreignKeyMetaData

protected ForeignKeyMetaData[] foreignKeyMetaData
ForeignKeyMetaData


uniqueMetaData

protected UniqueMetaData[] uniqueMetaData
UniqueMetaData


members

protected java.util.List members
List of members (fields/properties).


unmappedColumns

protected java.util.List<ColumnMetaData> unmappedColumns
The columns that are present in the datastore yet not mapped to fields in this class.


joins

protected java.util.List<JoinMetaData> joins
List of joins


foreignKeys

protected java.util.List<ForeignKeyMetaData> foreignKeys
List of foreign-key


indexes

protected java.util.List<IndexMetaData> indexes
List of indexes


uniqueConstraints

protected java.util.List<UniqueMetaData> uniqueConstraints
List of uniqueConstraints


fetchGroups

protected java.util.List<FetchGroupMetaData> fetchGroups
List of fetch-group


managedMembers

protected AbstractMemberMetaData[] managedMembers
Managed fields/properties of this class. Contains the same AbstractMemberMetaData objects as are in "members". Doesnt include any overridden members which are stored separately. All fields will return true to "fmd.isJdoField()".


overriddenMembers

protected AbstractMemberMetaData[] overriddenMembers
Fields/properties for superclasses that are overridden in this class.


memberPositionsByName

protected java.util.Map<java.lang.String,java.lang.Integer> memberPositionsByName
Position numbers of members mapped by the name of the field/property.


allMemberPositions

protected int[] allMemberPositions
Positions of all fields/properties (inc superclasses).


pkMemberPositions

protected int[] pkMemberPositions
Positions of the primary-key fields/properties (inc superclasses).


nonPkMemberPositions

protected int[] nonPkMemberPositions
Positions of the non-primary-key fields/properties (inc superclasses).


nonPkMemberFlags

protected boolean[] nonPkMemberFlags
Flags of the non-primary key fields/properties (inc superclasses).


dfgMemberPositions

protected int[] dfgMemberPositions
Positions of the default-fetch-group fields/properties (inc superclasses).


dfgMemberFlags

protected boolean[] dfgMemberFlags
Flags of the default-fetch-group state for all fields/properties.


scoMutableMemberPositions

protected int[] scoMutableMemberPositions
Positions of the SCO mutable fields/properties (inc superclasses).


scoMutableMemberFlags

protected boolean[] scoMutableMemberFlags
Flags of the SCO mutable state for all fields/properties.


scoNonContainerMemberPositions

protected int[] scoNonContainerMemberPositions
Absolute positions of all SCO fields/properties that aren't containers.


relationPositions

protected int[] relationPositions
Absolute positions of the fields/properties that have relations.


noOfInheritedManagedMembers

protected int noOfInheritedManagedMembers
No of managed fields/properties in superclasses, that are inherited by this class.


usesSingleFieldIdentityClass

protected boolean usesSingleFieldIdentityClass
if this PersistenceCapable class uses SingleFieldIdentity


memberCount

protected int memberCount
number of managed fields/properties from this class plus inherited classes.


implementationOfPersistentDefinition

protected boolean implementationOfPersistentDefinition

fetchGroupMetaWithPostLoad

protected java.lang.Boolean fetchGroupMetaWithPostLoad
Cached result of hasFetchGroupWithPostLoad()


persistentInterfaceImplNeedingTableFromSuperclass

protected transient boolean persistentInterfaceImplNeedingTableFromSuperclass
Implementation of "persistent-interface" needing table setting from superclass.


persistentInterfaceImplNeedingTableFromSubclass

protected transient boolean persistentInterfaceImplNeedingTableFromSubclass
Implementation of "persistent-interface" needing table setting from subclass.


secondClassContainerMemberPositions

protected int[] secondClassContainerMemberPositions
Positions of all SCO fields/properties that are containers.

Constructor Detail

AbstractClassMetaData

protected AbstractClassMetaData(PackageMetaData parent,
                                java.lang.String name)
Constructor. Set fields using setters, before populate().

Parameters:
parent - The package to which this class/interface belongs
name - (Simple) name of class (omitting the package name)

AbstractClassMetaData

public AbstractClassMetaData(InterfaceMetaData imd,
                             java.lang.String implClassName,
                             boolean copyMembers)
Constructor for creating the ClassMetaData for an implementation of a "persistent-interface".

Parameters:
imd - MetaData for the "persistent-interface"
implClassName - Name of the implementation class
copyMembers - Whether to copy the fields/properties of the interface too

AbstractClassMetaData

public AbstractClassMetaData(ClassMetaData cmd,
                             java.lang.String implClassName)
Constructor for creating the ClassMetaData for an implementation of a "persistent-abstract-class".

Parameters:
cmd - MetaData for the implementation of the "persistent-abstract-class"
implClassName - Name of the implementation class
Method Detail

isImplementationOfPersistentDefinition

public boolean isImplementationOfPersistentDefinition()
Return whether this MetaData is for an implementation of a persistent definition. This could be an implementation of a persistent interface or a persistent abstract-class.

Returns:
Whether this is an implementation

copyMembersFromInterface

protected void copyMembersFromInterface(InterfaceMetaData imd)
Convenience method to copy the properties from an existing interface. Adds FieldMetaData for each PropertyMetaData on the persistent-interface.

Parameters:
imd - The interface that we copy from

checkInitialised

protected void checkInitialised()
Method to check whether the Meta-Data has been initialised.

Throws:
NucleusException - Thrown if the Meta-Data hasn't been initialised.

checkPopulated

protected void checkPopulated()
Method to check whether the Meta-Data has been populated.

Throws:
NucleusException - Thrown if the Meta-Data hasn't been populated.

loadClass

protected java.lang.Class loadClass(ClassLoaderResolver clr,
                                    java.lang.ClassLoader primary,
                                    MetaDataManager mmgr)
Load the persistent interface/class

Parameters:
clr - the ClassLoader
primary - the primary ClassLoader to use (or null)
mmgr - MetaData manager
Returns:
the loaded class

determineIdentity

protected void determineIdentity()
Determines the identity based on MetaData defaults or user defined MetaData


determineSuperClassName

protected void determineSuperClassName(ClassLoaderResolver clr,
                                       java.lang.Class cls,
                                       MetaDataManager mmgr)
Determine the super PersistenceCapable class. The persistence-capable-superclass attribute is deprecated for JDO2.0. The attribute will be ignored so metadata files from previous releases can be used. The persistenceCapableSuperclass we use will be retrieved from the class itself.

Parameters:
clr - The ClassLoaderResolver
cls - This class
mmgr - MetaData manager
Throws:
InvalidMetaDataException - if the declared persistence-capable-superclass super class cannot be loaded by the clr.
InvalidMetaDataException - if the declared persistence-capable-superclass has no reachable MetaData

validateUserInputForIdentity

protected void validateUserInputForIdentity()
Check for conflicts on super class and this class MetaData identity

Throws:
InvalidMetaDataException - if the user tries to overwrite a superclass identity / strategy

getBaseAbstractClassMetaData

public AbstractClassMetaData getBaseAbstractClassMetaData()
Convenience accessor for the AbstractClassMetaData of the base object in this hierarchy.

Returns:
The AbstractClassMetaData for the base object.

getBaseInheritanceStrategy

protected java.lang.String getBaseInheritanceStrategy()

inheritIdentity

protected void inheritIdentity()
Inherit the identity definition from super classes.

Throws:
InvalidMetaDataException - if the MetaData of this class conflicts with super classes definition

newDefaultedProperty

protected AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
Utility to add a defaulted PropertyMetaData to the class. Provided as a method since then any derived classes can override it.

Parameters:
name - name of property
Returns:
the new PropertyMetaData

validateUserInputForInheritanceMetaData

protected void validateUserInputForInheritanceMetaData()
Check if the inheritance MetaData is credible.

Throws:
InvalidMetaDataException - if the strategy is superclass-table, yet there are no super class
InvalidMetaDataException - if the strategy is superclass-table, yet the super class has not specified a discriminator
InvalidMetaDataException - if the strategy is superclass-table and discriminator is "value-map", yet no value for the discriminator has been specified

validateUnmappedColumns

protected void validateUnmappedColumns()
Convenience method to validate the specified "unmapped" columns.

Throws:
InvalidMetaDataException - if a column is specified without its name.

getSuperAbstractClassMetaData

public AbstractClassMetaData getSuperAbstractClassMetaData()
Accessor for the Meta-Data for the superclass of this class.

Returns:
MetaData of the superclass

determineObjectIdClass

protected void determineObjectIdClass(MetaDataManager mmgr)
Determine the object id class.

Parameters:
mmgr - MetaData manager
Throws:
InvalidMetaDataException - if the class 0 or more that one primary key field and no objectid-class has been declared in the MetaData
InvalidMetaDataException - if the objectid-class has not been set and the primary key field does not match a supported SingleFieldIdentity
InvalidMetaDataException - if the identity type is APPLICATION but not primary key fields have been set
InvalidMetaDataException - if the objectid-class cannot be loaded by the clr

validateObjectIdClass

protected void validateObjectIdClass(ClassLoaderResolver clr,
                                     MetaDataManager mmgr)
Validate the objectid-class of this class.

Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager

populate

public abstract void populate(ClassLoaderResolver clr,
                              java.lang.ClassLoader primary,
                              MetaDataManager mmgr)
Method to provide the details of the class being represented by this MetaData. This can be used to firstly provide defaults for attributes that aren't specified in the MetaData, and secondly to report any errors with attributes that have been specifed that are inconsistent with the class being represented.

This method must be invoked by subclasses during populate operations

Parameters:
clr - ClassLoaderResolver to use in loading any classes
primary - the primary ClassLoader to use (or null)
mmgr - MetaData manager

initialise

public abstract void initialise(ClassLoaderResolver clr,
                                MetaDataManager mmgr)
Method to initialise the sub-objects of this class metadata. If populate() is going to be used it should be used BEFORE calling this method. Subclasses must overwrite this method and invoke this

Overrides:
initialise in class MetaData
Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager

initialiseMemberPositionInformation

protected void initialiseMemberPositionInformation(MetaDataManager mmgr)
Method to initialise all convenience information about member positions and what role each position performs.


determineInheritanceMetaData

protected void determineInheritanceMetaData(MetaDataManager mmgr)
Impose a default inheritance strategy when one is not already specified. Uses the PMF property for defaultInheritanceStrategy and works to the JDO2 spec etc.

Parameters:
mmgr - MetaData manager

applyDefaultDiscriminatorValueWhenNotSpecified

protected void applyDefaultDiscriminatorValueWhenNotSpecified()

getNoOfQueries

public int getNoOfQueries()
Accessor for the number of named queries.

Returns:
no of named queries

getQueries

public QueryMetaData[] getQueries()
Accessor for the metadata of the named queries.

Returns:
Meta-Data for the named queries.

getQueryResultMetaData

public QueryResultMetaData[] getQueryResultMetaData()
Get the query result MetaData registered for this class.

Returns:
Query Result MetaData defined for this class

getVersionMetaData

public final VersionMetaData getVersionMetaData()
Accessor for Version MetaData for objects stored in this table

Returns:
Returns the versionMetaData.

hasVersionStrategy

public final boolean hasVersionStrategy()
Returns:
true if version.strategy is neither null nor NONE

getVersionMetaDataForTable

public final VersionMetaData getVersionMetaDataForTable()
Convenience method to find the version MetaData defining versioning for the same table as this class is using. Traverses up the inheritance tree to find the highest class that uses "subclass-table" that has version metadata defined, and returns the MetaData.

Returns:
Version MetaData for the highest class in this tree using subclass-table

getDiscriminatorMetaDataForTable

public final DiscriminatorMetaData getDiscriminatorMetaDataForTable()
Convenience method to find the discriminator MetaData defining the discrim for the same table as this class is using. Traverses up the inheritance tree to find the highest class that uses "subclass-table" that has discriminator metadata defined, and returns the MetaData.

Returns:
DiscriminatorMetaData for the highest class in this tree using subclass-table

getDiscriminatorMetaData

public final DiscriminatorMetaData getDiscriminatorMetaData()
Convenience accessor for the discriminator metadata applying to this class. This is specified on the class managing the table if at all.

Returns:
The discriminator metadata

hasDiscriminatorStrategy

public final boolean hasDiscriminatorStrategy()
Accessor for whether we have a discriminator defined for this class (may be in superclasses).

Returns:
true if discriminatorStrategy is not null and not NONE

getDiscriminatorStrategy

public final DiscriminatorStrategy getDiscriminatorStrategy()
Method to return the discriminator strategy being used by this class. Returns the strategy defined on this class (if any), otherwise goes up to the superclass etc until it finds a defined strategy.

Returns:
The discriminator strategy

getDiscriminatorStrategyForTable

public final DiscriminatorStrategy getDiscriminatorStrategyForTable()
Convenience accessor for the discriminator strategy applying to this class. This is specified on the class managing the table if at all.

Returns:
The discriminator strategy

getJoinMetaData

public final JoinMetaData[] getJoinMetaData()
Accessor for joinMetaData

Returns:
Returns the joinMetaData.

getFetchGroupMetaData

public final FetchGroupMetaData[] getFetchGroupMetaData()
Accessor for all MetaData defined for fetch groups for this class. This doesn't include superclasses.

Returns:
Returns the fetchGroupMetaData.

getFetchGroupMetaData

public FetchGroupMetaData[] getFetchGroupMetaData(java.util.Collection groupNames)
Accessor for fetch group metadata for the specified groups (if present). The returned metadata is what is defined for this class that matches any of the names in the input set.

Parameters:
groupNames - Names of the fetch groups
Returns:
MetaData for the groups

getFetchGroupMetaData

public FetchGroupMetaData getFetchGroupMetaData(java.lang.String groupname)
Accessor for the fetch group metadata for the group specified.

Parameters:
groupname - Name of the fetch group
Returns:
MetaData for this group

getIdentityType

public IdentityType getIdentityType()

setIdentityType

public void setIdentityType(IdentityType type)

getIndexMetaData

public final IndexMetaData[] getIndexMetaData()
Accessor for indexMetaData

Returns:
Returns the indexMetaData.

getForeignKeyMetaData

public final ForeignKeyMetaData[] getForeignKeyMetaData()
Accessor for foreignKeyMetaData

Returns:
Returns the foreignKeyMetaData.

getUniqueMetaData

public final UniqueMetaData[] getUniqueMetaData()
Accessor for UniqueMetaData

Returns:
Returns the UniqueMetaData.

getUnmappedColumns

public final java.util.List getUnmappedColumns()
Accessor for the unmapped columns require for the datastore table.

Returns:
The list of unmapped columns

getName

public java.lang.String getName()
Accessor for the simple class name (without package name).

Returns:
class name

getFullClassName

public java.lang.String getFullClassName()
Accessor for the full class name including any package name.

Returns:
full class name.

getObjectidClass

public java.lang.String getObjectidClass()

setObjectIdClass

public AbstractClassMetaData setObjectIdClass(java.lang.String objectidClass)

getEntityName

public java.lang.String getEntityName()

setEntityName

public AbstractClassMetaData setEntityName(java.lang.String name)

getCatalog

public java.lang.String getCatalog()

setCatalog

public AbstractClassMetaData setCatalog(java.lang.String catalog)

getSchema

public java.lang.String getSchema()

setSchema

public AbstractClassMetaData setSchema(java.lang.String schema)

getTable

public java.lang.String getTable()

setTable

public AbstractClassMetaData setTable(java.lang.String table)

isRequiresExtent

public boolean isRequiresExtent()

setRequiresExtent

public AbstractClassMetaData setRequiresExtent(boolean flag)

setRequiresExtent

public AbstractClassMetaData setRequiresExtent(java.lang.String flag)

isDetachable

public boolean isDetachable()

setDetachable

public AbstractClassMetaData setDetachable(boolean flag)

setDetachable

public AbstractClassMetaData setDetachable(java.lang.String flag)

isCacheable

public boolean isCacheable()

setCacheable

public AbstractClassMetaData setCacheable(boolean cache)

setCacheable

public AbstractClassMetaData setCacheable(java.lang.String cache)

isEmbeddedOnly

public boolean isEmbeddedOnly()

setEmbeddedOnly

public AbstractClassMetaData setEmbeddedOnly(boolean flag)

setEmbeddedOnly

public AbstractClassMetaData setEmbeddedOnly(java.lang.String flag)

getIdentityMetaData

public final IdentityMetaData getIdentityMetaData()
Accessor for identityMetaData

Returns:
Returns the identityMetaData.

getBaseIdentityMetaData

public final IdentityMetaData getBaseIdentityMetaData()
Convenience method to return the root identity metadata for this inheritance tree.

Returns:
IdentityMetaData at the base

getInheritanceMetaData

public final InheritanceMetaData getInheritanceMetaData()
Accessor for inheritanceMetaData

Returns:
Returns the inheritanceMetaData.

getPrimaryKeyMetaData

public final PrimaryKeyMetaData getPrimaryKeyMetaData()
Accessor for primaryKeyMetaData

Returns:
Returns the primaryKey MetaData.

getPackageMetaData

public PackageMetaData getPackageMetaData()
Convenience accessor for the parent Package MetaData.

Returns:
MetaData for parent package.

getPackageName

public java.lang.String getPackageName()
Convenience accessor for the package name.

Returns:
package name.

getNoOfMembers

public int getNoOfMembers()
Accessor for the number of fields/properties. This is the total number of fields/properties (inc static, final etc) in this class

Returns:
no of fields/properties.

getMetaDataForMemberAtRelativePosition

public AbstractMemberMetaData getMetaDataForMemberAtRelativePosition(int index)
Accessor for the metadata of a field/property. Does not include superclasses

Parameters:
index - field index relative to this class only starting from 0
Returns:
Meta-Data for the field/property

getPersistenceModifier

public ClassPersistenceModifier getPersistenceModifier()

setPersistenceModifier

public AbstractClassMetaData setPersistenceModifier(ClassPersistenceModifier modifier)

getPersistenceCapableSuperclass

public java.lang.String getPersistenceCapableSuperclass()

setPersistenceCapableSuperclass

public void setPersistenceCapableSuperclass(java.lang.String pcSuperclassName)

usesSingleFieldIdentityClass

public boolean usesSingleFieldIdentityClass()
Whether this PersistenceCapable class uses SingleFieldIdentity

Returns:
true if using SingleFieldIdentity as objectid class

isMetaDataComplete

public boolean isMetaDataComplete()
Accessor for whether this class is fully specified by this metadata and that any annotations should be ignored.

Returns:
Whether we should ignore any annotations

isSerializeRead

public boolean isSerializeRead()
Whether objects of this type should default to serialize read (lock).

Returns:
Whether to serialise read operations of this type

isSameOrAncestorOf

public boolean isSameOrAncestorOf(AbstractClassMetaData cmd)
Check if the argument cmd is the same as this or a descedent.

Parameters:
cmd - the AbstractClassMetaData to be verify if this is an ancestor
Returns:
true if the argument is a child or same as this

getPrimaryKeyMemberNames

public java.lang.String[] getPrimaryKeyMemberNames()
Accessor for the names of the primary key fields/properties. Only valid after being populated. Provided as a convenience where we need to get the names of the PK members but cant wait til initialisation.

Returns:
names of the PK fields/properties

hasMember

public boolean hasMember(java.lang.String memberName)
Method to check if a field/property exists in this classes definition. Will include any superclasses in the check.

Parameters:
memberName - Name of field/property
Returns:
return true if exists.

getMetaDataForMember

public AbstractMemberMetaData getMetaDataForMember(java.lang.String name)
Accessor for the Meta-Data for a field/property. Include superclasses.

Parameters:
name - the name of the field/property
Returns:
Meta-Data for the field.

getNoOfManagedMembers

public int getNoOfManagedMembers()
Accessor for the number of managed fields/properties (this class only).

Returns:
no of managed fields/properties in this class

getManagedMembers

public AbstractMemberMetaData[] getManagedMembers()
Accessor for the managed fields/properties in this class (not including superclass, but including overridden).

Returns:
MetaData for the managed fields/properties in this class

getMetaDataForManagedMemberAtPosition

public AbstractMemberMetaData getMetaDataForManagedMemberAtPosition(int position)
Accessor for MetaData for a managed field/property in this class. The position is relative to the first field in this class (ignores superclasses).

Parameters:
position - The position of the managed field. 0 = first in the class
Returns:
The JDO managed field at that position

getNoOfOverriddenMembers

public int getNoOfOverriddenMembers()
Accessor for the number of overridden fields/properties (this class only).

Returns:
no of overridden fields/properties in this class

getOverriddenMembers

public AbstractMemberMetaData[] getOverriddenMembers()
Accessor for the overridden fields/properties in this class.

Returns:
The overridden fields/properties in this class

getOverriddenMember

public AbstractMemberMetaData getOverriddenMember(int position)
Accessor for MetaData for an overridden field/property in this class.

Parameters:
position - The position of the overridden field/property.
Returns:
MetaData for the field/property at that position

getOverriddenMember

public AbstractMemberMetaData getOverriddenMember(java.lang.String name)
Accessor for an overridden field/property with the specified name.

Parameters:
name - Name of the field/property
Returns:
The MetaData for the field/property

getMemberBeingOverridden

protected AbstractMemberMetaData getMemberBeingOverridden(java.lang.String name)
Convenience method that navigates up a MetaData inheritance tree until it finds the base field/property definition.

Parameters:
name - Name of the field/property we require
Returns:
The AbstractMemberMetaData

getNoOfInheritedManagedMembers

public int getNoOfInheritedManagedMembers()
Accessor for the number of inherited managed fields/properties in superclasses.

Returns:
No of inherited managed fields/properties in superclasses.

getMemberCount

public int getMemberCount()
Accessor for the number of managed fields/properties from this class plus inherited classes.

Returns:
The number of managed fields/properties from this class plus inherited classes.

getMetaDataForManagedMemberAtAbsolutePosition

public AbstractMemberMetaData getMetaDataForManagedMemberAtAbsolutePosition(int abs_position)
Accessor for a managed field/property including superclass fields.

Parameters:
abs_position - The position of the managed member including the superclass. Fields are numbered from 0 in the root superclass.
Returns:
The managed field/property at this "absolute" position.

getMetaDataForManagedMemberAtAbsolutePositionInternal

protected AbstractMemberMetaData getMetaDataForManagedMemberAtAbsolutePositionInternal(int abs_position)
Internal method to get the field/property for an absolute field number. If the field for that absolute field position is overridden by a field in this class then this field/property will be returned.

Parameters:
abs_position - The position of the managed field including the superclass. Fields are numbered from 0 in the root superclass.
Returns:
The managed field at this "absolute" position.

getAbsoluteMemberPositionForRelativePosition

public int getAbsoluteMemberPositionForRelativePosition(int relativePosition)
Accessor for the absolute position for a relative position.

Parameters:
relativePosition - The relative field number
Returns:
The absolute position

getRelativePositionOfMember

public int getRelativePositionOfMember(java.lang.String memberName)
Accessor for the position of the field/property with the specified name. The returned position is relative to this class only.

Parameters:
memberName - Name of the field/property
Returns:
Position of the field/property in this class.

getAbsolutePositionOfMember

public int getAbsolutePositionOfMember(java.lang.String memberName)
Accessor for the absolute position of the field/property with the specified name. The absolute position has origin of the root superclass, starting at 0.

Parameters:
memberName - Name of the field/property
Returns:
Absolute position of the field/property.

getAbsolutePositionOfMember

public int getAbsolutePositionOfMember(java.lang.String className,
                                       java.lang.String memberName)
Accessor for the absolute position of the field/property with the specified name. The absolute position has origin of the root superclass, starting at 0. Will only retrieve the absolute field number if the field_name is of type given by class_name.

Parameters:
className - Name of the class
memberName - Name of the field/property
Returns:
Absolute position of the field/property.

getNoOfPrimaryKeyMembers

public int getNoOfPrimaryKeyMembers()
Accessor for the number of primary key fields/properties.

Returns:
no of primary key fields/properties

getAllMemberPositions

public int[] getAllMemberPositions()
Accessor for all field/property positions. These are absolute numbers and include superclasses and are really just 0, 1, 2, ... n.

Returns:
The positions of all (managed) fields/properties.

getPKMemberPositions

public int[] getPKMemberPositions()
Accessor for the field numbers of the primary key fields/properties. These are absolute numbers (including superclasses).

Returns:
The positions of the primary key fields/properties.

getNonPKMemberPositions

public int[] getNonPKMemberPositions()
Accessor for the positions of the non primary key fields/properties (inc superclass fields).

Returns:
The member positions

getNonPKMemberFlags

public boolean[] getNonPKMemberFlags()
Accessor for the flags of the non primary key fields/properties (inc superclass members).

Returns:
The flags whether the field/property is non primary key

getDFGMemberPositions

public int[] getDFGMemberPositions()
Accessor for the absolute positions of the default fetch group fields/properties (inc superclasses).

Returns:
The positions of the DFG fields/properties (inc superclasses).

getDFGMemberFlags

public boolean[] getDFGMemberFlags()
Accessor for the flags of the DFG fields/properties (inc superclass).

Returns:
The flags whether the field/property is in the DFG

getBasicMemberPositions

public int[] getBasicMemberPositions(ClassLoaderResolver clr,
                                     MetaDataManager mmgr)
Accessor for the absolute positions of fields/properties that are considered basic. This category includes members of all basic (primitive and immutable object class) types as defined in section 6.4 of the specification, including String, Date and its jdbc subtypes, Locale, Currency, and Enum types. Includes all inherited multivalued positions.

Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager
Returns:
The absolute positions

getMultivaluedMemberPositions

public 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. Includes all inherited multivalued positions.

Returns:
The absolute positions

getSCOMutableMemberPositions

public int[] getSCOMutableMemberPositions()
Accessor for the absolute positions of the second class mutable fields/properties.

Returns:
The field numbers of the second class mutable fields (inc superclasses).

getSCONonContainerMemberPositions

public int[] getSCONonContainerMemberPositions()
Accessor for the absolute positions of all SCO fields/properties that are NOT containers (e.g Dates, Points, etc)

Returns:
Field numbers of all SCO non-container fields/properties

getSCOContainerMemberPositions

public int[] getSCOContainerMemberPositions()
Accessor for the absolute positions of all SCO fields/properties that are containers.

Returns:
Positions of all SCO container fields/properties.

getSCOMutableMemberFlags

public boolean[] getSCOMutableMemberFlags()
Accessor for the flags of the SCO mutable fields (inc superclass fields).

Returns:
The flags whether the field is second class mutable

hasRelations

public boolean hasRelations(ClassLoaderResolver clr,
                            MetaDataManager mmgr)
Convenience method to return if the class has relations to other objects. Includes superclasses.

Returns:
Whether the class has any relations (that it knows about)

getRelationMemberPositions

public int[] getRelationMemberPositions(ClassLoaderResolver clr,
                                        MetaDataManager mmgr)
Convenience method to return the absolute positions of all fields/properties that have relations.

Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager
Returns:
The absolute positions of all fields/properties that have relations

getBidirectionalRelationMemberPositions

public int[] getBidirectionalRelationMemberPositions(ClassLoaderResolver clr,
                                                     MetaDataManager mmgr)
Convenience method to return the absolute positions of fields/properties that have bidirectional relations.

Parameters:
clr - ClassLoader resolver
mmgr - MetaData manager
Returns:
Absolute positions of bidirectional relation fields/properties

setSerializeRead

public void setSerializeRead(boolean serialise)

setMetaDataComplete

public void setMetaDataComplete()
Method to set that this class is "metadata complete" (see JPA spec). Means that any annotations will be ignored.


addQuery

public void addQuery(QueryMetaData qmd)
Method to add a named query to this class. Rejects the addition of duplicate named queries.

Parameters:
qmd - Meta-Data for the query.

newQueryMetadata

public QueryMetaData newQueryMetadata(java.lang.String queryName)
Method to create a new QueryMetadata, add it to the registered queries and return it.

Parameters:
queryName - Name of the query
Returns:
The Query metadata

addQueryResultMetaData

public void addQueryResultMetaData(QueryResultMetaData resultMetaData)
Method to register a query-result MetaData.

Parameters:
resultMetaData - Query-Result MetaData to register

addIndex

public void addIndex(IndexMetaData idxmd)
Method to add an index to this class.

Parameters:
idxmd - Meta-Data for the index.

newIndexMetadata

public IndexMetaData newIndexMetadata()
Method to create a new index metadata, add it, and return it.

Returns:
The index metadata

addForeignKey

public void addForeignKey(ForeignKeyMetaData fkmd)
Method to add an foreign-key to this class.

Parameters:
fkmd - Meta-Data for the foreign-key.

newForeignKeyMetadata

public ForeignKeyMetaData newForeignKeyMetadata()
Method to create a new FK metadata, add it, and return it.

Returns:
The FK metadata

addUniqueConstraint

public void addUniqueConstraint(UniqueMetaData unimd)
Method to add a unique constraint to this class.

Parameters:
unimd - Meta-Data for the unique constraint.

newUniqueMetadata

public UniqueMetaData newUniqueMetadata()
Method to create a new unique metadata, add it, and return it.

Returns:
The unique metadata

addUnmappedColumn

public final void addUnmappedColumn(ColumnMetaData colmd)
Method to add an unmapped column.

Parameters:
colmd - The metadata for the unmapped column

newUnmappedColumnMetaData

public ColumnMetaData newUnmappedColumnMetaData()

newFieldMetadata

public FieldMetaData newFieldMetadata(java.lang.String fieldName)
Method to create a new field metadata, add it, and return it.

Parameters:
fieldName - Name of the field
Returns:
The metadata

newPropertyMetadata

public PropertyMetaData newPropertyMetadata(java.lang.String propName)
Method to create a new property metadata, add it, and return it.

Parameters:
propName - Name of the property
Returns:
The metadata

addMember

public void addMember(AbstractMemberMetaData mmd)
Method to add a field/property to this interface. Rejects the addition of duplicate named fields/properties.

Parameters:
mmd - Field/Property MetaData

addFetchGroup

public void addFetchGroup(FetchGroupMetaData fgmd)
Method to add a fetch-group to this class.

Parameters:
fgmd - Meta-Data for the fetch-group.

newFetchGroupMetaData

public FetchGroupMetaData newFetchGroupMetaData(java.lang.String name)
Method to create a new fetchgroup metadata, add it, and return it.

Parameters:
name - Name of the group
Returns:
The fetchgroup metadata

addJoin

public void addJoin(JoinMetaData jnmd)
Method to add a join to this class. Rejects the addition of duplicate named fields.

Parameters:
jnmd - Meta-Data for the join.

newJoinMetaData

public JoinMetaData newJoinMetaData()
Method to create a new join metadata, add it, and return it.

Returns:
The join metadata

addListener

public void addListener(EventListenerMetaData listener)
Add a listener class name

Parameters:
listener - the listener metadata. Duplicated classes are ignored

getListenerForClass

public EventListenerMetaData getListenerForClass(java.lang.String className)
Accessor for the EventListener info for an EventListener class name

Parameters:
className - Name of the event listener class
Returns:
EventListener info for this class (or null if the class isnt an EventListener)

getListeners

public java.util.List getListeners()
Get the event listeners

Returns:
the event listeners

excludeSuperClassListeners

public void excludeSuperClassListeners()
Toogle exclude super class listeners


isExcludeSuperClassListeners

public boolean isExcludeSuperClassListeners()
Whether super classes listeners are not going to be invoked

Returns:
true if super class listeners are not invoked

excludeDefaultListeners

public void excludeDefaultListeners()
Method to exclude default listeners.


isExcludeDefaultListeners

public boolean isExcludeDefaultListeners()
Whether default listeners are not going to be invoked

Returns:
true if default listeners are not invoked

setVersionMetaData

public final void setVersionMetaData(VersionMetaData versionMetaData)
Mutator for the Version MetaData.

Parameters:
versionMetaData - The versionMetaData to set.

newVersionMetadata

public VersionMetaData newVersionMetadata()
Method to create a new version metadata, set to use it, and return it.

Returns:
The version metadata

setIdentityMetaData

public final void setIdentityMetaData(IdentityMetaData identityMetaData)
Mutator for the identity MetaData.

Parameters:
identityMetaData - The identityMetaData to set.

newIdentityMetadata

public IdentityMetaData newIdentityMetadata()
Method to create a new identity metadata, set to use it, and return it.

Returns:
The identity metadata

setInheritanceMetaData

public final void setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
Mutator for the inheritance MetaData.

Parameters:
inheritanceMetaData - The inheritanceMetaData to set.

newInheritanceMetadata

public InheritanceMetaData newInheritanceMetadata()
Method to create a new inheritance metadata, set to use it, and return it.

Returns:
The inheritance metadata

setPrimaryKeyMetaData

public final void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
Mutator for the PrimaryKey MetaData.

Parameters:
primaryKeyMetaData - The PrimaryKey MetaData to set.

newPrimaryKeyMetadata

public PrimaryKeyMetaData newPrimaryKeyMetadata()
Method to create a new primary key metadata, set to use it, and return it.

Returns:
The primary key metadata

hasFetchGroupWithPostLoad

public final boolean hasFetchGroupWithPostLoad()
Whether this class or any super class has any fetch group definition with FetchGroupMetaData.getPostLoad()==true.

Returns:
Whether there is a fetch-group definition with post-load


Copyright © 2010. All Rights Reserved.