Nature
public class ClassDescriptorJDONature extends BaseNature
ClassDescriptor
.ClassDescriptor
to include persistence-specific data such as
e.g. the table name, cache parameter, key generators, access mode and other
SQL-related information.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 | Description |
---|---|
ClassDescriptorJDONature(PropertyHolder holder) |
Creates an instance of
ClassDescriptorJDONature . |
Modifier and Type | Method | Description |
---|---|---|
void |
addCacheParam(java.lang.String key,
java.lang.String value) |
Adds a cache parameter to this
ClassDescriptor . |
void |
addExtended(ClassDescriptor classDesc) |
Adds a
ClassDescriptor that extends this class. |
void |
addNamedNativeQuery(java.lang.String name,
NamedNativeQuery query) |
Adds a named query to this
ClassDescriptor . |
void |
addNamedQuery(java.lang.String name,
java.lang.String query) |
Adds a named query to this
ClassDescriptor . |
AccessMode |
getAccessMode() |
Returns the access mode to which this object maps.
|
java.util.Properties |
getCacheParams() |
Returns the cache parameters defined for this
ClassDescriptor . |
java.util.Collection<ClassDescriptor> |
getExtended() |
Returns a collection of
ClassDescriptor s that extend this class (descriptor). |
FieldDescriptor |
getField(java.lang.String name) |
Returns the
FieldDescriptor for the given name. |
java.lang.String |
getId() |
Returns the fully qualified name of the Nature.
|
KeyGeneratorDescriptor |
getKeyGeneratorDescriptor() |
Get key generator specified for this class.
|
java.util.Map<java.lang.String,NamedNativeQuery> |
getNamedNativeQueries() |
Get map of named native queries associated with their names.
|
java.util.Map<java.lang.String,java.lang.String> |
getNamedQueries() |
Get map of named query strings associated with their names.
|
java.lang.String |
getTableName() |
Returns the table name to which this object maps.
|
java.lang.String |
getVersionField() |
Returns the name of the version field used for checks on object
modifications.
|
boolean |
hasMappedSuperclass() |
Returns if class has mapped super class.
|
void |
setAbstract(java.lang.Boolean hasMappedSuperclass) |
Set class to abstract
|
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(java.lang.String tableName) |
Sets the table name to which this object maps.
|
void |
setVersionField(java.lang.String versionField) |
Sets the version field to use for object modification checks.
|
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
public ClassDescriptorJDONature(PropertyHolder holder)
ClassDescriptorJDONature
.holder
- The PropertyHolder
to 'view upon'.public java.lang.String getId()
Nature.getId()
public void setAbstract(java.lang.Boolean hasMappedSuperclass)
abstract
- Booleanpublic boolean hasMappedSuperclass()
public void setTableName(java.lang.String tableName)
tableName
- Table namepublic java.lang.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(java.lang.String key, java.lang.String value)
ClassDescriptor
.key
- The cache parameter key.value
- The cache parameter value.public java.util.Properties getCacheParams()
ClassDescriptor
.public void addNamedQuery(java.lang.String name, java.lang.String query)
ClassDescriptor
.name
- The name of the named query.query
- The query stringpublic java.util.Map<java.lang.String,java.lang.String> getNamedQueries()
public java.lang.String getVersionField()
null
if not set.public void addNamedNativeQuery(java.lang.String name, NamedNativeQuery query)
ClassDescriptor
.name
- The name of the named query.query
- The query stringpublic java.util.Map<java.lang.String,NamedNativeQuery> getNamedNativeQueries()
public FieldDescriptor getField(java.lang.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 java.util.Collection<ClassDescriptor> getExtended()
ClassDescriptor
s that extend this class (descriptor).ClassDescriptor
s that extend this class.public void setVersionField(java.lang.String versionField)
versionField
- the name of the field.Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com