org.apache.ojb.broker.metadata
Class ClassDescriptor

java.lang.Object
  extended by org.apache.ojb.broker.metadata.DescriptorBase
      extended by org.apache.ojb.broker.metadata.ClassDescriptor
All Implemented Interfaces:
Serializable, IsolationLevels, AttributeContainer, RepositoryElements, XmlCapable

public final class ClassDescriptor
extends DescriptorBase
implements Serializable, XmlCapable, IsolationLevels

A ClassDescriptor contains all information for mapping objects of a given class to database tables.
Note: Be careful when use ClassDescriptor variables or caching ClassDescriptor instances, because instances could become invalid during runtime (see MetadataManager).

Version:
$Id: ClassDescriptor.java,v 1.1 2007-08-24 22:17:29 ewestfal Exp $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
private  boolean acceptLocks
          if false do not accept implicit locks on this class
private  boolean alreadyLookedupZeroArguments
          whether we have already tried to look up the zero argument constructor.
private  boolean alwaysRefresh
          if true instances of this class are always refreshed even if they are already in the cache.
private  String baseClass
           
private  DeleteProcedureDescriptor deleteProcedure
          The descriptor for the delete procedure/function.
static String DYNAMIC_STR
           
private  Vector extentClasses
          the list of classes in the extent of this class.
private  Vector extentClassNames
          the list of class names in the extent of this class.
private  Class factoryClass
          optional class.method to be invoked to create object instance.
private  Method factoryMethod
           
private  String factoryMethodName
           
private  Vector indexes
          the vector of indices used in DDL generation.
private  Method initializationMethod
          optional method to be invoked after instance fields are initialized
private  String initializationMethodName
           
private  InsertProcedureDescriptor insertProcedure
          The descriptor for the insert procedure/function.
private  boolean isAbstract
          whether the described class is abstract
private  FieldDescriptor m_autoIncrementField
           
private  Class m_Class
          the described class
private  Map m_collectionDescriptorNameMap
           
private  Vector m_CollectionDescriptors
          the descriptors for collection attributes
private  FieldDescriptor[] m_FieldDescriptions
          the FieldDescriptors for the primitive attributes
private  Map m_fieldDescriptorNameMap
           
private  boolean m_isInterface
          does the described class represent an interface?
private  int m_IsolationLevel
          transaction isolation level specified for this class, used in the ODMG server
private  FieldDescriptor[] m_lockingFieldDescriptors
          the optimistic lockingFieldDescriptors BRJ
private  FieldDescriptor[] m_nonPkFieldDescriptors
          the non-primary key FieldDescriptors
private  Vector m_ObjectReferenceDescriptors
          the descriptor for 1-1 reference attributes
private  Map m_objectReferenceDescriptorsNameMap
           
private  FieldDescriptor[] m_PkFieldDescriptors
          the primary key FieldDescriptors
private  int m_ProxyPrefetchingLimit
           
private  DescriptorRepository m_repository
           
private  RowReader m_rowReader
          the RowReader for this class
private  FieldDescriptor[] m_RwFieldDescriptors
          the read/write FieldDescriptors BRJ
private  FieldDescriptor[] m_RwNonPkFieldDescriptors
           
private  ClassDescriptor m_superCld
           
private  boolean m_superCldSet
           
private  String m_TableName
          the table name used to store the scalar attributes of this class
private static Class[] NO_PARAMS
           
private  ObjectCacheDescriptor objectCacheDescriptor
          optional, ObjectCacheDescriptor for representing class
static String OJB_CONCRETE_CLASS
           
private  FieldDescriptor ojbConcreteClassField
           
private  boolean ojbConcreteFieldCheckDone
          used to signal use of ojbConcreteClass field
private  String persistentFieldClassName
           
private  Class proxyClass
          the proxy class for the described class, may be null
private  String proxyClassName
          the proxy class name for the described class, may be null
private  String schema
          the SQL SCHEMA of the underlying table of this class
private static long serialVersionUID
           
private  StatementsForClassIF statementsForClass
          We have to bound StatementsForClassIF instance to this class, because metadata may change.
private  String superClass
          the class that this class extends
private  int superClassFieldRef
          reference column for the superclass
private  UpdateProcedureDescriptor updateProcedure
          The descriptor for the update procedure/function.
private  int useIdentityColumn
           
private  Constructor zeroArgumentConstructor
          the zero argument constructor for this class
 
