|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.metadata.DescriptorBase
org.apache.ojb.broker.metadata.ClassDescriptor
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
).
Field Summary | |
static java.lang.String |
DYNAMIC_STR
|
static java.lang.String |
OJB_CONCRETE_CLASS
|
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! Set the PersistentField
implementation class used by this class. |
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 |
public static final java.lang.String DYNAMIC_STR
public static final java.lang.String OJB_CONCRETE_CLASS
Constructor Detail |
public ClassDescriptor(DescriptorRepository pRepository)
Method Detail |
public java.lang.String getBaseClass()
public void setBaseClass(java.lang.String baseClass)
public ObjectCacheDescriptor getObjectCacheDescriptor()
ObjectCacheDescriptor
or null
if not specified.
public void setObjectCacheDescriptor(ObjectCacheDescriptor objectCacheDescriptor)
ObjectCacheDescriptor
for representing class.
public void setRowReader(RowReader newReader)
public RowReader getRowReader()
RowReader
for this descriptor.
public void setRowReader(java.lang.String newReaderClassName)
public java.lang.String getRowReaderClassName()
public java.lang.String getClassNameOfObject()
public java.lang.Class getClassOfObject()
public void setClassOfObject(java.lang.Class c)
c
- the class to describepublic void addFieldDescriptor(FieldDescriptor fld)
fld
- public boolean removeFieldDescriptor(FieldDescriptor fld)
public java.util.Vector getCollectionDescriptors()
CollectionDescriptor
for
this class descriptor.
public void addCollectionDescriptor(CollectionDescriptor cod)
CollectionDescriptor
.
public void removeCollectionDescriptor(CollectionDescriptor cod)
public java.util.Vector getObjectReferenceDescriptors()
ObjectReferenceDescriptor
.
public void addObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
ObjectReferenceDescriptor
.
public void removeObjectReferenceDescriptor(ObjectReferenceDescriptor ord)
public ObjectReferenceDescriptor getObjectReferenceDescriptorByName(java.lang.String name)
name
-
public CollectionDescriptor getCollectionDescriptorByName(java.lang.String name)
name
-
public ClassDescriptor getSuperClassDescriptor()
public void addExtentClassName(java.lang.Class newExtendClass)
addExtentClass(String newExtentClass)
instead
newExtendClass
- public void addExtentClass(java.lang.Class newExtendClass)
newExtendClass
- public void addExtentClass(java.lang.String newExtentClassName)
newExtentClassName
- name of the class to addpublic void removeExtentClass(java.lang.String extentClassName)
public java.util.Vector getExtentClasses()
public java.util.Vector getExtentClassNames()
public boolean isExtent()
public java.lang.Class getProxyClass()
public boolean isDynamicProxy()
public void setProxyClass(java.lang.Class newProxyClass)
newProxyClass
- java.lang.Classpublic void setProxyClassName(java.lang.String newProxyClassName)
newProxyClassName
- the classname or "dynamic"public java.lang.String getProxyClassName()
public FieldDescriptor[] getFieldDescriptions()
public FieldDescriptor getFieldDescriptorByIndex(int index)
FieldDescriptor
.
public FieldDescriptor getFieldDescriptorByName(java.lang.String name)
FieldDescriptor
- only fields
of the current class will be scanned, to include fields defined
the the super-classes too, use method getFieldDescriptor(boolean)
.
public FieldDescriptor getFieldDescriptorForPath(java.lang.String aPath, java.util.Map pathHints)
aPath
- the path to the attributepathHints
- a Map containing the class to be used for a segment or null
if no segment was used.
public FieldDescriptor getFieldDescriptorForPath(java.lang.String aPath)
aPath
- the path to the attribute
public FieldDescriptor[] getFieldDescriptorsInHeirarchy()
public FieldDescriptor getAutoIncrementField()
getAutoIncrementFields()
public FieldDescriptor[] getAutoIncrementFields()
public ValueContainer[] getCurrentLockingValues(java.lang.Object o) throws PersistenceBrokerException
PersistenceBrokerException
- if there is an erros accessing o field valuespublic void updateLockingValues(java.lang.Object obj) throws PersistenceBrokerException
PersistenceBrokerException
- if there is an erros accessing obj field valuespublic FieldDescriptor[] getNonPkFields()
public FieldDescriptor[] getPkFields()
public FieldDescriptor[] getNonPkRwFields()
public FieldDescriptor[] getAllRwFields()
public FieldDescriptor[] getLockingFields()
public boolean isLocking()
public java.util.ArrayList getAttributeDescriptorsForPath(java.lang.String aPath)
aPath
- the cleaned path to the attribute
public java.util.ArrayList getAttributeDescriptorsForPath(java.lang.String aPath, java.util.Map pathHints)
aPath
- the cleaned path to the attributepathHints
- a Map containing the class to be used for a segment or null
if no segment was used.
public java.lang.reflect.Constructor getZeroArgumentConstructor()
public java.lang.String toXML()
XmlCapable
toXML
in interface XmlCapable
public void setSuperClass(java.lang.String classname)
public java.lang.String getSuperClass()
null
if not declared in repository file.
public void setSuperClassFieldRef(int fieldId)
public int getSuperClassFieldRef()
public boolean isInterface()
public void setIsInterface(boolean newIsInterface)
true
if described class is
a interface.
public boolean isAbstract()
public boolean isAcceptLocks()
public void setAcceptLocks(boolean acceptLocks)
acceptLocks
- The m_acceptLocks to setpublic java.util.Vector getIndexes()
public void setIndexes(java.util.Vector indexes)
public DescriptorRepository getRepository()
public void setRepository(DescriptorRepository repository)
repository
- The repository to setpublic int getIsolationLevel()
public void setIsolationLevel(int isoLevel)
isoLevel
- public void setTableName(java.lang.String str)
str
- public java.lang.String getFullTableName()
public java.lang.String getSchema()
public void setSchema(java.lang.String schema)
schema
- The schema to setpublic java.lang.String toString()
public void setInitializationMethod(java.lang.String newMethodName)
public java.lang.reflect.Method getInitializationMethod()
public boolean isAlwaysRefresh()
public void setAlwaysRefresh(boolean alwaysRefresh)
alwaysRefresh
- The value to setpublic int getProxyPrefetchingLimit()
public void setProxyPrefetchingLimit(int proxyPrefetchingLimit)
public java.lang.Class getFactoryClass()
public java.lang.reflect.Method getFactoryMethod()
public void setFactoryClass(java.lang.Class newClass)
setFactoryMethod(java.lang.String)
public void setFactoryClass(java.lang.String newClass)
setFactoryClass(java.lang.Class)
public void setFactoryMethod(java.lang.String factoryMethodName)
public void setInsertProcedure(InsertProcedureDescriptor newValue)
newValue
- the new value.public InsertProcedureDescriptor getInsertProcedure()
public void setUpdateProcedure(UpdateProcedureDescriptor newValue)
newValue
- the new value.public UpdateProcedureDescriptor getUpdateProcedure()
public void setDeleteProcedure(DeleteProcedureDescriptor newValue)
newValue
- the new value.public DeleteProcedureDescriptor getDeleteProcedure()
public FieldDescriptor getOjbConcreteClassField()
null
if none defined.
public StatementsForClassIF getStatementsForClass(ConnectionManagerIF conMan)
public void setPersistentFieldClassName(java.lang.String pfClassName)
PersistentField
implementation class used by this class.
pfClassName
- The full qualified class name of the
PersistentField
.public java.lang.String getPersistentFieldClassName()
PersistentField
implementation name.
public boolean useIdentityColumnField()
public java.util.List getObjectReferenceDescriptors(boolean withInherited)
ObjectReferenceDescriptor
.
withInherited
- If true inherited super class references will be included.public java.util.List getCollectionDescriptors(boolean withInherited)
CollectionDescriptor
for
this class descriptor.
withInherited
- If true inherited super class references will be included.public FieldDescriptor[] getFieldDescriptor(boolean withInherited)
FieldDescriptor
for this represented class, if
parameter withInherited is true all inherited descriptor
of declared super classes are included.
withInherited
- If true inherited super class fields will be included.public FieldDescriptor[] getFieldDescriptorNonPk(boolean withInherited)
FieldDescriptor
, if parameter withInherited
is true all inherited descriptor of declared super classes are included.
withInherited
- If true inherited super class fields will be included.public SuperReferenceDescriptor getSuperReference()
SuperReferenceDescriptor
of this class or null
if none was used.
public void addAttribute(java.lang.String attributeName, java.lang.String attributeValue)
AttributeContainer
addAttribute
in interface AttributeContainer
attributeName
- the name of the attribute to retrieveattributeValue
- the attribute's valueAttributeContainer.addAttribute(String, String)
public java.lang.String getAttribute(java.lang.String attributeName, java.lang.String defaultValue)
AttributeContainer
getAttribute
in interface AttributeContainer
attributeName
- the attribute to retrievedefaultValue
- the value to return if the attribute is not present
AttributeContainer.getAttribute(String, String)
public java.lang.String getAttribute(java.lang.String attributeName)
AttributeContainer
getAttribute
in interface AttributeContainer
attributeName
- the attribute to retrieve
AttributeContainer.getAttribute(String)
public java.util.Map getAttributes()
public java.lang.String[] getAttributeNames()
null
)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |