org.castor.cpa.persistence.sql.engine.info
Class ColumnInfo

java.lang.Object
  extended by org.castor.cpa.persistence.sql.engine.info.ColumnInfo
All Implemented Interfaces:
Cloneable

public final class ColumnInfo
extends Object
implements Cloneable

Class representing columns belonging to a table.

Version:
$Revision: 8994 $ $Date: 2011-08-02 01:40:59 +0200 (Di, 02 Aug 2011) $
Author:
Dennis Butterstein, Ralf Joachim

Constructor Summary
protected ColumnInfo(int fieldIndex, String fieldName, String name, int type, TypeConvertor convertFrom, boolean primaryKey, boolean store, boolean dirty)
          Constructor with all given values.
 
Method Summary
 int getFieldIndex()
          Get index of the field in array of field values.
 String getFieldName()
          Get name of field in mapping.
 String getName()
          Method returning name of this column.
 int getType()
          Method returning SQL type currently set.
 boolean isDirty()
          Method returning dirty flag.
 boolean isPrimaryKey()
          Method returning primary flag.
 boolean isStore()
          Method returning store flag.
protected  Object toSQL(Object object)
          Method to translate java data types to sql data types.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ColumnInfo

protected ColumnInfo(int fieldIndex,
                     String fieldName,
                     String name,
                     int type,
                     TypeConvertor convertFrom,
                     boolean primaryKey,
                     boolean store,
                     boolean dirty)
Constructor with all given values.

Parameters:
fieldIndex - Index of the field in array of field values.
fieldName - Name of field in mapping.
name - Name of this column.
type - SQL type of this column.
convertFrom - Converter to convert value of this column.
primaryKey - Flag telling if column belongs to primary key or not.
store - Flag telling if column is persistent or not.
dirty - Flag telling if this column was changed or not.
Method Detail

getFieldIndex

public int getFieldIndex()
Get index of the field in array of field values. This does not correspond to fields in mapping as transient fields ignored and are not counted here.

Returns:
Index of the field in array of field values.

getFieldName

public String getFieldName()
Get name of field in mapping.

Returns:
Name of field in mapping.

getName

public String getName()
Method returning name of this column.

Returns:
Name of this column.

getType

public int getType()
Method returning SQL type currently set.

Returns:
SQL type currently set.

isPrimaryKey

public boolean isPrimaryKey()
Method returning primary flag.

Returns:
Primary flag.

isStore

public boolean isStore()
Method returning store flag.

Returns:
Store flag.

isDirty

public boolean isDirty()
Method returning dirty flag.

Returns:
Dirty flag.

toSQL

protected Object toSQL(Object object)
Method to translate java data types to sql data types.

Parameters:
object - Object to be translated to sql data type.
Returns:
Object converted to sql data type.


Copyright © 2012. All Rights Reserved.