Fields inherited from interface org.apache.ojb.broker.metadata.RepositoryElements
_NEXT, ACCEPT_LOCKS, ACCESS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, CASCADE_LINK_STR, CASCADE_NONE_STR, CASCADE_OBJECT_STR, CLASS_DESCRIPTOR, CLASS_EXTENT, CLASS_NAME, CLASS_PROXY, CLASS_REF, COLLECTION_CLASS, COLLECTION_DESCRIPTOR, COLUMN_NAME, CON_LOG_ABANDONED, CON_MAX_ACTIVE, CON_MAX_IDLE, CON_MAX_WAIT, CON_MIN_EVICTABLE_IDLE_TIME_MILLIS, CON_NUM_TESTS_PER_EVICTION_RUN, CON_REMOVE_ABANDONED, CON_REMOVE_ABANDONED_TIMEOUT, CON_TEST_ON_BORROW, CON_TEST_ON_RETURN, CON_TEST_WHILE_IDLE, CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS, CON_WHEN_EXHAUSTED_ACTION, CONNECTION_FACTORY, CONNECTION_POOL, CONSTANT_ARGUMENT, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DELETE_PROCEDURE, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, FACTORY_CLASS, FACTORY_METHOD, FIELD_CONVERSION, FIELD_DESCRIPTOR, FIELD_ID_REF, FIELD_NAME, FIELD_REF, FK_POINTING_TO_ITEMS_CLASS, FK_POINTING_TO_THIS_CLASS, FOREIGN_KEY, ID, IGNORE_AUTOCOMMIT_EXCEPTION, INCLUDE_ALL_FIELDS, INCLUDE_PK_FIELDS_ONLY, INDEX_COLUMN, INDEX_DESCRIPTOR, INDEXED, INDIRECTION_TABLE, INITIALIZATION_METHOD, INSERT_PROCEDURE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NAME, NULLABLE, OBJECT_CACHE, ORDERBY, OTM_DEPENDENT, PRECISION, PRIMARY_KEY, PROXY_PREFETCHING_LIMIT, PROXY_REFERENCE, QUERY_CUSTOMIZER, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH, REPOSITORY_VERSION, RETURN, RETURN_FIELD_REF, ROW_READER, RUNTIME_ARGUMENT, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, TAG_ACCESS, TAG_ACCESS_ANONYMOUS, TAG_ACCESS_READONLY, TAG_ACCESS_READWRITE, TAG_SUPER, UNIQUE, UPDATE_LOCK, UPDATE_PROCEDURE, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY, VALUE
 
Fields inherited from interface org.apache.ojb.broker.locking.IsolationLevels
IL_DEFAULT, IL_NONE, IL_OPTIMISTIC, IL_READ_COMMITTED, IL_READ_UNCOMMITTED, IL_REPEATABLE_READ, IL_SERIALIZABLE, LITERAL_IL_NONE, LITERAL_IL_OPTIMISTIC, LITERAL_IL_READ_COMMITTED, LITERAL_IL_READ_UNCOMMITTED, LITERAL_IL_REPEATABLE_READ, LITERAL_IL_SERIALIZABLE
 
Constructor Summary
ClassDescriptor(DescriptorRepository pRepository)
          Constructor declaration
 
Method Summary
 void addCollectionDescriptor(CollectionDescriptor cod)
          Add a CollectionDescriptor.
 void addExtentClass(Class newExtendClass)
          add an Extent class to the current descriptor
 void addExtentClass(String newExtentClassName)
          add an Extent class to the current descriptor
 void addExtentClassName(Class newExtendClass)
          Deprecated. use addExtentClass(String newExtentClass) instead
 void addFieldDescriptor(FieldDescriptor fld)
          adds a FIELDDESCRIPTOR to this ClassDescriptor.
 void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
          Add a ObjectReferenceDescriptor.
private  FieldDescriptor[] appendFieldDescriptorArrays(FieldDescriptor[] fieldDescriptions, FieldDescriptor[] fieldDescriptorsInHeirarchy)
           
 FieldDescriptor[] getAllRwFields()
          Returns array of read/write FieldDescriptors.
private  ArrayList getAttributeDescriptorsForCleanPath(String aPath, Map pathHints)
          return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)
 ArrayList getAttributeDescriptorsForPath(String aPath)
          return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)
 ArrayList getAttributeDescriptorsForPath(String aPath, Map pathHints)
          return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)
 FieldDescriptor getAutoIncrementField()
          Deprecated. does not make sense because it's possible to define more than one autoincrement field. Alternative see getAutoIncrementFields()
 FieldDescriptor[] getAutoIncrementFields()
           
 String getBaseClass()
           
 String getClassNameOfObject()
          returns the name of the described class
 Class getClassOfObject()
          returns the class object of the described class
 CollectionDescriptor getCollectionDescriptorByName(String name)
          Get an CollectionDescriptor by name BRJ
private  Map getCollectionDescriptorNameMap()
           
 Vector getCollectionDescriptors()
          Returns all defined CollectionDescriptor for this class descriptor.
 List getCollectionDescriptors(boolean withInherited)
          Returns all defined CollectionDescriptor for this class descriptor.
 ValueContainer[] getCurrentLockingValues(Object o)
          returns an Array with an Objects CURRENT locking VALUES , BRJ
 DeleteProcedureDescriptor getDeleteProcedure()
          Retrieve the descriptor for the delete procedure/function.
 Vector getExtentClasses()
          return all classes in this extent.
 Vector getExtentClassNames()
          Return the names of all classes in this extent
 Class getFactoryClass()
          Return factory class.
 Method getFactoryMethod()
          Return factory method.
 FieldDescriptor[] getFieldDescriptions()
          Returns array of all FieldDescriptors.
 FieldDescriptor[] getFieldDescriptor(boolean withInherited)
          Return an array of all FieldDescriptor for this represented class, if parameter withInherited is true all inherited descriptor of declared super classes are included.
 FieldDescriptor getFieldDescriptorByIndex(int index)
          Returns the matching FieldDescriptor.
 FieldDescriptor getFieldDescriptorByName(String name)
          Returns the matching FieldDescriptor - only fields of the current class will be scanned, to include fields defined the the super-classes too, use method getFieldDescriptor(boolean).
 FieldDescriptor getFieldDescriptorForPath(String aPath)
          return the FieldDescriptor for the Attribute referenced in the path
the path may contain simple attribut names, functions and path expressions using relationships
ie: name, avg(price), adress.street
 FieldDescriptor getFieldDescriptorForPath(String aPath, Map pathHints)
          return the FieldDescriptor for the Attribute referenced in the path
the path may contain simple attribut names, functions and path expressions using relationships
ie: name, avg(price), adress.street
 FieldDescriptor[] getFieldDescriptorNonPk(boolean withInherited)
          Return an array of NON-PK FieldDescriptor, if parameter withInherited is true all inherited descriptor of declared super classes are included.
 FieldDescriptor[] getFieldDescriptorsInHeirarchy()
           
 String getFullTableName()
          Answer Table name including schema BRJ
 Vector getIndexes()
          Gets the IndexDescriptors used for DDL generation.
 Method getInitializationMethod()
          Returns the initialization method for this descriptor or null if no initialization method is defined.
 InsertProcedureDescriptor getInsertProcedure()
          Retrieve the descriptor for the insert procedure/function.
 int getIsolationLevel()
          returns the transaction isolation level to be used for this class.
 FieldDescriptor[] getLockingFields()
          return an array of FieldDescription for optimistic locking sorted ascending according to the field-descriptions getOrder() property
 FieldDescriptor[] getNonPkFields()
          return an array of NONPK-FieldDescription sorted ascending according to the field-descriptions getOrder() property
 FieldDescriptor[] getNonPkRwFields()
          Returns array of read/write non pk FieldDescriptors.
 ObjectCacheDescriptor getObjectCacheDescriptor()
          Returns the appropriate ObjectCacheDescriptor or null if not specified.
 ObjectReferenceDescriptor getObjectReferenceDescriptorByName(String name)
          Get an ObjectReferenceDescriptor by name BRJ
 Vector getObjectReferenceDescriptors()
          Returns all defined ObjectReferenceDescriptor.
 List getObjectReferenceDescriptors(boolean withInherited)
          Returns all defined ObjectReferenceDescriptor.
private  Map getObjectReferenceDescriptorsNameMap()
           
 FieldDescriptor getOjbConcreteClassField()
          Returns the ojbConcreteClass field or null if none defined.
 String getPersistentFieldClassName()
          Get the used PersistentField implementation name.
 FieldDescriptor[] getPkFields()
          Return an array of PK FieldDescription sorted ascending according to the field-descriptions getOrder() property
 Class getProxyClass()
          Insert the method's description here.
 String getProxyClassName()
          Get the name of the proxy class.
 int getProxyPrefetchingLimit()
           
 DescriptorRepository getRepository()
          Gets the repository.
 RowReader getRowReader()
          Returns the RowReader for this descriptor.
 String getRowReaderClassName()
           
 String getSchema()
          Gets the schema.
 StatementsForClassIF getStatementsForClass(ConnectionManagerIF conMan)
           
 String getSuperClass()
          Return the super class or null if not declared in repository file.
 ClassDescriptor getSuperClassDescriptor()
          Answers the ClassDescriptor referenced by 'super' ReferenceDescriptor.
 int getSuperClassFieldRef()
          TODO drop this method?
 SuperReferenceDescriptor getSuperReference()
          Returns the SuperReferenceDescriptor of this class or null if none was used.
private  String getTableName()
          Method declaration
 UpdateProcedureDescriptor getUpdateProcedure()
          Retrieve the descriptor for the update procedure/function.
 Constructor getZeroArgumentConstructor()
          returns the zero argument constructor for the class represented by this class descriptor or null if a zero argument constructor does not exist.
 boolean isAbstract()
           
 boolean isAcceptLocks()
          Returns acceptLocks.
 boolean isAlwaysRefresh()
          if true instances of this class are always refreshed even if they are already in the cache.
 boolean isDynamicProxy()
           
 boolean isExtent()
          Insert the method's description here.
 boolean isInterface()
          Return true, if the described class is an interface.
 boolean isLocking()
          return true if optimistic locking is used
private  String isolationLevelXml()
           
 void removeCollectionDescriptor(CollectionDescriptor cod)
           
 void removeExtentClass(String extentClassName)
           
 boolean removeFieldDescriptor(FieldDescriptor fld)
           
 void removeObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
           
 void setAcceptLocks(boolean acceptLocks)
          Sets acceptLocks.
 void setAlwaysRefresh(boolean alwaysRefresh)
          Sets the alwaysRefresh parameter.
 void setBaseClass(String baseClass)
           
 void setClassOfObject(Class c)
          sets the class object described by this descriptor.
 void setDeleteProcedure(DeleteProcedureDescriptor newValue)
          Change the descriptor for the delete procedure/function.
 void setFactoryClass(Class newClass)
          Set the object factory for class described by this descriptor.
 void setFactoryClass(String newClass)
           
private  void setFactoryMethod(Method newMethod)
          Specify the method to instantiate objects represented by this descriptor.
 void setFactoryMethod(String factoryMethodName)
          sets the initialization method for this descriptor by name
 void setIndexes(Vector indexes)
          Sets the IndexDescriptors used for DDL generation.
private  void setInitializationMethod(Method newMethod)
          sets the initialization method for this descriptor
 void setInitializationMethod(String newMethodName)
          sets the initialization method for this descriptor by name
 void setInsertProcedure(InsertProcedureDescriptor newValue)
          Change the descriptor for the insert procedure/function.
 void setIsInterface(boolean newIsInterface)
          Set true if described class is a interface.
 void setIsolationLevel(int isoLevel)
          Method declaration
 void setObjectCacheDescriptor(ObjectCacheDescriptor objectCacheDescriptor)
          Sets the ObjectCacheDescriptor for representing class.
 void setPersistentFieldClassName(String pfClassName)
          Optional! Set the PersistentField implementation class used by this class.
 void setProxyClass(Class newProxyClass)
          Sets the proxy class to be used.
 void setProxyClassName(String newProxyClassName)
          Sets the name of the proxy class to be used.
 void setProxyPrefetchingLimit(int proxyPrefetchingLimit)
           
 void setRepository(DescriptorRepository repository)
          Sets the repository.
 void setRowReader(RowReader newReader)
          sets the row reader class for this descriptor
 void setRowReader(String newReaderClassName)
          sets the row reader class name for thie class descriptor
 void setSchema(String schema)
          Sets the schema.
 void setSuperClass(String classname)
          Set name of the super class.
 void setSuperClassFieldRef(int fieldId)
          TODO drop this method?
 void setTableName(String str)
          Method declaration
 void setUpdateProcedure(UpdateProcedureDescriptor newValue)
          Change the descriptor for the update procedure/function.
 String toString()
          Return a string representation of this class.
 String toXML()
          returns the XML marshalled version of this instance.
 void updateLockingValues(Object obj)
          updates the values for locking fields , BRJ handles int, long, Timestamp respects updateLock so locking field are only updated when updateLock is true
 boolean useIdentityColumnField()
          Returns true if an DB Identity column field based sequence manager was used.
 
Methods inherited from class org.apache.ojb.broker.metadata.DescriptorBase
addAttribute, getAttribute, getAttribute, getAttributeNames, getAttributes
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

persistentFieldClassName

private String persistentFieldClassName

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

DYNAMIC_STR

public static final String DYNAMIC_STR
See Also:
Constant Field Values

OJB_CONCRETE_CLASS

public static final String OJB_CONCRETE_CLASS
See Also:
Constant Field Values

NO_PARAMS

private static final Class[] NO_PARAMS

insertProcedure

private InsertProcedureDescriptor insertProcedure
The descriptor for the insert procedure/function.


updateProcedure

private UpdateProcedureDescriptor updateProcedure
The descriptor for the update procedure/function.


deleteProcedure

private DeleteProcedureDescriptor deleteProcedure
The descriptor for the delete procedure/function.


initializationMethod

private transient Method initializationMethod
optional method to be invoked after instance fields are initialized


initializationMethodName

private String initializationMethodName

factoryMethod

private transient Method factoryMethod

factoryMethodName

private String factoryMethodName

alreadyLookedupZeroArguments

private transient boolean alreadyLookedupZeroArguments
whether we have already tried to look up the zero argument constructor. Transient declared, because Constructor is transient and we need to reinitialize constructor after serialization.


zeroArgumentConstructor

private transient Constructor zeroArgumentConstructor
the zero argument constructor for this class


ojbConcreteFieldCheckDone

private transient boolean ojbConcreteFieldCheckDone
used to signal use of ojbConcreteClass field


ojbConcreteClassField

private transient FieldDescriptor ojbConcreteClassField

statementsForClass

private transient StatementsForClassIF statementsForClass
We have to bound StatementsForClassIF instance to this class, because metadata may change.


m_repository

private DescriptorRepository m_repository

factoryClass

private Class factoryClass
optional class.method to be invoked to create object instance. Both of these must be present for this function to be successful.


