org.jpox.metadata
Class AbstractClassMetaData

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

public abstract class AbstractClassMetaData
extends ExtendableMetaData

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.

Since:
1.1
Version:
$Revision: 1.49.2.2 $
See Also:
Serialized Form

Field Summary
protected  int[] allFieldNumbers
          Field numbers of all fields (inc superclasses).
protected  java.util.Map callbacks
          Callbacks method names keyed by callback callback type
protected  java.lang.String catalog
          Catalog name (O/R mapping).
protected  boolean[] defaultFetchGroupFieldFlags
          Flags of the default fetch group state for all fields.
protected  int[] defaultFetchGroupFieldNumbers
          Field numbers of the default fetch group fields (inc superclasses).
protected  boolean detachable
          detachable tag value.
protected  boolean embeddedOnly
          embedded-only tag value.
protected  java.lang.String entityName
          Entity name.
protected  boolean excludeDefaultListeners
          Flag to exclude default listeners.
protected  boolean excludeSuperClassListeners
          Flag to exclude superclass listeners.
protected  FetchGroupMetaData[] fetchGroupMetaData
          A contained fetch-group element indicates that the named group is to be included in the group being defined.
protected  java.util.Map fetchGroupMetaDataByName
           
protected  java.util.List fetchGroups
          List of fetch-group
protected  java.util.Map fieldNumbersByName
          Field numbers mapped by the name of the field.
protected  ForeignKeyMetaData[] foreignKeyMetaData
          ForeignKeyMetaData
protected  java.util.List foreignKeys
          List of foreign-key
protected  java.lang.String fullName
          Full name.
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  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 listenerClassNames
          Listener classes names.
protected static Localiser LOCALISER_API
           
protected  AbstractPropertyMetaData[] managedFields
          JDO managed fields.
protected  java.lang.String name
          Class name
protected  boolean[] nonPrimaryKeyFieldFlags
          Field numbers of the non-primary key fields (inc superclasses).
protected  int[] nonPrimaryKeyFieldNumbers
          Field numbers of the non-primary key fields (inc superclasses).
protected  int noOfInheritedManagedFields
          No of managed fields in superclasses, that are inherited by this class.
protected  java.lang.String objectidClass
          objectid-class tag value.
protected  AbstractPropertyMetaData[] overriddenFields
          Fields for superclasse sthat are overridden in this class.
protected  AbstractClassMetaData pcSuperclassMetaData
          Class MetaData for the Persistence-Capable superclass (if any)
protected  int[] persistenceCapableFieldNumbers
          Field numbers of the PersistenceCapable fields (inc superclasses).
protected  java.lang.String persistenceCapableSuperclass
          persistence-capable-superclas tag value.
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[] primaryKeyFieldNumbers
          Field numbers of the primary key fields (inc superclasses).
protected  PrimaryKeyMetaData primaryKeyMetaData
          PrimaryKey MetaData
protected  java.util.List properties
          List of properties
protected  java.util.Collection queries
          Named queries
protected  boolean requiresExtent
          requires-extent tag value.
protected  java.lang.String schema
          Schema name (O/R mapping).
protected  int[] secondClassContainerFieldNumbers
          Field numbers of all SCO fields that are containers.
protected  boolean[] secondClassMutableFieldFlags
          Flags of the second class mutable state for all fields.
protected  int[] secondClassMutableFieldNumbers
          Field numbers of the second class mutable fields (inc superclasses).
protected  int[] secondClassNonContainerFieldNumbers
          Field numbers of all SCO fields that arent 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.jpox.metadata.ExtendableMetaData
extensions, JPOX_VENDOR_NAME
 
Fields inherited from class org.jpox.metadata.MetaData
LOCALISER, METADATA_CREATED_STATE, METADATA_INITIALISED_STATE, METADATA_POPULATED_STATE, METADATA_USED_STATE, metaDataState, parent
 
