|
|||||||||
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 | |
(package private) static long |
serialVersionUID
|
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. |
(package private) void |
addExtent(java.lang.String classname,
ClassDescriptor cld)
Add a pair of extent/classdescriptor to the extentTable to gain speed while retrieval of extents. |
protected ClassDescriptor |
discoverDescriptor(java.lang.String className)
Starts by looking to see if the className is
already mapped specifically to the descritpor repository. |
protected void |
finalize()
|
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)
|
protected java.lang.String |
getIsolationLevelAsString()
returns IsolationLevel literal as matching to the corresponding id |
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)
|
(package private) void |
removeExtent(java.lang.String classname)
Remove a pair of extent/classdescriptor from the extentTable. |
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 |
clone, equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
static final long serialVersionUID
Constructor Detail |
public DescriptorRepository() throws PersistenceBrokerException
Method Detail |
public static java.lang.String getVersion()
void addExtent(java.lang.String classname, ClassDescriptor cld)
classname
- the name of the extent itselfcld
- the class descriptor, where it belongs tovoid removeExtent(java.lang.String classname)
classname
- the name of the extent itselfpublic 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()
toString
in class DescriptorBase
public java.lang.String toXML()
XmlCapable
toXML
in interface XmlCapable
protected java.lang.String getIsolationLevelAsString()
protected ClassDescriptor discoverDescriptor(java.lang.String className)
className
is
already mapped specifically to the descritpor repository.
If the className
is not specifically mapped we
look at the className
's parent class for a mapping.
We do this until the parent class is of the type
java.lang.Object
. If no mapping was found,
null
is returned. Mappings successfuly discovered
through inheritence are added to the internal table of
class descriptors to improve performance on subsequent requests
for those classes.
className
- name of class whose descriptor we need to find.
className
or null
if no ClassDescriptor could be located.protected void finalize() throws java.lang.Throwable
java.lang.Throwable
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 |