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

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

public final class ForeignKeyInfo
extends Object

Class representing a foreign key from one table to another.

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

Constructor Summary
protected ForeignKeyInfo(int fieldIndex, String fieldName, TableInfo fromTable, EntityTableInfo toTable, String toAlias)
          Construct a foreign key.
 
Method Summary
protected  void addFromColumn(ColumnInfo column)
          Add from column.
 int getFieldIndex()
          Get index of the field in array of field values.
 String getFieldName()
          Get name of field in mapping.
 List<ColumnInfo> getFromColumns()
          Method returning list of columns of the foreign key.
 TableInfo getFromTable()
          Method returning the table that holds the foreign key.
 String getToAlias()
          Method returning the alias of the table referenced by the foreign key.
 EntityTableInfo getToTable()
          Method returning the table referenced by the foreign key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ForeignKeyInfo

protected ForeignKeyInfo(int fieldIndex,
                         String fieldName,
                         TableInfo fromTable,
                         EntityTableInfo toTable,
                         String toAlias)
Construct a foreign key.

Parameters:
fieldIndex - Index of the field in array of field values.
fieldName - Name of field in mapping.
fromTable - Table that holds the foreign key.
toTable - Table referenced by the foreign key.
toAlias - Alias of the table referenced by the foreign key.
Method Detail

addFromColumn

protected void addFromColumn(ColumnInfo column)
Add from column.

Parameters:
column - Column to add to from columns.

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.

getFromTable

public TableInfo getFromTable()
Method returning the table that holds the foreign key.

Returns:
Table that holds the foreign key.

getFromColumns

public List<ColumnInfo> getFromColumns()
Method returning list of columns of the foreign key.

Returns:
List of columns of the foreign key

getToTable

public EntityTableInfo getToTable()
Method returning the table referenced by the foreign key.

Returns:
Table referenced by the foreign key.

getToAlias

public String getToAlias()
Method returning the alias of the table referenced by the foreign key.

Returns:
Alias of the table referenced by the foreign key.


Copyright © 2012. All Rights Reserved.