Class FieldDescriptorJDONature
- java.lang.Object
-
- org.castor.core.nature.BaseNature
-
- org.exolab.castor.jdo.engine.nature.FieldDescriptorJDONature
-
- All Implemented Interfaces:
Nature
public class FieldDescriptorJDONature extends BaseNature
JDO-specific nature forFieldDescriptor.
AugmentsFieldDescriptorto include persistence-specific data such as e.g. the column names, types and other SQL-related information.
To access persistence-specific data of aFieldDescriptor, use the following code fragment to ...- check for this nature
- apply this nature to the
FieldDescriptorin question. - access e.g. the column name.
FieldDescriptor fieldDescriptor = ...; ... if (fieldDescriptor.hasNature(FieldDescriptorJDONature.class.getName()) { 1) FieldDescriptorJDONature nature = new FieldDescriptorJDONature(fieldDescriptor); 2) ... String columnName = nature.getColumnName; 3) }- Since:
- 1.2.1
- Author:
- Werner Guttmann
-
-
Constructor Summary
Constructors Constructor Description FieldDescriptorJDONature(PropertyHolder holder)Creates an instance ofFieldDescriptorJDONature.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StringgetCascading()Returns the cascading types for the given field.TypeConvertorgetConvertor()Returns the convertor from the field type to an external type.java.lang.StringgetId()Returns the fully qualified name of the Nature.java.lang.String[]getManyKey()Returns the SQL many key of the field.java.lang.StringgetManyTable()Returns the SQL many table of the field.java.lang.String[]getSQLName()Returns the SQL (column) name of the field.int[]getSQLType()Returns the SQL type of this field.booleanisDirtyCheck()Returns true if dirty checking is required for this field.booleanisReadonly()Returns true if field access is read only.booleanisTransient()Returns true if transient is set for this field.voidsetCascading(java.lang.String cascading)Sets the cascading values for the given field.voidsetDirtyCheck(boolean dirtyCheck)Sets whether dirty checking is required for this field.voidsetManyKey(java.lang.String[] manyKey)Sets the SQL many key of the field.voidsetManyTable(java.lang.String manyTable)Sets the SQL many table of the field.voidsetReadOnly(boolean readOnly)Sets whether field access if read-only.voidsetSQLName(java.lang.String[] sqlName)Sets the SQL (column) name of the field.voidsetSQLType(int[] sqlType)Sets the SQL type of this field.voidsetTransient(boolean isTransient)Sets whether this field should be transient.voidsetTypeConvertor(TypeConvertor typeConvertor)Sets theTypeConvertorused for converting from field types to external types.-
Methods inherited from class org.castor.core.nature.BaseNature
getBooleanPropertyDefaultFalse, getHolder, getProperty, getPropertyAsList, getPropertyAsMap, setProperty
-
-
-
-
Constructor Detail
-
FieldDescriptorJDONature
public FieldDescriptorJDONature(PropertyHolder holder)
Creates an instance ofFieldDescriptorJDONature.- Parameters:
holder- ThePropertyHolderto 'view upon'.
-
-
Method Detail
-
getId
public java.lang.String getId()
Returns the fully qualified name of the Nature.- Returns:
- qualified name of the nature.
- See Also:
Nature.getId()
-
getSQLName
public java.lang.String[] getSQLName()
Returns the SQL (column) name of the field.- Returns:
- The SQL (column) name.
-
setSQLName
public void setSQLName(java.lang.String[] sqlName)
Sets the SQL (column) name of the field.- Parameters:
sqlName- The SQL (column) name.
-
getManyKey
public java.lang.String[] getManyKey()
Returns the SQL many key of the field.- Returns:
- The SQL many key.
-
setManyKey
public void setManyKey(java.lang.String[] manyKey)
Sets the SQL many key of the field.- Parameters:
manyKey- The SQL (many key.
-
getManyTable
public java.lang.String getManyTable()
Returns the SQL many table of the field.- Returns:
- The SQL many table.
-
setManyTable
public void setManyTable(java.lang.String manyTable)
Sets the SQL many table of the field.- Parameters:
manyTable- The SQL many table.
-
isReadonly
public boolean isReadonly()
Returns true if field access is read only.- Returns:
- True if field access is read-only.
-
setReadOnly
public void setReadOnly(boolean readOnly)
Sets whether field access if read-only.- Parameters:
readOnly- True if field access is read-only.
-
isDirtyCheck
public boolean isDirtyCheck()
Returns true if dirty checking is required for this field.- Returns:
- True if dirty checking required
-
setDirtyCheck
public void setDirtyCheck(boolean dirtyCheck)
Sets whether dirty checking is required for this field.- Parameters:
dirtyCheck- True if dirty checking is required for this field.
-
getConvertor
public TypeConvertor getConvertor()
Returns the convertor from the field type to an external type.- Returns:
- Convertor from field type
-
setTypeConvertor
public void setTypeConvertor(TypeConvertor typeConvertor)
Sets theTypeConvertorused for converting from field types to external types.- Parameters:
typeConvertor-TypeConvertorto be used.
-
getSQLType
public int[] getSQLType()
Returns the SQL type of this field.- Returns:
- The SQL type of this field
-
setSQLType
public void setSQLType(int[] sqlType)
Sets the SQL type of this field.- Parameters:
sqlType- The SQL type of this field.
-
isTransient
public boolean isTransient()
Returns true if transient is set for this field.- Returns:
- True if this field should be transient.
-
setTransient
public void setTransient(boolean isTransient)
Sets whether this field should be transient.- Parameters:
lazy- True if this field should be transient.
-
getCascading
public java.lang.String getCascading()
Returns the cascading types for the given field.- Returns:
- The cascading values.
-
setCascading
public void setCascading(java.lang.String cascading)
Sets the cascading values for the given field.- Parameters:
cascading- The cascading values to be set.
-
-