useIdentityColumn

private int useIdentityColumn

baseClass

private String baseClass

m_IsolationLevel

private int m_IsolationLevel
transaction isolation level specified for this class, used in the ODMG server


schema

private String schema
the SQL SCHEMA of the underlying table of this class


m_Class

private Class m_Class
the described class


isAbstract

private boolean isAbstract
whether the described class is abstract


m_TableName

private String m_TableName
the table name used to store the scalar attributes of this class


m_rowReader

private RowReader m_rowReader
the RowReader for this class


superClass

private String superClass
the class that this class extends


superClassFieldRef

private int superClassFieldRef
reference column for the superclass


m_isInterface

private boolean m_isInterface
does the described class represent an interface?


proxyClass

private Class proxyClass
the proxy class for the described class, may be null


proxyClassName

private String proxyClassName
the proxy class name for the described class, may be null


acceptLocks

private boolean acceptLocks
if false do not accept implicit locks on this class


alwaysRefresh

private boolean alwaysRefresh
if true instances of this class are always refreshed even if they are already in the cache. false by default.


m_ProxyPrefetchingLimit

private int m_ProxyPrefetchingLimit

objectCacheDescriptor

private ObjectCacheDescriptor objectCacheDescriptor
optional, ObjectCacheDescriptor for representing class


indexes

private Vector indexes
the vector of indices used in DDL generation.


m_autoIncrementField

private FieldDescriptor m_autoIncrementField

m_FieldDescriptions

private FieldDescriptor[] m_FieldDescriptions
the FieldDescriptors for the primitive attributes


m_CollectionDescriptors

private Vector m_CollectionDescriptors
the descriptors for collection attributes


m_ObjectReferenceDescriptors

private Vector m_ObjectReferenceDescriptors
the descriptor for 1-1 reference attributes


m_nonPkFieldDescriptors

private FieldDescriptor[] m_nonPkFieldDescriptors
the non-primary key FieldDescriptors


m_PkFieldDescriptors

private FieldDescriptor[] m_PkFieldDescriptors
the primary key FieldDescriptors


m_RwFieldDescriptors

private FieldDescriptor[] m_RwFieldDescriptors
the read/write FieldDescriptors BRJ


m_RwNonPkFieldDescriptors

private FieldDescriptor[] m_RwNonPkFieldDescriptors

m_lockingFieldDescriptors

private FieldDescriptor[] m_lockingFieldDescriptors
the optimistic lockingFieldDescriptors BRJ


extentClasses

private Vector extentClasses
the list of classes in the extent of this class. can be empty


extentClassNames

private Vector extentClassNames
the list of class names in the extent of this class. can be empty


m_fieldDescriptorNameMap

private Map m_fieldDescriptorNameMap

m_collectionDescriptorNameMap

private Map m_collectionDescriptorNameMap

m_objectReferenceDescriptorsNameMap

private Map m_objectReferenceDescriptorsNameMap

m_superCld

private ClassDescriptor m_superCld

m_superCldSet

private boolean m_superCldSet
Constructor Detail

ClassDescriptor

public ClassDescriptor(DescriptorRepository pRepository)
Constructor declaration

Method Detail

getBaseClass

public String getBaseClass()

setBaseClass

public void setBaseClass(String baseClass)

getObjectCacheDescriptor

public ObjectCacheDescriptor getObjectCacheDescriptor()
Returns the appropriate ObjectCacheDescriptor or null if not specified.


setObjectCacheDescriptor

public void setObjectCacheDescriptor(ObjectCacheDescriptor objectCacheDescriptor)
Sets the ObjectCacheDescriptor for representing class.


setRowReader

public void setRowReader(RowReader newReader)
sets the row reader class for this descriptor


getRowReader

public RowReader getRowReader()
Returns the RowReader for this descriptor.


setRowReader

public void setRowReader(String newReaderClassName)
sets the row reader class name for thie class descriptor


getRowReaderClassName

public String getRowReaderClassName()

getClassNameOfObject

public String getClassNameOfObject()
returns the name of the described class

Returns:
String name of the described class

getClassOfObject

public Class getClassOfObject()
returns the class object of the described class

Returns:
Class the described class

setClassOfObject

public void setClassOfObject(Class c)
sets the class object described by this descriptor.

Parameters:
c - the class to describe

addFieldDescriptor

public void addFieldDescriptor(FieldDescriptor fld)
adds a FIELDDESCRIPTOR to this ClassDescriptor.

Parameters:
fld -

removeFieldDescriptor

public boolean removeFieldDescriptor(FieldDescriptor fld)

getCollectionDescriptors

public Vector getCollectionDescriptors()
Returns all defined CollectionDescriptor for this class descriptor.


addCollectionDescriptor

public void addCollectionDescriptor(CollectionDescriptor cod)
Add a CollectionDescriptor.


removeCollectionDescriptor

public void removeCollectionDescriptor(CollectionDescriptor cod)

