toolkit.db.api
Class ColumnInfo

java.lang.Object
  extended by toolkit.db.api.ColumnInfo

public class ColumnInfo
extends java.lang.Object

Class ColumnInfo wraps all information of related columns.


Field Summary
static int NON_REF_SELECT_COLUMN
          Indicates that this column is a selected column, but is not referenced in runtime PSQL query.
static int NON_SELECT_COLUMN
          Indicates that this column is not a selected column.
 
Constructor Summary
ColumnInfo(java.lang.String sMappingName, java.lang.String sColumnName, java.lang.String sExpression, boolean bCompCol, TableInfo tableInfo, int iColumnIndex)
          Constructs a ColumnInfo with specified parameters.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Compares this ColumnInfo to the specified object.
 int getColumnIndex()
          Gets the index of where this column should appear in Select clause when creating an sql string.
 java.lang.String getColumnName()
          Gets the real database name of this column.
 java.lang.String getExpression()
          Gets the expression of this column.
 java.lang.String getMappingName()
          Gets the mapping name of the column.
 TableInfo getTable()
          Gets TableInfo of the table that this column belongs to.
 boolean isCompCol()
          Gets whether this is a computed column.
 java.lang.String toString()
          Returns a string representing this ColumnInfo's values.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NON_SELECT_COLUMN

public static final int NON_SELECT_COLUMN
Indicates that this column is not a selected column. It's just a PSQL column of a PSQL table, so it should not appear in Select clause either at design time or at runtime.

See Also:
Constant Field Values

NON_REF_SELECT_COLUMN

public static final int NON_REF_SELECT_COLUMN
Indicates that this column is a selected column, but is not referenced in runtime PSQL query. That is to say, it should appear in Select clause of the raw SQL statement at design time, but should not appear at runtime.

See Also:
Constant Field Values
Constructor Detail

ColumnInfo

public ColumnInfo(java.lang.String sMappingName,
                  java.lang.String sColumnName,
                  java.lang.String sExpression,
                  boolean bCompCol,
                  TableInfo tableInfo,
                  int iColumnIndex)
Constructs a ColumnInfo with specified parameters.

Parameters:
sMappingName - The mapping name of the column.
sColumnName - The real database name of the column.
sCorrelationName - The correlation name of the column.
sExpression - The expression of the clolumn, if it represents a computed column.
bCompCol - Specifies whether this is a computed column.
tableInfo - The TableInfo of the table that this column belongs to.
iColumnIndex - The index of where this column should appear in Select clause.
Method Detail

getMappingName

public java.lang.String getMappingName()
Gets the mapping name of the column.

Returns:
the mapping name of the column.

getColumnName

public java.lang.String getColumnName()
Gets the real database name of this column.

Returns:
the real name of the column.

getExpression

public java.lang.String getExpression()
Gets the expression of this column.

Returns:
the expression of the column.

isCompCol

public boolean isCompCol()
Gets whether this is a computed column.

Returns:
true if this is a computed column, false otherwise.

getTable

public TableInfo getTable()
Gets TableInfo of the table that this column belongs to.

Returns:
TableInfo of the table that this column belongs to. #TableInfo

getColumnIndex

public int getColumnIndex()
Gets the index of where this column should appear in Select clause when creating an sql string. 0 means the first one, 1 means the second one, etc. Other values mean it should not appear in the Select clause.

Returns:
the index of where this column should appear in Select clause.
See Also:
NON_SELECT_COLUMN, NON_REF_SELECT_COLUMN

equals

public boolean equals(java.lang.Object obj)
Compares this ColumnInfo to the specified object.

Overrides:
equals in class java.lang.Object
Returns:
true if the ColumnInfo are the same; false otherwise.

toString

public java.lang.String toString()
Returns a string representing this ColumnInfo's values. The format is as follows:

  className@hashCode[ mappingName | columnName | correlationName | expression | 
                      tableMappingName | isCompCol ]
        

Overrides:
toString in class java.lang.Object
Returns:
a string representing this ColumnInfo.