ojb.broker.metadata
Class ClassDescriptor

java.lang.Object
  |
  +--ojb.broker.metadata.ClassDescriptor
All Implemented Interfaces:
java.io.Serializable

public class ClassDescriptor
extends java.lang.Object
implements java.io.Serializable

A ClassDescriptor contains all information for mapping objects of a given class to database tables.

Author:
Thomas Mahler
See Also:
Serialized Form

Constructor Summary
ClassDescriptor()
          Constructor declaration
 
Method Summary
 void addCollectionDescriptor(CollectionDescriptor cod)
          Method declaration
 void addExtentClass(java.lang.Class newExtendClass)
          Method declaration
 void addFieldDescriptor(FieldDescriptor fld)
          adds a FieldDescriptor to this ClassDescriptor.
 void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
          Method declaration
 java.lang.Object[] getAllValues(java.lang.Object obj)
          returns a vector containing values for all the Objects attributes
 java.lang.Class getClassOfObject()
          Method declaration
 CollectionDescriptor getCollectionDescriptorByName(java.lang.String name)
          Get an CollectionDescriptor by name BRJ
 java.util.Vector getCollectionDescriptors()
          Method declaration
 JdbcConnectionDescriptor getConnectionDescriptor()
          Method declaration
 java.lang.reflect.Constructor getConstructor()
          returns a Constructor that takes all persistent attributes of the class as arguments.
 ConversionStrategy getConversionStrategy()
           
 java.lang.Object[] getCurrentLockingValues(java.lang.Object o)
          returns an Array with an Objects CURRENT locking VALUES , BRJ
 java.lang.Class getDynamicProxyClass()
          returns a dynamic Proxy that implements all interfaces of the class described by this ClassDescriptor.
 java.util.Vector getExtentClasses()
          return all classes in this extent.
 FieldDescriptor[] getFieldDescriptions()
          returns array of all FieldDescriptors.
 FieldDescriptor getFieldDescriptorByIndex(int index)
          Method declaration
 FieldDescriptor getFieldDescriptorByName(java.lang.String name)
          Method declaration
 java.lang.String getFullTableName()
          Answer Table name including schema BRJ
 int getIsolationLevel()
          returns the transaction isolation level to be used for this class.
 java.lang.Object[] getKeyValues(java.lang.Object o)
          returns an Array with an Objects PK VALUES
 FieldDescriptor[] getLockingFields()
          return an array of FieldDescription for optimistic locking sorted ascending according to the field-descriptions getOrder() property
 java.lang.Object[] getNonKeyValues(java.lang.Object o)
          returns an Array with an Objects NON-PK VALUES
 FieldDescriptor[] getNonPkFields()
          return an array of PK FieldDescription sorted ascending according to the field-descriptions getOrder() property
 ObjectReferenceDescriptor getObjectReferenceDescriptorByName(java.lang.String name)
          Get an ObjectReferenceDescriptor by name BRJ
 java.util.Vector getObjectReferenceDescriptors()
          Method declaration
 java.lang.String getOrderby()
          Insert the method's description here.
 ObjectReferenceDescriptor getORDescriptorByClass(java.lang.Class c)
          Method declaration
 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.
 DescriptorRepository getRepository()
          Gets the repository.
 RowReader getRowReader()
           
 java.lang.String getSchema()
          Gets the schema.
 boolean isExtent()
          Insert the method's description here.
 boolean isInterface()
          Insert the method's description here.
 boolean isLocking()
          return true if optimistic locking is used
 void setClassOfObject(java.lang.Class c)
          Method declaration
 void setConnectionDescriptor(JdbcConnectionDescriptor jcd)
          Method declaration
 void setConversionStrategy(ConversionStrategy newStrategy)
           
 void setIsInterface(boolean newIsInterface)
          Insert the method's description here.
 void setIsolationLevel(int isoLevel)
          Method declaration
 void setOrderby(java.lang.String newOrderby)
          Insert the method's description here.
 void setProxyClass(java.lang.Class newProxyClass)
          Insert the method's description here.
 void setRepository(DescriptorRepository repository)
          Sets the repository.
 void setRowReader(RowReader newReader)
           
 void setSchema(java.lang.String schema)
          Sets the schema.
 void setTableName(java.lang.String str)
          Method declaration
 java.lang.String toString()
          Method declaration
 void updateLockingValues(java.lang.Object obj)
          updates the values for locking fields , BRJ handles int, long, Timestamp
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClassDescriptor

public ClassDescriptor()
Constructor declaration

Method Detail

setConversionStrategy

