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

java.lang.Object
  extended by org.castor.cpa.persistence.sql.engine.info.TableInfo
      extended by org.castor.cpa.persistence.sql.engine.info.EntityTableInfo

public final class EntityTableInfo
extends TableInfo

Class representing a table for an entity.

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

Constructor Summary
protected EntityTableInfo(String tableName)
          Constructor taking tableName in order to construct table that holds his name only.
 
Method Summary
protected  void addExtendingTable(EntityTableInfo table)
          Add table that is extending this one.
protected  void addForeignKey(ForeignKeyInfo foreignKey)
          Add foreign key.
protected  void addForeignReference(ForeignReferenceInfo foreignReference)
          Add foreign reference.
protected  void addPrimaryKeyColumn(String fieldName, String name, int type, TypeConvertor convertFrom)
          Add primary key column.
protected  void addSimpleColumn(int fieldIndex, String fieldName, String name, int type, TypeConvertor convertFrom, boolean store, boolean dirty)
          Add simple column.
 EntityTableInfo getExtendedTable()
          Method returning extendedTable currently set.
 List<EntityTableInfo> getExtendingTables()
          Method returning list of tables extending this one.
 List<ForeignKeyInfo> getForeignKeys()
          Method returning foreign keys currently set.
 List<ForeignReferenceInfo> getForeignReferences()
          Method returning foreign references currently set.
 List<ColumnInfo> getPrimaryKeyColumns()
          Method returning columns currently set.
 List<ColumnInfo> getSimpleColumns()
          Method returning columns currently set.
protected  void setExtendedTable(EntityTableInfo table)
          Set table extended by this one.
 List<ColumnValue> toSQL(Identity identity)
          Method appending values from passed identity to corresponding columns.
 List<ColumnValue> toSQL(Object[] input)
          Method appending values from passed array to corresponding columns.
 
Methods inherited from class org.castor.cpa.persistence.sql.engine.info.TableInfo
getTableName, toSQL
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EntityTableInfo

protected EntityTableInfo(String tableName)
Constructor taking tableName in order to construct table that holds his name only.

Parameters:
tableName - Name of the table to be constructed.
Method Detail

setExtendedTable

protected void setExtendedTable(EntityTableInfo table)
Set table extended by this one.

Parameters:
table - Table extended by this one.

addExtendingTable

protected void addExtendingTable(EntityTableInfo table)
Add table that is extending this one.

Parameters:
table - Extending table to add.

addPrimaryKeyColumn

protected void addPrimaryKeyColumn(String fieldName,
                                   String name,
                                   int type,
                                   TypeConvertor convertFrom)
Add primary key column.

Parameters:
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.

addSimpleColumn

protected void addSimpleColumn(int fieldIndex,
                               String fieldName,
                               String name,
                               int type,
                               TypeConvertor convertFrom,
                               boolean store,
                               boolean dirty)
Add simple column.

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.
store - Flag telling if column is persistent or not.
dirty - Flag telling if this column was changed or not.

addForeignKey

protected void addForeignKey(ForeignKeyInfo foreignKey)
Add foreign key.

Parameters:
foreignKey - Foreign key to add.

addForeignReference

protected void addForeignReference(ForeignReferenceInfo foreignReference)
Add foreign reference.

Parameters:
foreignReference - Foreign reference to add.

getExtendedTable

public EntityTableInfo getExtendedTable()
Method returning extendedTable currently set.

Returns:
ExtendedTable currently set.

getExtendingTables

public List<EntityTableInfo> getExtendingTables()
Method returning list of tables extending this one.

Returns:
List of extending tables.

getPrimaryKeyColumns

public List<ColumnInfo> getPrimaryKeyColumns()
Method returning columns currently set.

Returns:
List of columns currently set.

getSimpleColumns

public List<ColumnInfo> getSimpleColumns()
Method returning columns currently set.

Returns:
List of columns currently set.

getForeignKeys

public List<ForeignKeyInfo> getForeignKeys()
Method returning foreign keys currently set.

Returns:
List of foreign keys currently set.

getForeignReferences

public List<ForeignReferenceInfo> getForeignReferences()
Method returning foreign references currently set.

Returns:
List of foreign references currently set.

toSQL

public List<ColumnValue> toSQL(Identity identity)
Method appending values from passed identity to corresponding columns.

Parameters:
identity - Identity containing values to be assigned to corresponding columns.
Returns:
List containing all columns with their corresponding values.

toSQL

public List<ColumnValue> toSQL(Object[] input)
Method appending values from passed array to corresponding columns.

Parameters:
input - Identity containing values to be assigned to corresponding columns.
Returns:
List containing all columns with their corresponding values.


Copyright © 2012. All Rights Reserved.