public final class DescriptorRepository extends java.lang.Object implements java.io.Serializable, XmlCapable, IsolationLevels
MetadataManager
)._NEXT, ACCEPT_LOCKS, ACCESS, ATTRIBUTE, ATTRIBUTE_NAME, ATTRIBUTE_VALUE, AUTO_DELETE, AUTO_INCREMENT, AUTO_RETRIEVE, AUTO_UPDATE, BATCH_MODE, CASCADE_LINK_STR, CASCADE_NONE_STR, CASCADE_OBJECT_STR, CLASS_DESCRIPTOR, CLASS_EXTENT, CLASS_NAME, CLASS_PROXY, CLASS_REF, COLLECTION_CLASS, COLLECTION_DESCRIPTOR, COLUMN_NAME, CON_LOG_ABANDONED, CON_MAX_ACTIVE, CON_MAX_IDLE, CON_MAX_WAIT, CON_MIN_EVICTABLE_IDLE_TIME_MILLIS, CON_NUM_TESTS_PER_EVICTION_RUN, CON_REMOVE_ABANDONED, CON_REMOVE_ABANDONED_TIMEOUT, CON_TEST_ON_BORROW, CON_TEST_ON_RETURN, CON_TEST_WHILE_IDLE, CON_TIME_BETWEEN_EVICTION_RUNS_MILLIS, CON_WHEN_EXHAUSTED_ACTION, CONNECTION_FACTORY, CONNECTION_POOL, CONSTANT_ARGUMENT, DATASOURCE_NAME, DBMS_NAME, DEFAULT_CONNECTION, DELETE_PROCEDURE, DOCUMENTATION, DRIVER_NAME, EAGER_RELEASE, EXTENDS, FACTORY_CLASS, FACTORY_METHOD, FIELD_CONVERSION, FIELD_DESCRIPTOR, FIELD_ID_REF, FIELD_NAME, FIELD_REF, FK_POINTING_TO_ITEMS_CLASS, FK_POINTING_TO_THIS_CLASS, FOREIGN_KEY, ID, IGNORE_AUTOCOMMIT_EXCEPTION, INCLUDE_ALL_FIELDS, INCLUDE_PK_FIELDS_ONLY, INDEX_COLUMN, INDEX_DESCRIPTOR, INDEXED, INDIRECTION_TABLE, INITIALIZATION_METHOD, INSERT_PROCEDURE, INVERSE_FK, ISOLATION_LEVEL, ITEMS_CLASS, JCD_ALIAS, JDBC_CONNECTION_DESCRIPTOR, JDBC_LEVEL, JDBC_TYPE, LENGTH, LOCKING, MAPPING_REPOSITORY, NAME, NULLABLE, OBJECT_CACHE, ORDERBY, OTM_DEPENDENT, PRECISION, PRIMARY_KEY, PROXY_PREFETCHING_LIMIT, PROXY_REFERENCE, QUERY_CUSTOMIZER, REFERENCE_DESCRIPTOR, REFERENCED_CLASS, REFRESH, REPOSITORY_VERSION, RETURN, RETURN_FIELD_REF, ROW_READER, RUNTIME_ARGUMENT, SCALE, SCHEMA_NAME, SEQUENCE_MANAGER, SEQUENCE_MANAGER_CLASS, SEQUENCE_NAME, SORT, TABLE_NAME, TAG_ACCESS, TAG_ACCESS_ANONYMOUS, TAG_ACCESS_READONLY, TAG_ACCESS_READWRITE, TAG_SUPER, UNIQUE, UPDATE_LOCK, UPDATE_PROCEDURE, URL_DBALIAS, URL_PROTOCOL, URL_SUBPROTOCOL, USE_AUTOCOMMIT, USER_NAME, USER_PASSWD, VALIDATION_QUERY, VALUE
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 and Description |
---|
DescriptorRepository()
Constructor declaration
|
Modifier and Type | Method and Description |
---|---|
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.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.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.
|
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[] |
getSubClassesMultipleJoinedTables(ClassDescriptor cld,
boolean wholeTree)
Return sub-classes of the specified class using the
"super"-Reference concept.
|
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.
|
public DescriptorRepository() throws PersistenceBrokerException
PersistenceBrokerException
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.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
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 java.lang.Class[] getSubClassesMultipleJoinedTables(ClassDescriptor cld, boolean wholeTree)
cld
- The ClassDescriptor
of the class to search for sub-classes.wholeTree
- If set true, the whole sub-class tree of the specified
class will be returned. If false only the direct sub-classes of the specified class
will be returned.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 presentAttributeContainer.getAttribute(String, String)
public java.lang.String getAttribute(java.lang.String attributeName)
AttributeContainer
getAttribute
in interface AttributeContainer
attributeName
- the attribute to retrieveAttributeContainer.getAttribute(String)
public java.util.Map getAttributes()
public java.lang.String[] getAttributeNames()
null
)(C) 2002 - 2005 Apache Software Foundation
All rights reserved. Published under the Apache License 2.0.
http://db.apache.org/ojb
Version: 1.0.4, 2005-12-30