Constructor Summary
  AbstractClassMetaData(InterfaceMetaData imd, java.lang.String implClassName, boolean copyFields)
          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 addCallback(java.lang.String callbackClassName, java.lang.String methodName)
          Add a method callback
 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(java.lang.String listenerClassName)
          Add a listener class name
protected  void addPropertiesNotInMetaData(java.lang.Class cls)
          Add PropertyMetaData of properties not declared in MetaData
 void addProperty(AbstractPropertyMetaData pmd)
          Method to add a property (field) to this interface.
 void addQuery(QueryMetaData qmd)
          Method to add a named query to this class.
 void addUniqueConstraint(UniqueMetaData unimd)
          Method to add a unique constraint to this class.
 void addUnmappedColumn(ColumnMetaData colmd)
          Method to add an unmapped column.
protected  void 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 copyFieldsFromInterface(InterfaceMetaData imd)
          Convenience method to copy the fields 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 to match the JDO 2 spec
protected  void determineObjectIdClass(ClassLoaderResolver clr)
          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 getAbsoluteFieldNumberForRelativeFieldNumber(int relativeFieldNo)
          Accessor for the Absolute field number for a relative field number
 int[] getAllFieldNumbers()
          Accessor for all field numbers.
 AbstractClassMetaData getBaseAbstractClassMetaData()
          Convenience accessor for the AbstractClassMetaData of the base object in this hierarchy.
 java.lang.String getCallback(java.lang.String callbackClassName)
          Get the callback method name for a given callback class name
 java.lang.String getCatalog()
          Accessor for the catalog name.
 boolean[] getDefaultFetchGroupFieldFlags()
          Accessor for the flags of the default fetch group fields (inc superclass fields).
 int[] getDefaultFetchGroupFieldNumbers()
          Accessor for the absolute field numbers of the default fetch group fields (inc superclasses).
 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.
 AbstractPropertyMetaData getField(int index)
          Accessor for the metadata of a field.
 AbstractPropertyMetaData getField(java.lang.String name)
          Accessor for the Meta-Data for a field.
 int getFieldNumber(java.lang.String field_name)
          Accessor for the position of the field with the specified name.
 int getFieldNumberAbsolute(java.lang.String field_name)
          Accessor for the absolute position of the field with the specified name.
 int getFieldNumberAbsolute(java.lang.String class_name, java.lang.String field_name)
          Accessor for the absolute position of the field with the specified name.
 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
 java.util.List getListenerClassNames()
          Get the listener class names
 AbstractPropertyMetaData getManagedField(int position)
          Accessor for a managed field in this class.
 AbstractPropertyMetaData getManagedFieldAbsolute(int abs_position)
          Accessor for a managed field including superclass fields.
