org.exolab.castor.builder.info.nature
Class JDOClassInfoNature

java.lang.Object
  extended by org.castor.core.nature.BaseNature
      extended by org.exolab.castor.builder.info.nature.JDOClassInfoNature

public final class JDOClassInfoNature
extends BaseNature

A JDO specific view of a ClassInfo. Implementation on property based ClassInfo access. TODO Add key generator support.

Since:
1.2.1
Author:
Tobias Hochwallner

Constructor Summary
JDOClassInfoNature(ClassInfo classInfo)
           
 
Method Summary
 void addPrimaryKey(java.lang.String column)
          Adds a column to the primary key.
 AccessMode getAccessMode()
          Returns the AccessMode.
 boolean getDetachable()
          Indicates whether the entity in question is 'detachable'.
 java.util.List<JDOFieldInfoNature> getFields()
          Returns a List of JDOFieldInfoNatures of all FieldInfos if the field has a a JDOFieldInfoNature or an empty List if no field has the Nature.
 java.lang.String getId()
          Returns the id of the Nature.
 java.util.List<java.lang.String> getPrimaryKeys()
          Returns a List of s holding the columns of the primary key.
 java.lang.String getTableName()
          Returns the table name.
 void setAccessMode(AccessMode accessMode)
          Sets the AccessMode to the given AccessMode.
 void setDetachable(boolean detachable)
          Sets whether the entity is 'detachable'.
 void setTableName(java.lang.String tableName)
          Sets the table name to the given String.
 
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

JDOClassInfoNature

public JDOClassInfoNature(ClassInfo classInfo)
Parameters:
classInfo - the classinfo in focus.
Method Detail

getId

public java.lang.String getId()
Returns the id of the Nature. Implementation returns the fully qualified class name.

Returns:
the id.
See Also:
org.exolab.castor.builder.info.nature.Nature#getId()

addPrimaryKey

public void addPrimaryKey(java.lang.String column)
Adds a column to the primary key. The order of the key columns is not guaranteed.

Parameters:
column - column name

getPrimaryKeys

public java.util.List<java.lang.String> getPrimaryKeys()
Returns a List of s holding the columns of the primary key. Keep in mind that by contract of addPrimaryKey(String primaryKey) the order is not guaranteed.

Returns:
the names of the primary key's columns or null if no key added before.

getTableName

public java.lang.String getTableName()
Returns the table name.

Returns:
the SQL table Name

setTableName

public void setTableName(java.lang.String tableName)
Sets the table name to the given String.

Parameters:
tableName - of the SQL table.

setAccessMode

public void setAccessMode(AccessMode accessMode)
Sets the AccessMode to the given AccessMode.

Parameters:
accessMode - access mode

getAccessMode

public AccessMode getAccessMode()
Returns the AccessMode.

Returns:
access mode of the jdo entity.

setDetachable

public void setDetachable(boolean detachable)
Sets whether the entity is 'detachable'.

Parameters:
detachable - True if entity should be detachable

getDetachable

public boolean getDetachable()
Indicates whether the entity in question is 'detachable'.

Returns:
True if the entity is 'detachable'.

getFields

public java.util.List<JDOFieldInfoNature> getFields()
Returns a List of JDOFieldInfoNatures of all FieldInfos if the field has a a JDOFieldInfoNature or an empty List if no field has the Nature. Included are attribute, text and element fields.

Returns:
List of JDOFieldInfoNatures.


Copyright © 2011. All Rights Reserved.