getObjectReferenceDescriptors

public Vector getObjectReferenceDescriptors()
Returns all defined ObjectReferenceDescriptor.


addObjectReferenceDescriptor

public void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
Add a ObjectReferenceDescriptor.


removeObjectReferenceDescriptor

public void removeObjectReferenceDescriptor(ObjectReferenceDescriptor ord)

getObjectReferenceDescriptorByName

public ObjectReferenceDescriptor getObjectReferenceDescriptorByName(String name)
Get an ObjectReferenceDescriptor by name BRJ

Parameters:
name -
Returns:
ObjectReferenceDescriptor or null

getObjectReferenceDescriptorsNameMap

private Map getObjectReferenceDescriptorsNameMap()

getCollectionDescriptorByName

public CollectionDescriptor getCollectionDescriptorByName(String name)
Get an CollectionDescriptor by name BRJ

Parameters:
name -
Returns:
CollectionDescriptor or null

getCollectionDescriptorNameMap

private Map getCollectionDescriptorNameMap()

getSuperClassDescriptor

public ClassDescriptor getSuperClassDescriptor()
Answers the ClassDescriptor referenced by 'super' ReferenceDescriptor.

Returns:
ClassDescriptor or null

addExtentClassName

public void addExtentClassName(Class newExtendClass)
Deprecated. use addExtentClass(String newExtentClass) instead

add an Extent class to the current descriptor

Parameters:
newExtendClass -

addExtentClass

public void addExtentClass(Class newExtendClass)
add an Extent class to the current descriptor

Parameters:
newExtendClass -

addExtentClass

public void addExtentClass(String newExtentClassName)
add an Extent class to the current descriptor

Parameters:
newExtentClassName - name of the class to add

removeExtentClass

public void removeExtentClass(String extentClassName)

getExtentClasses

public Vector getExtentClasses()
return all classes in this extent. Creation date: (02.02.2001 17:49:11)

Returns:
java.util.Vector

getExtentClassNames

public Vector getExtentClassNames()
Return the names of all classes in this extent

Returns:
java.util.Vector a Vector containing the fully qualified names of all classes in this extent

isExtent

public boolean isExtent()
Insert the method's description here. Creation date: (02.02.2001 17:49:11)

Returns:
boolean

getProxyClass

public Class getProxyClass()
Insert the method's description here. Creation date: (26.01.2001 09:20:09)

Returns:
java.lang.Class

isDynamicProxy

public boolean isDynamicProxy()

setProxyClass

public void setProxyClass(Class newProxyClass)
Sets the proxy class to be used.

Parameters:
newProxyClass - java.lang.Class

setProxyClassName

public void setProxyClassName(String newProxyClassName)
Sets the name of the proxy class to be used. using "dynamic" instead of a real classname will result in usage of dynamic proxies.

Parameters:
newProxyClassName - the classname or "dynamic"

getProxyClassName

public String getProxyClassName()
Get the name of the proxy class. This method doesn't try to access the real class, so it can be called even if the class doesn't exist.


getFieldDescriptions

public FieldDescriptor[] getFieldDescriptions()
Returns array of all FieldDescriptors.


getFieldDescriptorByIndex

public FieldDescriptor getFieldDescriptorByIndex(int index)
Returns the matching FieldDescriptor.


getFieldDescriptorByName

public FieldDescriptor getFieldDescriptorByName(String name)
Returns the matching FieldDescriptor - only fields of the current class will be scanned, to include fields defined the the super-classes too, use method getFieldDescriptor(boolean).


getFieldDescriptorForPath

public FieldDescriptor getFieldDescriptorForPath(String aPath,
                                                 Map pathHints)
return the FieldDescriptor for the Attribute referenced in the path
the path may contain simple attribut names, functions and path expressions using relationships
ie: name, avg(price), adress.street

Parameters:
aPath - the path to the attribute
pathHints - a Map containing the class to be used for a segment or null if no segment was used.
Returns:
the FieldDescriptor or null (ie: for m:n queries)

getFieldDescriptorForPath

public FieldDescriptor getFieldDescriptorForPath(String aPath)
return the FieldDescriptor for the Attribute referenced in the path
the path may contain simple attribut names, functions and path expressions using relationships
ie: name, avg(price), adress.street

Parameters:
aPath - the path to the attribute
Returns:
the FieldDescriptor or null (ie: for m:n queries)

getFieldDescriptorsInHeirarchy

public FieldDescriptor[] getFieldDescriptorsInHeirarchy()
Returns:
this classes FieldDescriptor's as well as it's parents and so on and so on

appendFieldDescriptorArrays

private FieldDescriptor[] appendFieldDescriptorArrays(FieldDescriptor[] fieldDescriptions,
                                                      FieldDescriptor[] fieldDescriptorsInHeirarchy)

getAutoIncrementField

public FieldDescriptor getAutoIncrementField()
Deprecated. does not make sense because it's possible to define more than one autoincrement field. Alternative see getAutoIncrementFields()