protected  AbstractPropertyMetaData getManagedFieldAbsoluteInternal(int abs_position)
          Internal method to get the field for an absolute field number.
 AbstractPropertyMetaData[] getManagedFields()
          Accessor for the managed fields in this class (not including superclass).
 MetaDataManager getMetaDataManager()
          Convenience accessor for the MetaData Manager in use.
 java.lang.String getName()
          Accessor for the class name.
 boolean[] getNonPrimaryKeyFieldFlags()
          Accessor for the flags of the non primary key fields (inc superclass fields).
 int[] getNonPrimaryKeyFieldNumbers()
          Accessor for the field numbers of the non primary key fields (inc superclass fields).
 int getNoOfFields()
          Accessor for the number of fields.
 int getNoOfInheritedManagedFields()
          Accessor for the number of inherited managed fields in superclasses.
 int getNoOfManagedFields()
          Accessor for the number of JDO managed fields.
 int getNoOfOverriddenFields()
          Accessor for the number of JDO overridden fields.
 int getNoOfPrimaryKeyFields()
          Accessor for the number of primary key fields.
 int getNoOfProperties()
          Accessor for the number of properties
 int getNoOfQueries()
          Accessor for the number of named queries.
 java.lang.String getObjectidClass()
          Accessor for the objectid-class tag value.
 AbstractPropertyMetaData getOverriddenField(int position)
          Accessor for an overridden field in this class.
 AbstractPropertyMetaData getOverriddenField(java.lang.String name)
          Accessor for an overridden field with the specified name.
 AbstractPropertyMetaData[] getOverriddenFields()
          Accessor for the overridden fields in this class.
 PackageMetaData getPackageMetaData()
          Convenience accessor for the parent Package MetaData.
 java.lang.String getPackageName()
          Convenience accessor for the package name.
 int[] getPersistenceCapableFieldNumbers()
          Accessor for the absolute field numbers of the PersistenceCapable fields
 java.lang.String getPersistenceCapableSuperclass()
          Accessor for the persistence-capable-superclass tag value.
 ClassPersistenceModifier getPersistenceModifier()
          Accessor for the persistence-modifier
 int[] getPrimaryKeyFieldNumbers()
          Accessor for the field numbers of the primary key fields.
 PrimaryKeyMetaData getPrimaryKeyMetaData()
          Accessor for primaryKeyMetaData
 QueryMetaData[] getQueries()
          Accessor for the metadata of the named queries.
 java.lang.String getSchema()
          Accessor for the schema name.
 int[] getSecondClassContainerFieldNumbers()
          Accessor for the absolute field numbers of all SCO fields that are containers.
 boolean[] getSecondClassMutableFieldFlags()
          Accessor for the flags of the second class mutable fields (inc superclass fields).
 int[] getSecondClassMutableFieldNumbers()
          Accessor for the absolute field numbers of the second class mutable fields
 int[] getSecondClassNonContainerFieldNumbers()
          Accessor for the absolute field numbers of all SCO fields 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 versionMetaData
 boolean hasField(java.lang.String fieldName)
          Method to check if a field exists in this classes definition.
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 object, creating internal convenience arrays.
 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 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
 void mergeORMData(AbstractClassMetaData ormCmd)
          Method to merge in the associated metadata from the ORM definition
protected  AbstractPropertyMetaData 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 setIdentityMetaData(IdentityMetaData identityMetaData)
          Mutator for the identity MetaData.
 void setInheritanceMetaData(InheritanceMetaData inheritanceMetaData)
          Mutator for the inheritance MetaData.
 void setPrimaryKeyMetaData(PrimaryKeyMetaData primaryKeyMetaData)
          Mutator for the PrimaryKey MetaData.
 void setTable(java.lang.String table_name)
          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 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.jpox.metadata.ExtendableMetaData
addExtension, addExtension, getExtension, getExtensions, getNoOfExtensions, getValueForExtension, getValuesForExtension, getValuesForExtensionStartingWith, hasExtension, removeExtension, toString, toString
 
Methods inherited from class org.jpox.metadata.MetaData
getParent, isCreated, isInitialised, isPopulated, isUsed, populate, setInitialised, setPopulated, setUsed
 
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

queries

protected java.util.Collection queries
Named queries


joinMetaData

protected JoinMetaData[] joinMetaData
JoinMetaData


indexMetaData

protected IndexMetaData[] indexMetaData
IndexMetaData


foreignKeyMetaData

protected ForeignKeyMetaData[] foreignKeyMetaData
ForeignKeyMetaData


uniqueMetaData

protected UniqueMetaData[] uniqueMetaData
UniqueMetaData


identityType

protected IdentityType identityType
Identity-type tag value.


name

protected final java.lang.String name
Class name


entityName

protected final java.lang.String entityName
Entity name. Required by JPA § 4.3.1


persistenceModifier

protected ClassPersistenceModifier persistenceModifier
persistence-modifier tag value.


persistenceCapableSuperclass

protected java.lang.String persistenceCapableSuperclass
persistence-capable-superclas tag value.


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"


fullName

