|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.castor.core.nature.BaseNature
org.exolab.castor.jdo.engine.nature.ClassDescriptorJDONature
public class ClassDescriptorJDONature
JDO-specific nature for ClassDescriptor.
Augments ClassDescriptor to include persistence-specific data such as
e.g. the table name, cache parameter, key generators, access mode and other
SQL-related information.
To access persistence-specific data of a ClassDescriptor, use the
following code fragment to ...
ClassDescriptor in question.
ClassDescriptor classDescriptor = ...;
...
if (classDescriptor.hasNature(ClassDescriptorJDONature.class.getName()) { 1)
ClassDescriptorJDONature nature = new ClassDescriptorJDONature(classDescriptor); 2)
...
String tableName = nature.getTableName(); 3)
}
| Constructor Summary | |
|---|---|
ClassDescriptorJDONature(PropertyHolder holder)
Creates an instance of ClassDescriptorJDONature. |
|
| Method Summary | |
|---|---|
void |
addCacheParam(String key,
String value)
Adds a cache parameter to this ClassDescriptor. |
void |
addExtended(ClassDescriptor classDesc)
Adds a ClassDescriptor that extends this class. |
void |
addNamedNativeQuery(String name,
NamedNativeQuery query)
Adds a named query to this ClassDescriptor. |
void |
addNamedQuery(String name,
String query)
Adds a named query to this ClassDescriptor. |
AccessMode |
getAccessMode()
Returns the access mode to which this object maps. |
Properties |
getCacheParams()
Returns the cache parameters defined for this ClassDescriptor. |
Collection<ClassDescriptor> |
getExtended()
Returns a collection of ClassDescriptors that extend this class (descriptor). |
FieldDescriptor |
getField(String name)
Returns the FieldDescriptor for the given name. |
String |
getId()
|
KeyGeneratorDescriptor |
getKeyGeneratorDescriptor()
Get key generator specified for this class. |
Map<String,NamedNativeQuery> |
getNamedNativeQueries()
Get map of named native queries associated with their names. |
Map<String,String> |
getNamedQueries()
Get map of named query strings associated with their names. |
String |
getTableName()
Returns the table name to which this object maps. |
String |
getVersionField()
Returns the name of the version field used for checks on object modifications. |
void |
setAccessMode(AccessMode accessMode)
Sets the access mode to which this ClassDescriptor maps. |
void |
setKeyGeneratorDescriptor(KeyGeneratorDescriptor keyGenDesc)
Set key generator specified for this class. |
void |
setTableName(String tableName)
Sets the table name to which this object maps. |
void |
setVersionField(String versionField)
Sets the version field to use for object modification checks. |
| Methods inherited from class org.castor.core.nature.BaseNature |
|---|
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ClassDescriptorJDONature(PropertyHolder holder)
ClassDescriptorJDONature.
holder - The PropertyHolder to 'view upon'.| Method Detail |
|---|
public String getId()
Nature.getId()public void setTableName(String tableName)
tableName - Table namepublic String getTableName()
public void setAccessMode(AccessMode accessMode)
ClassDescriptor maps.
accessMode - The access mode to be used.public AccessMode getAccessMode()
public void setKeyGeneratorDescriptor(KeyGeneratorDescriptor keyGenDesc)
keyGenDesc - Key generator descriptor.public KeyGeneratorDescriptor getKeyGeneratorDescriptor()
public void addCacheParam(String key,
String value)
ClassDescriptor.
key - The cache parameter key.value - The cache parameter value.public Properties getCacheParams()
ClassDescriptor.
public void addNamedQuery(String name,
String query)
ClassDescriptor.
name - The name of the named query.query - The query stringpublic Map<String,String> getNamedQueries()
public String getVersionField()
null if not set.
public void addNamedNativeQuery(String name,
NamedNativeQuery query)
ClassDescriptor.
name - The name of the named query.query - The query stringpublic Map<String,NamedNativeQuery> getNamedNativeQueries()
public FieldDescriptor getField(String name)
FieldDescriptor for the given name.
name - A field name.
FieldDescriptor.public void addExtended(ClassDescriptor classDesc)
ClassDescriptor that extends this class.
classDesc - A ClassDescriptor that extends this class.public Collection<ClassDescriptor> getExtended()
ClassDescriptors that extend this class (descriptor).
ClassDescriptors that extend this class.public void setVersionField(String versionField)
versionField - the name of the field.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||