Returns the first found autoincrement field defined in this class descriptor. Use carefully when multiple autoincrement field were defined.


getAutoIncrementFields

public FieldDescriptor[] getAutoIncrementFields()

getCurrentLockingValues

public ValueContainer[] getCurrentLockingValues(Object o)
                                         throws PersistenceBrokerException
returns an Array with an Objects CURRENT locking VALUES , BRJ

Throws:
PersistenceBrokerException - if there is an erros accessing o field values

updateLockingValues

public void updateLockingValues(Object obj)
                         throws PersistenceBrokerException
updates the values for locking fields , BRJ handles int, long, Timestamp respects updateLock so locking field are only updated when updateLock is true

Throws:
PersistenceBrokerException - if there is an erros accessing obj field values

getNonPkFields

public FieldDescriptor[] getNonPkFields()
return an array of NONPK-FieldDescription sorted ascending according to the field-descriptions getOrder() property


getPkFields

public FieldDescriptor[] getPkFields()
Return an array of PK FieldDescription sorted ascending according to the field-descriptions getOrder() property


getNonPkRwFields

public FieldDescriptor[] getNonPkRwFields()
Returns array of read/write non pk FieldDescriptors.


getAllRwFields

public FieldDescriptor[] getAllRwFields()
Returns array of read/write FieldDescriptors.


getLockingFields

public FieldDescriptor[] getLockingFields()
return an array of FieldDescription for optimistic locking sorted ascending according to the field-descriptions getOrder() property


isLocking

public boolean isLocking()
return true if optimistic locking is used


getAttributeDescriptorsForPath

public ArrayList getAttributeDescriptorsForPath(String aPath)
return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)

Parameters:
aPath - the cleaned path to the attribute
Returns:
ArrayList of AttributeDescriptors

getAttributeDescriptorsForPath

public ArrayList getAttributeDescriptorsForPath(String aPath,
                                                Map pathHints)
return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)

Parameters:
aPath - the cleaned path to the attribute
pathHints - a Map containing the class to be used for a segment or null if no segment was used.
Returns:
ArrayList of AttributeDescriptors

getAttributeDescriptorsForCleanPath

private ArrayList getAttributeDescriptorsForCleanPath(String aPath,
                                                      Map pathHints)
return all AttributeDescriptors for the path
ie: partner.addresses.street returns a Collection of 3 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor, FieldDescriptor)
ie: partner.addresses returns a Collection of 2 AttributeDescriptors (ObjectReferenceDescriptor, CollectionDescriptor)

Parameters:
aPath - the cleaned path to the attribute
pathHints - a Map containing the class to be used for a segment or null if no segment is used.
Returns:
ArrayList of AttributeDescriptors

getZeroArgumentConstructor

public Constructor getZeroArgumentConstructor()
returns the zero argument constructor for the class represented by this class descriptor or null if a zero argument constructor does not exist. If the zero argument constructor for this class is not public it is made accessible before being returned.


toXML

public String toXML()
Description copied from interface: XmlCapable
returns the XML marshalled version of this instance.

Specified by:
toXML in interface XmlCapable
Returns:
the XML String representing this object.

isolationLevelXml

private String isolationLevelXml()

setSuperClass

public void setSuperClass(String classname)
Set name of the super class.


getSuperClass

public String getSuperClass()
Return the super class or null if not declared in repository file.


setSuperClassFieldRef

public void setSuperClassFieldRef(int fieldId)
TODO drop this method?


getSuperClassFieldRef

public int getSuperClassFieldRef()
TODO drop this method?


isInterface

public boolean isInterface()
Return true, if the described class is an interface.


setIsInterface

public void setIsInterface(boolean newIsInterface)
Set true if described class is a interface.


isAbstract

public boolean isAbstract()
Returns:
boolean true if the mapped class is abstract

isAcceptLocks

public boolean isAcceptLocks()
Returns acceptLocks.

Returns:
boolean

setAcceptLocks

public void setAcceptLocks(boolean acceptLocks)
Sets acceptLocks.

Parameters:
acceptLocks - The m_acceptLocks to set

getIndexes

public Vector getIndexes()
Gets the IndexDescriptors used for DDL generation.


setIndexes

public void setIndexes(Vector indexes)
Sets the IndexDescriptors used for DDL generation.


getRepository

public DescriptorRepository getRepository()
Gets the repository.

Returns:
Returns a DescriptorRepository

setRepository

public void setRepository(DescriptorRepository repository)
Sets the repository.

Parameters:
repository - The repository to set

getIsolationLevel

public int getIsolationLevel()
returns the transaction isolation level to be used for this class. Used only in the ODMG server


setIsolationLevel

public void setIsolationLevel(int isoLevel)
Method declaration

Parameters:
isoLevel -

getTableName

private String getTableName()
Method declaration

Returns:
table name

setTableName

public void setTableName(String str)
Method declaration

Parameters:
str -

getFullTableName

public String getFullTableName()
Answer Table name including schema BRJ


getSchema

public String getSchema()
Gets the schema.

Returns:
Returns a String

setSchema

public void setSchema(String schema)
Sets the schema.

Parameters:
schema - The schema to set

toString

public String toString()
Return a string representation of this class.

Overrides:
toString in class DescriptorBase

setInitializationMethod

private void setInitializationMethod(Method newMethod)
sets the initialization method for this descriptor


setInitializationMethod

public void setInitializationMethod(String newMethodName)
sets the initialization method for this descriptor by name


getInitializationMethod

public Method getInitializationMethod()
Returns the initialization method for this descriptor or null if no initialization method is defined.


isAlwaysRefresh

public boolean isAlwaysRefresh()
if true instances of this class are always refreshed even if they are already in the cache.

Returns:
boolean

setAlwaysRefresh

public void setAlwaysRefresh(boolean alwaysRefresh)
Sets the alwaysRefresh parameter.

Parameters:
alwaysRefresh - The value to set

getProxyPrefetchingLimit

public int getProxyPrefetchingLimit()

setProxyPrefetchingLimit

public void setProxyPrefetchingLimit(int proxyPrefetchingLimit)

getFactoryClass

public Class getFactoryClass()
Return factory class.


getFactoryMethod

public Method getFactoryMethod()
Return factory method.


setFactoryClass

public void setFactoryClass(Class newClass)
Set the object factory for class described by this descriptor.

See Also:
setFactoryMethod(java.lang.reflect.Method)

setFactoryClass

public void setFactoryClass(String newClass)
See Also:
setFactoryClass(java.lang.Class)

setFactoryMethod

private void setFactoryMethod(Method newMethod)
Specify the method to instantiate objects represented by this descriptor.

See Also:
setFactoryClass(java.lang.Class)

setFactoryMethod

public void setFactoryMethod(String factoryMethodName)
sets the initialization method for this descriptor by name


setInsertProcedure

public void setInsertProcedure(InsertProcedureDescriptor newValue)
Change the descriptor for the insert procedure/function.

Parameters:
newValue - the new value.

getInsertProcedure

public InsertProcedureDescriptor getInsertProcedure()
Retrieve the descriptor for the insert procedure/function.

Returns:
The current value

setUpdateProcedure

public void setUpdateProcedure(UpdateProcedureDescriptor newValue)
Change the descriptor for the update procedure/function.

Parameters:
newValue - the new value.

getUpdateProcedure

public UpdateProcedureDescriptor getUpdateProcedure()
Retrieve the descriptor for the update procedure/function.

Returns:
The current value

setDeleteProcedure

public void setDeleteProcedure(DeleteProcedureDescriptor newValue)
Change the descriptor for the delete procedure/function.

Parameters:
newValue - the new value.

getDeleteProcedure

public DeleteProcedureDescriptor getDeleteProcedure()
Retrieve the descriptor for the delete procedure/function.

Returns:
The current value

getOjbConcreteClassField

public FieldDescriptor getOjbConcreteClassField()
Returns the ojbConcreteClass field or null if none defined.


getStatementsForClass

public StatementsForClassIF getStatementsForClass(ConnectionManagerIF conMan)

setPersistentFieldClassName

public void setPersistentFieldClassName(String pfClassName)
Optional! Set the PersistentField implementation class used by this class.

Parameters:
pfClassName - The full qualified class name of the PersistentField.

getPersistentFieldClassName

public String getPersistentFieldClassName()
Get the used PersistentField implementation name.


useIdentityColumnField

public boolean useIdentityColumnField()
Returns true if an DB Identity column field based sequence manager was used. In that cases we will find an autoincrement field with read-only access and return true, otherwise false.


getObjectReferenceDescriptors

public List getObjectReferenceDescriptors(boolean withInherited)
Returns all defined ObjectReferenceDescriptor.

Parameters:
withInherited - If true inherited super class references will be included.

getCollectionDescriptors

public List getCollectionDescriptors(boolean withInherited)
Returns all defined CollectionDescriptor for this class descriptor.

Parameters:
withInherited - If true inherited super class references will be included.

getFieldDescriptor

public FieldDescriptor[] getFieldDescriptor(boolean withInherited)
Return an array of all FieldDescriptor for this represented class, if parameter withInherited is true all inherited descriptor of declared super classes are included.

Parameters:
withInherited - If true inherited super class fields will be included.

getFieldDescriptorNonPk

public FieldDescriptor[] getFieldDescriptorNonPk(boolean withInherited)
Return an array of NON-PK FieldDescriptor, if parameter withInherited is true all inherited descriptor of declared super classes are included.

Parameters:
withInherited - If true inherited super class fields will be included.

getSuperReference

public SuperReferenceDescriptor getSuperReference()
Returns the SuperReferenceDescriptor of this class or null if none was used.

Returns:
The reference descriptor for the super-reference or null if not exists.


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.