protected final java.lang.String fullName
Full name. (e.g org.jpox.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


properties

protected java.util.List properties
List of properties


unmappedColumns

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


callbacks

protected java.util.Map callbacks
Callbacks method names keyed by callback callback type


listenerClassNames

protected java.util.List listenerClassNames
Listener classes names. Use a list to preserve ordering.


excludeSuperClassListeners

protected boolean excludeSuperClassListeners
Flag to exclude superclass listeners.


excludeDefaultListeners

protected boolean excludeDefaultListeners
Flag to exclude default listeners.


joins

protected java.util.List joins
List of joins


fetchGroups

protected java.util.List fetchGroups
List of fetch-group


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


fetchGroupMetaData

protected FetchGroupMetaData[] fetchGroupMetaData
A contained fetch-group element indicates that the named group is to be included in the group being defined. Nested fetch group elements are limited to only the name attribute.


fetchGroupMetaDataByName

protected java.util.Map fetchGroupMetaDataByName

pcSuperclassMetaData

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


managedFields

protected AbstractPropertyMetaData[] managedFields
JDO managed fields. Contains the same AbstractPropertyMetaData objects as are in "fields".


overriddenFields

protected AbstractPropertyMetaData[] overriddenFields
Fields for superclasse sthat are overridden in this class.


fieldNumbersByName

protected java.util.Map fieldNumbersByName
Field numbers mapped by the name of the field.


allFieldNumbers

protected int[] allFieldNumbers
Field numbers of all fields (inc superclasses).


primaryKeyFieldNumbers

protected int[] primaryKeyFieldNumbers
Field numbers of the primary key fields (inc superclasses).


nonPrimaryKeyFieldNumbers

protected int[] nonPrimaryKeyFieldNumbers
Field numbers of the non-primary key fields (inc superclasses).


nonPrimaryKeyFieldFlags

protected boolean[] nonPrimaryKeyFieldFlags
Field numbers of the non-primary key fields (inc superclasses).


defaultFetchGroupFieldNumbers

protected int[] defaultFetchGroupFieldNumbers
Field numbers of the default fetch group fields (inc superclasses).


defaultFetchGroupFieldFlags

protected boolean[] defaultFetchGroupFieldFlags
Flags of the default fetch group state for all fields.


secondClassMutableFieldNumbers

protected int[] secondClassMutableFieldNumbers
Field numbers of the second class mutable fields (inc superclasses).


secondClassMutableFieldFlags

protected boolean[] secondClassMutableFieldFlags
Flags of the second class mutable state for all fields.


persistenceCapableFieldNumbers

protected int[] persistenceCapableFieldNumbers
Field numbers of the PersistenceCapable fields (inc superclasses).


noOfInheritedManagedFields

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


usesSingleFieldIdentityClass

protected boolean usesSingleFieldIdentityClass
if this PersistenceCapable class uses SingleFieldIdentity


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.


secondClassNonContainerFieldNumbers

protected int[] secondClassNonContainerFieldNumbers
Field numbers of all SCO fields that arent containers.


secondClassContainerFieldNumbers

protected int[] secondClassContainerFieldNumbers
Field numbers of all SCO fields 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 the 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 - RDBMS 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 copyFields)
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
copyFields - Whether to copy the fields of the interface too
Method Detail

copyFieldsFromInterface

protected void copyFieldsFromInterface(InterfaceMetaData imd)
Convenience method to copy the fields from an existing interface

Parameters:
imd - The class/interface that we copy from

checkInitialised

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

Throws:
javax.jdo.JDOFatalInternalException - Thrown if the Meta-Data hasn't been initialised.

checkPopulated

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

Throws:
javax.jdo.JDOFatalInternalException - 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


addPropertiesNotInMetaData

protected void addPropertiesNotInMetaData(java.lang.Class cls)
Add PropertyMetaData of properties not declared in MetaData

Parameters:
cls - This class

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 AbstractPropertyMetaData 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 (e.g JDOConfigClass can create a JDOConfigField)

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

mergeORMData

public void mergeORMData(AbstractClassMetaData ormCmd)
Method to merge in the associated metadata from the ORM definition

Parameters:
ormCmd - The ORM Class definition

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

getSuperAbstractClassMetaData

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

Returns:
MetaData of the superclass

getDiscriminatorStrategy

public final DiscriminatorStrategy getDiscriminatorStrategy()
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

determineObjectIdClass

protected void determineObjectIdClass(ClassLoaderResolver clr)
Determine the object id class

Parameters:
clr - the ClassLoader
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

populate

public abstract void populate(ClassLoaderResolver clr,
                              java.lang.ClassLoader primary)
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)

initialise

public abstract void initialise()
Method to initialise the object, creating internal convenience arrays. Initialises all sub-objects. If populate() is going to be used it should be used BEFORE calling this method. Subclasses must implement this method.

Overrides:
initialise in class MetaData

determineInheritanceMetaData

protected void determineInheritanceMetaData()
Impose a default inheritance strategy to match the JDO 2 spec


validateDeprecatedMetaData

protected void validateDeprecatedMetaData()
Check usage of deprecated MetaData

Throws:
InvalidMetaDataException - if deprecated MetaData is used

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.

getVersionMetaData

public final VersionMetaData getVersionMetaData()
Accessor for versionMetaData

Returns:
Returns the versionMetaData.

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.

getFullClassName

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

Returns:
full class name.

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

getIdentityType

public IdentityType getIdentityType()
Accessor for the identity-type.

Returns:
identity-type tag value

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

getNoOfProperties

public int getNoOfProperties()
Accessor for the number of properties

Returns:
no of properties

getName

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

Returns:
class name

getEntityName

public java.lang.String getEntityName()
Accessor for the class name.

Returns:
class name

getObjectidClass

public java.lang.String getObjectidClass()
Accessor for the objectid-class tag value.

Returns:
the fully qualified objectid class name

getCatalog

public java.lang.String getCatalog()
Accessor for the catalog name.

Returns:
catalog name

getSchema

public java.lang.String getSchema()
Accessor for the schema name.

Returns:
schema name

getTable

public java.lang.String getTable()
Accessor for the table name.

Returns:
table name

isRequiresExtent

public boolean isRequiresExtent()
Accessor for the requires-extent tag value.

Returns:
requires-extent tag value

isDetachable

public boolean isDetachable()
Accessor for the detachable tag value.

Returns:
detachable tag value

isEmbeddedOnly

public boolean isEmbeddedOnly()
Accessor for the embedded-only tag value.

Returns:
embedded-only tag value

getIdentityMetaData

public final IdentityMetaData getIdentityMetaData()
Accessor for identityMetaData

Returns:
Returns the identityMetaData.

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.

getMetaDataManager

public MetaDataManager getMetaDataManager()
Convenience accessor for the MetaData Manager in use.

Returns:
MetaDataManager.

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.

getNoOfFields

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

Returns:
no of fields

getField

public AbstractPropertyMetaData getField(int index)
Accessor for the metadata of a field. Does not include superclasses

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

getPersistenceModifier

public ClassPersistenceModifier getPersistenceModifier()
Accessor for the persistence-modifier

Returns:
persistence-modifier tag value

getPersistenceCapableSuperclass

public java.lang.String getPersistenceCapableSuperclass()
Accessor for the persistence-capable-superclass tag value.

Returns:
persistence-capable-superclass tag value

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

getFetchGroupMetaData

public FetchGroupMetaData getFetchGroupMetaData(java.lang.String groupname)
Accessor for the fetch group metadata for the group specified. Overrides the version in AbstractClassMetaData so that we can allow for superclasses.

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

hasField

public boolean hasField(java.lang.String fieldName)
Method to check if a field exists in this classes definition.

Parameters:
fieldName - Nme of field
Returns:
return true if exists.

getField

public AbstractPropertyMetaData getField(java.lang.String name)
Accessor for the Meta-Data for a field. Include superclasses

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

getNoOfManagedFields

public int getNoOfManagedFields()
Accessor for the number of JDO managed fields. The number of fields is for this class only.

Returns:
no of JDO managed fields in this class

getManagedFields

public