com.is.jrf
Class JoinColumn

java.lang.Object
  |
  +--com.is.jrf.JoinColumn
Direct Known Subclasses:
BigDecimalJoinColumn, BooleanJoinColumn, DoubleJoinColumn, FloatJoinColumn, IntegerJoinColumn, LongJoinColumn, ShortJoinColumn, SQLDateJoinColumn, SQLTimeJoinColumn, StringArrayJoinColumn, StringJoinColumn, TimestampJoinColumn

public abstract class JoinColumn
extends java.lang.Object

Subclasses of this class represent columns from another table that we want included in our PersistentObject. These are not columns that are used in the actual join (ie. "Table1.Col1 = Table2.Col1") between tables.

The column alias is important since the real column name may match one in the main table.


Field Summary
protected  java.lang.String i_columnAlias
           
protected  java.lang.String i_columnName
           
protected  java.lang.String i_setter
           
protected static java.lang.Class s_class
           
 
Constructor Summary
JoinColumn()
           
JoinColumn(java.lang.String columnName, java.lang.String setter)
          Construct a JoinColumnInstance that is ready to be used.
JoinColumn(java.lang.String columnName, java.lang.String columnAlias, java.lang.String setter)
          Construct a JoinColumn instance that is ready to be used.
 
Method Summary
protected  void buildSelectColumnString(java.lang.StringBuffer sqlBuffer, java.lang.String tableAlias)
           
 void copyColumnValueToPersistentObject(JDBCHelper helper, PersistentObject aPO)
          Copy the value of my column to the appropriate attribute for this persistent object.
 java.lang.String getColumnAlias()
           
abstract  java.lang.Class getColumnClass()
           
 java.lang.String getColumnName()
           
 java.lang.Object getColumnValueFrom(JDBCHelper helper)
          This is usually overridden by subclasses to explicitly specify the type of object to be retrieved from the result set in JDBCHelper.
 java.lang.String getSetter()
           
 void setColumnAlias(java.lang.String alias)
           
 void setColumnName(java.lang.String name)
           
 void setSetter(java.lang.String setter)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

i_columnName

protected java.lang.String i_columnName

i_columnAlias

protected java.lang.String i_columnAlias

i_setter

protected java.lang.String i_setter

s_class

protected static java.lang.Class s_class
Constructor Detail

JoinColumn

public JoinColumn()

JoinColumn

public JoinColumn(java.lang.String columnName,
                  java.lang.String setter)
Construct a JoinColumnInstance that is ready to be used.
Parameters:
columnName - a value of type 'String' - can include alias like this: "Name PersonName"
setter - a value of type 'String'

JoinColumn

public JoinColumn(java.lang.String columnName,
                  java.lang.String columnAlias,
                  java.lang.String setter)
Construct a JoinColumn instance that is ready to be used.
Parameters:
columnName - a value of type 'String'
columnAlias - a value of type 'String' - This can be important if the main table has a matching column name.
setter - a value of type 'String'
Method Detail

getColumnValueFrom

public java.lang.Object getColumnValueFrom(JDBCHelper helper)
                                    throws java.sql.SQLException
This is usually overridden by subclasses to explicitly specify the type of object to be retrieved from the result set in JDBCHelper.
Parameters:
helper - a value of type 'JDBCHelper'
Returns:
a value of type 'Object'
Throws:
java.sql.SQLException - if an error occurs

getColumnClass

public abstract java.lang.Class getColumnClass()

getColumnName

public java.lang.String getColumnName()

setColumnName

public void setColumnName(java.lang.String name)

getColumnAlias

public java.lang.String getColumnAlias()

setColumnAlias

public void setColumnAlias(java.lang.String alias)

getSetter

public java.lang.String getSetter()

setSetter

public void setSetter(java.lang.String setter)

copyColumnValueToPersistentObject

public void copyColumnValueToPersistentObject(JDBCHelper helper,
                                              PersistentObject aPO)
                                       throws java.sql.SQLException
Copy the value of my column to the appropriate attribute for this persistent object.
Parameters:
helper - a value of type 'JDBCHelper'
aPO - a value of type 'PersistentObject'
Throws:
java.sql.SQLException - if an error occurs

buildSelectColumnString

protected void buildSelectColumnString(java.lang.StringBuffer sqlBuffer,
                                       java.lang.String tableAlias)