org.apache.ojb.broker.metadata
Class ClassDescriptor

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

public final class ClassDescriptor
extends java.lang.Object
implements java.io.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 365232 2005-12-21 22:36:07Z tomdz $
Author:
Thomas Mahler
See Also:
Serialized Form

Field Summary
static java.lang.String DYNAMIC_STR
           
static java.lang.String OJB_CONCRETE_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 addAttribute(java.lang.String attributeName, java.lang.String attributeValue)
          Store the specified attribute and it's value.
 void addCollectionDescriptor(CollectionDescriptor cod)
          Add a CollectionDescriptor.
 void addExtentClass(java.lang.Class newExtendClass)
          add an Extent class to the current descriptor
 void addExtentClass(java.lang.String newExtentClassName)
          add an Extent class to the current descriptor
 void addExtentClassName(java.lang.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.
 FieldDescriptor[] getAllRwFields()
          Returns array of read/write FieldDescriptors.
 java.lang.String getAttribute(java.lang.String attributeName)
          Get the value of an attribute
 java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
          Get the value of an attribute
 java.util.ArrayList getAttributeDescriptorsForPath(java.lang.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)
 java.util.ArrayList getAttributeDescriptorsForPath(java.lang.String aPath, java.util.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)
 java.lang.String[] getAttributeNames()
          Returns an array of the names of all atributes of this descriptor.
 java.util.Map getAttributes()
          Returns the attribute map (name, value) of this descriptor.
 FieldDescriptor getAutoIncrementField()
          Deprecated. does not make sense because it's possible to define more than one autoincrement field. Alternative see getAutoIncrementFields()
 FieldDescriptor[] getAutoIncrementFields()
           
 java.lang.String getBaseClass()
           
 java.lang.String getClassNameOfObject()
          returns the name of the described class
 java.lang.Class getClassOfObject()
          returns the class object of the described class
 CollectionDescriptor getCollectionDescriptorByName(java.lang.String name)
          Get an CollectionDescriptor by name BRJ
 java.util.Vector getCollectionDescriptors()
          Returns all defined CollectionDescriptor for this class descriptor.
 java.util.List getCollectionDescriptors(boolean withInherited)
          Returns all defined CollectionDescriptor for this class descriptor.
 ValueContainer[] getCurrentLockingValues(java.lang.Object o)
          returns an Array with an Objects CURRENT locking VALUES , BRJ
 DeleteProcedureDescriptor getDeleteProcedure()
          Retrieve the descriptor for the delete procedure/function.
 java.util.Vector getExtentClasses()
          return all classes in this extent.
 java.util.Vector getExtentClassNames()
          Return the names of all classes in this extent
 java.lang.Class getFactoryClass()
          Return factory class.
 java.lang.reflect.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(java.lang.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(java.lang.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(java.lang.String aPath, java.util.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()
           
 java.lang.String getFullTableName()
          Answer Table name including schema BRJ
 java.util.Vector getIndexes()
          Gets the IndexDescriptors used for DDL generation.
 java.lang.reflect.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(java.lang.String name)
          Get an ObjectReferenceDescriptor by name BRJ
 java.util.Vector getObjectReferenceDescriptors()
          Returns all defined ObjectReferenceDescriptor.
 java.util.List getObjectReferenceDescriptors(boolean withInherited)
          Returns all defined ObjectReferenceDescriptor.
 FieldDescriptor getOjbConcreteClassField()
          Returns the ojbConcreteClass field or null if none defined.
 java.lang.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
 java.lang.Class getProxyClass()
          Insert the method's description here.
 java.lang.String getProxyClassName()
          Get the name of the proxy class.
 int getProxyPrefetchingLimit()
           
 DescriptorRepository getRepository()
          Gets the repository.
 RowReader getRowReader()
          Returns the RowReader for this descriptor.
 java.lang.String getRowReaderClassName()
           
 java.lang.String getSchema()
          Gets the schema.
 StatementsForClassIF getStatementsForClass(ConnectionManagerIF conMan)
           
 java.lang.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.
 UpdateProcedureDescriptor getUpdateProcedure()
          Retrieve the descriptor for the update procedure/function.
 java.lang.reflect.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
 void removeCollectionDescriptor(CollectionDescriptor cod)
           
 void removeExtentClass(java.lang.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(java.lang.String baseClass)
           
 void setClassOfObject(java.lang.Class c)
          sets the class object described by this descriptor.
 void setDeleteProcedure(DeleteProcedureDescriptor newValue)
          Change the descriptor for the delete procedure/function.
 void setFactoryClass(java.lang.Class newClass)
          Set the object factory for class described by this descriptor.
 void setFactoryClass(java.lang.String newClass)
           
 void setFactoryMethod(java.lang.String factoryMethodName)
          sets the initialization method for this descriptor by name
 void setIndexes(java.util.Vector indexes)
          Sets the IndexDescriptors used for DDL generation.
 void setInitializationMethod(java.lang.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(java.lang.String pfClassName)
          Optional!
 void setProxyClass(java.lang.Class newProxyClass)
          Sets the proxy class to be used.
 void setProxyClassName(java.lang.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(java.lang.String newReaderClassName)
          sets the row reader class name for thie class descriptor
 void setSchema(java.lang.String schema)
          Sets the schema.
 void setSuperClass(java.lang.String classname)
          Set name of the super class.
 void setSuperClassFieldRef(int fieldId)
          TODO drop this method?
 void setTableName(java.lang.String str)
          Method declaration
 void setUpdateProcedure(UpdateProcedureDescriptor newValue)
          Change the descriptor for the update procedure/function.
 java.lang.String toString()
          Return a string representation of this class.
 java.lang.String toXML()
          returns the XML marshalled version of this instance.
 void updateLockingValues(java.lang.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 java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

DYNAMIC_STR

public static final java.lang.String DYNAMIC_STR
See Also:
Constant Field Values

OJB_CONCRETE_CLASS

public static final java.lang.String OJB_CONCRETE_CLASS
See Also:
Constant Field Values
Constructor Detail

ClassDescriptor

public ClassDescriptor(DescriptorRepository pRepository)
Constructor declaration

Method Detail

getBaseClass

public java.lang.String getBaseClass()

setBaseClass

public void setBaseClass(java.lang.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(java.lang.String newReaderClassName)
sets the row reader class name for thie class descriptor


getRowReaderClassName

public java.lang.String getRowReaderClassName()

getClassNameOfObject

public java.lang.String getClassNameOfObject()
returns the name of the described class

Returns:
String name of the described class

getClassOfObject

public java.lang.Class getClassOfObject()
returns the class object of the described class

Returns:
Class the described class

setClassOfObject

public void setClassOfObject(java.lang.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 java.util.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 java.util.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(java.lang.String name)
Get an ObjectReferenceDescriptor by name BRJ

Parameters:
name -
Returns:
ObjectReferenceDescriptor or null

getCollectionDescriptorByName

public CollectionDescriptor getCollectionDescriptorByName(java.lang.String name)
Get an CollectionDescriptor by name BRJ

Parameters:
name -
Returns:
CollectionDescriptor or null

getSuperClassDescriptor

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

Returns:
ClassDescriptor or null

addExtentClassName

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

add an Extent class to the current descriptor

Parameters:
newExtendClass -

addExtentClass

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

Parameters:
newExtendClass -

addExtentClass

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

Parameters:
newExtentClassName - name of the class to add

removeExtentClass

public void removeExtentClass(java.lang.String extentClassName)

getExtentClasses

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

Returns:
java.util.Vector

getExtentClassNames

public java.util.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 java.lang.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(java.lang.Class newProxyClass)
Sets the proxy class to be used.

Parameters:
newProxyClass - java.lang.Class

setProxyClassName

public void setProxyClassName(java.lang.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 java.lang.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(java.lang.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(java.lang.String aPath,
                                                 java.util.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(java.lang.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

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(java.lang.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(java.lang.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 java.util.ArrayList getAttributeDescriptorsForPath(java.lang.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 java.util.ArrayList getAttributeDescriptorsForPath(java.lang.String aPath,
                                                          java.util.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

getZeroArgumentConstructor

public java.lang.reflect.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 java.lang.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.

setSuperClass

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


getSuperClass

public java.lang.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 java.util.Vector getIndexes()
Gets the IndexDescriptors used for DDL generation.


setIndexes

public void setIndexes(java.util.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 -

setTableName

public void setTableName(java.lang.String str)
Method declaration

Parameters:
str -

getFullTableName

public java.lang.String getFullTableName()
Answer Table name including schema BRJ


getSchema

public java.lang.String getSchema()
Gets the schema.

Returns:
Returns a String

setSchema

public void setSchema(java.lang.String schema)
Sets the schema.

Parameters:
schema - The schema to set

toString

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


setInitializationMethod

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


getInitializationMethod

public java.lang.reflect.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 java.lang.Class getFactoryClass()
Return factory class.


getFactoryMethod

public java.lang.reflect.Method getFactoryMethod()
Return factory method.


setFactoryClass

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

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

setFactoryClass

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

setFactoryMethod

public void setFactoryMethod(java.lang.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(java.lang.String pfClassName)
Optional! Set the PersistentField implementation class used by this class.

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

getPersistentFieldClassName

public java.lang.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 java.util.List getObjectReferenceDescriptors(boolean withInherited)
Returns all defined ObjectReferenceDescriptor.

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

getCollectionDescriptors

public java.util.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.

addAttribute

public void addAttribute(java.lang.String attributeName,
                         java.lang.String attributeValue)
Description copied from interface: AttributeContainer
Store the specified attribute and it's value.

Specified by:
addAttribute in interface AttributeContainer
Parameters:
attributeName - the name of the attribute to retrieve
attributeValue - the attribute's value
See Also:
AttributeContainer.addAttribute(String, String)

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName,
                                     java.lang.String defaultValue)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
attributeName - the attribute to retrieve
defaultValue - the value to return if the attribute is not present
Returns:
the attribute value
See Also:
AttributeContainer.getAttribute(String, String)

getAttribute

public java.lang.String getAttribute(java.lang.String attributeName)
Description copied from interface: AttributeContainer
Get the value of an attribute

Specified by:
getAttribute in interface AttributeContainer
Parameters:
attributeName - the attribute to retrieve
Returns:
the attribute value
See Also:
AttributeContainer.getAttribute(String)

getAttributes

public java.util.Map getAttributes()
Returns the attribute map (name, value) of this descriptor. Note that the returned map is not modifiable.

Returns:
The attributes

getAttributeNames

public java.lang.String[] getAttributeNames()
Returns an array of the names of all atributes of this descriptor.

Returns:
The list of attribute names (will not be null)


(C) 2002 - 2006 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30