|
||||||||||
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.DescriptorRepository
The repository containing all object mapping and manipulation information of
all used persistent objects.
Note: Be careful when use references of this class or caching instances of this class,
because instances could become invalid (see MetadataManager
).
Field Summary |
Fields inherited from interface org.apache.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 | |
DescriptorRepository()
Constructor declaration |
Method Summary | |
void |
addAttribute(java.lang.String attributeName,
java.lang.String attributeValue)
Store the specified attribute and it's value. |
ClassDescriptor |
findFirstConcreteClass(ClassDescriptor cld)
Return the first found concrete class ClassDescriptor . |
java.util.Collection |
getAllConcreteSubclassDescriptors(ClassDescriptor aCld)
Utility method to discover all concrete subclasses of a given super class. |
java.util.List |
getAllConcreteSubclassesOf(ClassDescriptor aCld)
Deprecated. use getAllConcreteSubclassDescriptors |
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 |
int |
getDefaultIsolationLevel()
Returns the defaultIsolationLevel. |
ClassDescriptor |
getDescriptorFor(java.lang.Class c)
lookup a ClassDescriptor in the internal Hashtable |
ClassDescriptor |
getDescriptorFor(java.lang.String strClassName)
lookup a ClassDescriptor in the internal Hashtable |
java.util.Map |
getDescriptorTable()
|
FieldDescriptor[] |
getFieldDescriptorsForMultiMappedTable(ClassDescriptor targetCld)
|
java.lang.Class |
getTopLevelClass(java.lang.Class clazz)
Returns the top level (extent) class to which the given class belongs. |
static java.lang.String |
getVersion()
|
boolean |
hasDescriptorFor(java.lang.Class c)
Checks if repository contains given class. |
java.util.Iterator |
iterator()
Returns an iterator over all managed ClassDescriptor . |
void |
put(java.lang.Class c,
ClassDescriptor cld)
Add a ClassDescriptor to the internal Hashtable Set the Repository for ClassDescriptor |
void |
put(java.lang.String classname,
ClassDescriptor cld)
Add a ClassDescriptor to the internal Hashtable Set the Repository for ClassDescriptor |
void |
remove(java.lang.Class clazz)
|
void |
remove(java.lang.String className)
|
void |
setClassDescriptor(ClassDescriptor cld)
Convenience for put(Class c, ClassDescriptor cld) |
void |
setDefaultIsolationLevel(int defaultIsolationLevel)
Sets the defaultIsolationLevel. |
java.lang.String |
toString()
returns a string representation |
java.lang.String |
toXML()
returns the XML marshalled version of this instance. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public DescriptorRepository() throws PersistenceBrokerException
Method Detail |
public static java.lang.String getVersion()
public java.lang.Class getTopLevelClass(java.lang.Class clazz) throws ClassNotPersistenceCapableException
ClassNotPersistenceCapableException
- if clazz is not persistence capable,
i.e. if clazz is not defined in the DescriptorRepository.public FieldDescriptor[] getFieldDescriptorsForMultiMappedTable(ClassDescriptor targetCld)
public java.util.Map getDescriptorTable()
public ClassDescriptor findFirstConcreteClass(ClassDescriptor cld)
ClassDescriptor
.
This means a class which is not an interface or an abstract class.
If given class descriptor is a concrete class, given class descriptor
was returned. If no concrete class can be found null
will be
returned.
public java.util.List getAllConcreteSubclassesOf(ClassDescriptor aCld)
public java.util.Collection getAllConcreteSubclassDescriptors(ClassDescriptor aCld)
public boolean hasDescriptorFor(java.lang.Class c)
public ClassDescriptor getDescriptorFor(java.lang.String strClassName) throws ClassNotPersistenceCapableException
strClassName
- a fully qualified class name as it is returned by Class.getName().
ClassNotPersistenceCapableException
public ClassDescriptor getDescriptorFor(java.lang.Class c) throws ClassNotPersistenceCapableException
ClassNotPersistenceCapableException
public void setClassDescriptor(ClassDescriptor cld)
put(Class c, ClassDescriptor cld)
public void put(java.lang.Class c, ClassDescriptor cld)
public void put(java.lang.String classname, ClassDescriptor cld)
public void remove(java.lang.String className)
public void remove(java.lang.Class clazz)
public java.util.Iterator iterator()
ClassDescriptor
.
public int getDefaultIsolationLevel()
public void setDefaultIsolationLevel(int defaultIsolationLevel)
defaultIsolationLevel
- The defaultIsolationLevel to setpublic java.lang.String toString()
public java.lang.String toXML()
XmlCapable
toXML
in interface XmlCapable
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)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |