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

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

public final class ForeignReferenceInfo
extends Object

Class representing a foreign reference 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 ForeignReferenceInfo(int fieldIndex, String fieldName, EntityTableInfo toTable, TableInfo fromTable, String fromAlias)
          Construct a foreign reference.
 
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.
 String getFromAlias()
          Method returning the alias of the table that holds the foreign key.
 List<ColumnInfo> getFromColumns()
          Method returning list of columns of the foreign key.
 TableInfo getFromTable()
          Method returning the table that holds 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

ForeignReferenceInfo

protected ForeignReferenceInfo(int fieldIndex,
                               String fieldName,
                               EntityTableInfo toTable,
                               TableInfo fromTable,
                               String fromAlias)
Construct a foreign reference.

Parameters:
fieldIndex - Index of the field in array of field values.
fieldName - Name of field in mapping.
toTable - Table referenced by the foreign key.
fromTable - Table that holds the foreign key.
fromAlias - Alias of the table that holds 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.

getToTable

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

Returns:
Table referenced by the foreign key.

getFromTable

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

Returns:
Table that holds the foreign key.

getFromAlias

public String getFromAlias()
Method returning the alias of the table that holds the foreign key.

Returns:
Alias of the 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


Copyright © 2012. All Rights Reserved.