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 fetchGroupMetaDataByName
          Convenience lookup map of fetch group by the name.
protected  java.util.List fetchGroups
          List of fetch-group
protected  ForeignKeyMetaData[] foreignKeyMetaData
          ForeignKeyMetaData
protected  java.util.List foreignKeys
          List of foreign-key
protected  java.lang.String fullName
          Full name (e.g org.datanucleus.MyClass)
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 indexes
          List of indexes
protected  IndexMetaData[] indexMetaData
          IndexMetaData
protected  InheritanceMetaData inheritanceMetaData
          Inheritance MetaData
protected  JoinMetaData[] joinMetaData
          JoinMetaData
protected  java.util.List 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 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 Persistence-Capable 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 queries
          Named queries
protected  java.util.Collection 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  java.lang.String table
          Table name (O/R mapping).
protected  java.util.List uniqueConstraints
          List of uniqueConstraints
protected  UniqueMetaData[] uniqueMetaData
          UniqueMetaData
protected  java.util.List 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, java.lang.String identityType, java.lang.String objectidClass, java.lang.String requiresExtent, java.lang.String detachable, java.lang.String embeddedOnly, java.lang.String modifier, java.lang.String persistenceCapableSuperclass, java.lang.String catalog, java.lang.String schema, java.lang.String table, java.lang.String entityName)
          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 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()
          Impose a default inheritance strategy when one is not already specified.
protected  void determineObjectIdClass()
          Determine the object id class.
protected  void determineSuperClassName(ClassLoaderResolver clr, java.lang.Class cls)
          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.
 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.
 java.lang.String getCatalog()
          Accessor for the catalog name.
 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 getDiscriminatorMetaDataForTable()
          Convenience method to find the discriminator MetaData defining the discrim for the same table as this class is using.
 DiscriminatorStrategy getDiscriminatorStrategy()
          Convenience accessor for the discriminator strategy applying to this class.
 java.lang.String getEntityName()
          Accessor for the class name.
 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.
 IdentityMetaData getIdentityMetaData()
          Accessor for identityMetaData
 IdentityType getIdentityType()
          Accessor for the identity-type.
 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.
 MetaDataManager getMetaDataManager()
          Convenience accessor for the MetaData Manager in use.
 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 class 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()
          Accessor for the objectid-class tag value.
 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()
          Accessor for the persistence-capable-superclass tag value.
 ClassPersistenceModifier getPersistenceModifier()
          Accessor for the persistence-modifier of the class.
 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)
          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()
          Accessor for the schema name.
 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()
          Accessor for the table name.
 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()
           
 boolean hasMember(java.lang.String memberName)
          Method to check if a field/property exists in this classes definition.
 boolean hasRelations(ClassLoaderResolver clr)
          Convenience method to return if the class has relations to other objects.
 boolean hasVersionStrategy()
           
protected  void inheritDetachableSettings()
          Inherit detach settings from super classes.
protected  void inheritIdentity()
          Inherit the identity definition from super classes.
abstract  void initialise()
          Method to initialise the sub-objects of this class metadata.
protected  void initialiseMemberPositionInformation()
          Method to initialise all convenience information about member positions and what role each position performs.
 boolean isCacheable()
          Accessor for the cacheable tag value.
 boolean isDetachable()
          Accessor for the detachable tag value.
 boolean isEmbeddedOnly()
          Accessor for the embedded-only tag value.
 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()
          Accessor for the requires-extent tag value.
 boolean isSameOrAncestorOf(AbstractClassMetaData cmd)
          Check if the argument cmd is the same as this or a descedent.
protected  java.lang.Class loadClass(ClassLoaderResolver clr, java.lang.ClassLoader primary)
          Load the persistent interface/class
protected  AbstractMemberMetaData newDefaultedProperty(java.lang.String name)
          Utility to add a defaulted PropertyMetaData to the class.
abstract  void populate(ClassLoaderResolver clr, java.lang.ClassLoader primary)
          Method to provide the details of the class being represented by this MetaData.
 void setCacheable(boolean cache)
          Convenience method to set the cacheability of this class.
 void setCatalog(java.lang.String catalog)
          Mutator for the catalog name.
 void setEmbeddedOnly()
          Convenience method to make this class available for storing only when embedded in another object.
 void setIdentityMetaData(IdentityMetaData identityMetaData)
          Mutator for the identity MetaData.
 void setIdentityType(IdentityType type)
          Cinvenience method for updating the identity type when not set correctly during construction.
 void setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
          Mutator for the inheritance MetaData.
 void setMetaDataComplete()
          Method to set that this class is "metadata complete" (see JPA spec).
 void setObjectIdClass(java.lang.String objectidClass)
          Mutator for the object id class name.
 void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
          Mutator for the PrimaryKey MetaData.
 void setSchema(java.lang.String schema)
          Mutator for the schema name.
 void setTable(java.lang.String table)
          Mutator for the table name.
 void setVersionMetaData(VersionMetaData versionMetaData)
          Mutator for the Version MetaData.
 boolean usesSingleFieldIdentityClass()
          Whether this PersistenceCapable class uses SingleFieldIdentity
protected  void validateDeprecatedMetaData()
          Check usage of deprecated MetaData
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()
          Check if the inheritance MetaData is credible.
 
Methods inherited from class org.datanucleus.metadata.MetaData
addExtension, addExtension, getExtensions, getNoOfExtensions, getParent, getValueForExtension, getValuesForExtension, hasExtension, isInitialised, isPopulated, isUsed, removeExtension, setInitialised, setParent, setPopulated, setUsed, 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

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 fetchGroupMetaDataByName
Convenience lookup map of fetch group by the name.


pcSuperclassMetaData

protected AbstractClassMetaData pcSuperclassMetaData
Class MetaData for the Persistence-Capable superclass (if any)


metaDataComplete

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


queries

protected java.util.Collection queries
Named queries


queryResultMetaData

protected java.util.Collection 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 unmappedColumns
The columns that are present in the datastore yet not mapped to fields in this class.


joins

protected java.util.List joins
List of joins


foreignKeys

protected java.util.List foreignKeys
List of foreign-key


indexes

protected java.util.List indexes
List of indexes


uniqueConstraints

protected java.util.List uniqueConstraints
List of uniqueConstraints


fetchGroups

protected java.util.List 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 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

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,
                                java.lang.String identityType,
                                java.lang.String objectidClass,
                                java.lang.String requiresExtent,
                                java.lang.String detachable,
                                java.lang.String embeddedOnly,
                                java.lang.String modifier,
                                java.lang.String persistenceCapableSuperclass,
                                java.lang.String catalog,
                                java.lang.String schema,
                                java.lang.String table,
                                java.lang.String entityName)
Constructor. Takes the basic string information found in an XML MetaData file.

Parameters:
parent - The package to which this class/interface belongs
name - Name of class
identityType - identity-type flag
objectidClass - Primary key class name
requiresExtent - Whether the class requires an extent
detachable - Whether the class can be detached
embeddedOnly - embedded-only tag
modifier - persistence-modifier tag
catalog - The catalog name default for this class
schema - The schema name default for this class
table - table to store the class in
entityName - the entity name required by JPA §4.3.1

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:
JDOFatalInternalException - 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)
Load the persistent interface/class

Parameters:
clr - the ClassLoader
primary - the primary ClassLoader to use (or null)
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)
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
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 super class 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.

inheritDetachableSettings

protected void inheritDetachableSettings()
Inherit detach settings from super classes. This class is forced to be detachable if the super classes is.


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 discrimi