public void setConversionStrategy(ConversionStrategy newStrategy)

getConversionStrategy

public ConversionStrategy getConversionStrategy()

setRowReader

public void setRowReader(RowReader newReader)

getRowReader

public RowReader getRowReader()

getFullTableName

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


setTableName

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

Parameters:
str -

getClassOfObject

public java.lang.Class getClassOfObject()
Method declaration

Returns:

setClassOfObject

public void setClassOfObject(java.lang.Class c)
Method declaration

Parameters:
c -

addFieldDescriptor

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

Parameters:
fld -

getCollectionDescriptors

public java.util.Vector getCollectionDescriptors()
Method declaration

Returns:

addCollectionDescriptor

public void addCollectionDescriptor(CollectionDescriptor cod)
Method declaration

Parameters:
cod -

getObjectReferenceDescriptors

public java.util.Vector getObjectReferenceDescriptors()
Method declaration

Returns:

addObjectReferenceDescriptor

public void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
Method declaration

Parameters:
ord -

getConnectionDescriptor

public JdbcConnectionDescriptor getConnectionDescriptor()
Method declaration

Returns:

setConnectionDescriptor

public void setConnectionDescriptor(JdbcConnectionDescriptor jcd)
Method declaration

Parameters:
jcd -

getFieldDescriptorByIndex

public FieldDescriptor getFieldDescriptorByIndex(int index)
Method declaration

Parameters:
index -
Returns:

getORDescriptorByClass

public ObjectReferenceDescriptor getORDescriptorByClass(java.lang.Class c)
Method declaration

Parameters:
c -
Returns:

toString

public java.lang.String toString()
Method declaration

Overrides:
toString in class java.lang.Object
Returns:

getFieldDescriptorByName

public FieldDescriptor getFieldDescriptorByName(java.lang.String name)
Method declaration

Parameters:
name -
Returns:

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

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 -

addExtentClass

public void addExtentClass(java.lang.Class newExtendClass)
Method declaration

Parameters:
newExtendClass -

getConstructor

public java.lang.reflect.Constructor getConstructor()
returns a Constructor that takes all persistent attributes of the class as arguments. Returns null, if such a constructor does not exist. PersistenceBroker clients are not urged to implement such constructors for persistence capable classes. But it's strongly recommended as it minimizes the overhead for reflective operations.


getExtentClasses

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

Returns:
java.util.Vector

getOrderby

public java.lang.String getOrderby()
Insert the method's description here. Creation date: (06.02.2001 22:50:16)

Returns:
java.lang.String

getProxyClass

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

Returns:
java.lang.Class

isExtent

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

Returns:
boolean

isInterface

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

Returns:
boolean

setIsInterface

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

Parameters:
newIsInterface - boolean

setOrderby

public void setOrderby(java.lang.String newOrderby)
Insert the method's description here. Creation date: (06.02.2001 22:50:16)

Parameters:
newOrderby - java.lang.String

setProxyClass

public void setProxyClass(java.lang.Class newProxyClass)
Insert the method's description here. Creation date: (26.01.2001 09:20:09)

Parameters:
newProxyClass - java.lang.Class

getAllValues

public java.lang.Object[] getAllValues(java.lang.Object obj)
                                throws PersistenceBrokerException
returns a vector containing values for all the Objects attributes

PersistenceBrokerException

getFieldDescriptions

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

Returns:
FieldDescriptor[]

getKeyValues

public java.lang.Object[] getKeyValues(java.lang.Object o)
                                throws PersistenceBrokerException
returns an Array with an Objects PK VALUES

PersistenceBrokerException

getCurrentLockingValues

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

PersistenceBrokerException

updateLockingValues

public void updateLockingValues(java.lang.Object obj)
                         throws PersistenceBrokerException
updates the values for locking fields , BRJ handles int, long, Timestamp

PersistenceBrokerException

getNonKeyValues

public java.lang.Object[] getNonKeyValues(java.lang.Object o)
                                   throws PersistenceBrokerException
returns an Array with an Objects NON-PK VALUES

PersistenceBrokerException

getNonPkFields

public FieldDescriptor[] getNonPkFields()
return an array of PK 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


getLockingFields

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


getDynamicProxyClass

public java.lang.Class getDynamicProxyClass()
returns a dynamic Proxy that implements all interfaces of the class described by this ClassDescriptor.

Returns:
Class the dynamically created proxy class

isLocking

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


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

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


Authors: Thomas Mahler and others. (C) 2000, 2001.
All rights reserved. Published under the Gnu Public License.
http://objectbridge.sourceforge.net
Version: 0.8.375, 2002-04-04