Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

ojb.broker.metadata
Class ClassDescriptor  view ClassDescriptor download ClassDescriptor.java

java.lang.Object
  extended byojb.broker.metadata.ClassDescriptor
All Implemented Interfaces:
IsolationLevels, RepositoryElements, java.io.Serializable, XmlCapable

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


Field Summary
private  boolean alreadyLookedup
          tells whether we tried to lookup multiargs Constructor already
private  java.lang.Class[] argsForConstructor
          the types of the arguments for the attributes in m_FieldDescriptions
private  java.util.Vector extentClasses
          the list of classes in the extent of this class.
private  java.util.Vector indexes
          the vector of indices used in DDL generation.
private  boolean isInterface
          does the described class represent an interface?
private  FieldDescriptor[] lockingFieldDescriptors
          the optimistic lockingFieldDescriptors BRJ
private  java.lang.Class m_Class
          the described class
private  java.util.Vector m_CollectionDescriptors
          the descriptors for collection attributes
private  JdbcConnectionDescriptor m_ConnDescription
          the JDBCConnectionDescriptor describing the RDBMS connection to be used for this class
private  FieldDescriptor[] m_FieldDescriptions
          the FieldDescriptors for the primitive attributes
private  int m_IsolationLevel
          transaction isolation level specified for this class, used in the ODMG server
private  java.util.Vector m_ObjectReferenceDescriptors
          the descriptor for 1-1 reference attributes
private  DescriptorRepository m_repository
           
private  java.lang.String m_TableName
          the table name used to store the scalar attributes of this class
private  java.lang.reflect.Constructor multiArgumentConstructor
          the constructor defined by m_Class to initialze all scalar attributes described in m_FieldDescriptions
private  FieldDescriptor[] nonPrimaryKeyFieldDescriptors
          the non-primary key FieldDescriptors
private  java.lang.String orderby
          optional orderby clause for initial sorting of collection elements
private  FieldDescriptor[] primaryKeyFieldDescriptors
          the primary key FieldDescriptors
private  java.lang.Class proxyClass
          the proxy class for the described class, may be null
private  ojb.broker.accesslayer.RowReader rowReader
          the RowReader for this class
private  java.lang.String schema
          the SQL SCHEMA of the underlying table of this class
 
Fields inherited from interface ojb.broker.metadata.RepositoryElements
_LAST, Auto_delete, Auto_retrieve, Auto_update, Autoincrement, Class_extent, Class_name, Class_proxy, ClassDescriptor, Collection_class, CollectionDescriptor, Column_name, Datasource_name, Dbms_name, Driver_name, Field_name, FieldConversion, FIELDDESCRIPTOR, Fk_descriptor_id, Fk_pointing_to_items_class, Fk_pointing_to_this_class, FOREIGN_KEY, INDEXED, Indirection_table, Inverse_fk, ISOLATION_LEVEL, Items_class, Jdbc_level, Jdbc_type, JdbcConnectionDescriptor, LENGTH, Locking, MappingRepository, NULLABLE, Orderby, PRECISION, PrimaryKey, ProxyReference, Referenced_class, ReferenceDescriptor, RefreshReference, RowReader, SCALE, Schema_name, SORT, Table_name, Url_dbalias, Url_protocol, Url_subprotocol, User_name, User_passwd
 
Fields inherited from interface ojb.broker.metadata.IsolationLevels
IL_DEFAULT, IL_OPTIMISTIC, IL_READ_COMMITTED, IL_READ_UNCOMMITTED, IL_REPEATABLE_READ, IL_SERIALIZABLE, LITERAL_IL_OPTIMISTIC, LITERAL_IL_READ_COMMITTED, LITERAL_IL_READ_UNCOMMITTED, LITERAL_IL_REPEATABLE_READ, LITERAL_IL_SERIALIZABLE
 
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
private  java.lang.Object getAutoIncrementValue(FieldDescriptor fmd, java.lang.Object obj, java.lang.Object cv)
           
 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.
 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
 java.util.Vector getIndexes()
          Gets the IndexDescriptors used for DDL generation.
 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.
 ojb.broker.accesslayer.RowReader getRowReader()
           
 java.lang.String getSchema()
          Gets the schema.
private  java.lang.String getTableName()
          Method declaration
 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
private  java.lang.String isolationLevelXml()
           
 void setClassOfObject(java.lang.Class c)
          Method declaration
 void setConnectionDescriptor(JdbcConnectionDescriptor jcd)
          Method declaration
 void setIndexes(java.util.Vector indexes)
          Sets the IndexDescriptors used for DDL generation.
 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(ojb.broker.accesslayer.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
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m_repository

private transient DescriptorRepository m_repository

m_IsolationLevel

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


schema

private java.lang.String schema
the SQL SCHEMA of the underlying table of this class


m_Class

private java.lang.Class m_Class
the described class


m_TableName

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


m_FieldDescriptions

private FieldDescriptor[] m_FieldDescriptions
the FieldDescriptors for the primitive attributes


m_CollectionDescriptors

private java.util.Vector m_CollectionDescriptors
the descriptors for collection attributes


m_ObjectReferenceDescriptors

private java.util.Vector m_ObjectReferenceDescriptors
the descriptor for 1-1 reference attributes


indexes

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


m_ConnDescription

private JdbcConnectionDescriptor m_ConnDescription
the JDBCConnectionDescriptor describing the RDBMS connection to be used for this class


alreadyLookedup

private boolean alreadyLookedup
tells whether we tried to lookup multiargs Constructor already


argsForConstructor

private java.lang.Class[] argsForConstructor
the types of the arguments for the attributes in m_FieldDescriptions


extentClasses

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


isInterface

private boolean isInterface
does the described class represent an interface?


multiArgumentConstructor

private java.lang.reflect.Constructor multiArgumentConstructor
the constructor defined by m_Class to initialze all scalar attributes described in m_FieldDescriptions


orderby

private java.lang.String orderby
optional orderby clause for initial sorting of collection elements


proxyClass

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


nonPrimaryKeyFieldDescriptors

private FieldDescriptor[] nonPrimaryKeyFieldDescriptors
the non-primary key FieldDescriptors


primaryKeyFieldDescriptors

private FieldDescriptor[] primaryKeyFieldDescriptors
the primary key FieldDescriptors


lockingFieldDescriptors

private FieldDescriptor[] lockingFieldDescriptors
the optimistic lockingFieldDescriptors BRJ


rowReader

private ojb.broker.accesslayer.RowReader rowReader
the RowReader for this class

Constructor Detail

ClassDescriptor

public ClassDescriptor()
Constructor declaration

Method Detail

setRowReader

public void setRowReader(ojb.broker.accesslayer.RowReader newReader)

getRowReader

public ojb.broker.accesslayer.RowReader getRowReader()

getTableName

private java.lang.String getTableName()
Method declaration


getFullTableName

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


setTableName

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


getClassOfObject

public java.lang.Class getClassOfObject()
Method declaration


setClassOfObject

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


addFieldDescriptor

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


getCollectionDescriptors

public java.util.Vector getCollectionDescriptors()
Method declaration


addCollectionDescriptor

public void addCollectionDescriptor(CollectionDescriptor cod)
Method declaration


getObjectReferenceDescriptors

public java.util.Vector getObjectReferenceDescriptors()
Method declaration


addObjectReferenceDescriptor

public void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
Method declaration


getConnectionDescriptor

public JdbcConnectionDescriptor getConnectionDescriptor()
Method declaration


setConnectionDescriptor

public void setConnectionDescriptor(JdbcConnectionDescriptor jcd)
Method declaration


getFieldDescriptorByIndex

public FieldDescriptor getFieldDescriptorByIndex(int index)
Method declaration


getORDescriptorByClass

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


toString

public java.lang.String toString()
Method declaration


getFieldDescriptorByName

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


getObjectReferenceDescriptorByName

public ObjectReferenceDescriptor getObjectReferenceDescriptorByName(java.lang.String name)
Get an ObjectReferenceDescriptor by name BRJ


getCollectionDescriptorByName

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


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


addExtentClass

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


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)


getOrderby

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


getProxyClass

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


isExtent

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


isInterface

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


setIsInterface

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


setOrderby

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


setProxyClass

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


getAllValues

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


getFieldDescriptions

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


getKeyValues

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


getCurrentLockingValues

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


updateLockingValues

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


getAutoIncrementValue

private java.lang.Object getAutoIncrementValue(FieldDescriptor fmd,
                                               java.lang.Object obj,
                                               java.lang.Object cv)

getNonKeyValues

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


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.


isLocking

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


getRepository

public DescriptorRepository getRepository()
Gets the repository.


setRepository

public void setRepository(DescriptorRepository repository)
Sets the repository.


getSchema

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


setSchema

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


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.


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

isolationLevelXml

private java.lang.String isolationLevelXml()