atg.cortex
Class ColumnProperty

java.lang.Object
  extended by atg.cortex.Property
      extended by atg.cortex.ColumnProperty

public class ColumnProperty
extends Property

This represents a pairing of a Property to a Column of a table.


Field Summary
static java.lang.String CLASS_VERSION
          Class version string
 
Constructor Summary
ColumnProperty(java.lang.Class pBeanClass, java.lang.String pPropertyName, java.lang.String pTableName, java.lang.String pColumnName)
          Constructs a new read/write ColumnProperty
ColumnProperty(java.lang.Class pBeanClass, java.lang.String pPropertyName, java.lang.String pTableName, java.lang.String pColumnName, boolean pReadOnly)
          Constructs a new ColumnProperty
ColumnProperty(java.lang.Class pBeanClass, java.lang.String pPropertyName, java.lang.String pTableName, java.lang.String pColumnName, boolean pReadOnly, java.lang.String pInsertSQL, java.lang.String pUpdateSQL, int pJDBCType)
          Constructs a new ColumnProperty
 
Method Summary
 java.lang.String getColumnName()
          Returns the name of the column within the table.
 java.lang.String getFullColumnName()
          Returns the full name of the column, as {table name}.{column name}.
 java.lang.String getInsertSQL()
          Returns the SQL clause that will be used for this column in an INSERT statement.
 int getJDBCType()
          If the JDBC type is known, this contains the JDBC type
 java.lang.String getTableName()
          Returns the name of the table containing this column.
 java.lang.String getUpdateSQL()
          Returns the SQL clause that will be used for this column in an UPDATE statement.
 boolean isJDBCTypeKnown()
          Returns the flag indicating if the JDBC type of the column is known (i.e., was specified in the constructor)
 boolean isReadOnly()
          Returns the flag indicating if this column can only be read
 
Methods inherited from class atg.cortex.Property
getBeanClass, getPropertyDescriptor, getPropertyName, getPropertyType, isPrimitive, readPropertyValue, writePropertyValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CLASS_VERSION

public static java.lang.String CLASS_VERSION
Class version string

Constructor Detail

ColumnProperty

public ColumnProperty(java.lang.Class pBeanClass,
                      java.lang.String pPropertyName,
                      java.lang.String pTableName,
                      java.lang.String pColumnName,
                      boolean pReadOnly,
                      java.lang.String pInsertSQL,
                      java.lang.String pUpdateSQL,
                      int pJDBCType)
Constructs a new ColumnProperty

Parameters:
pBeanClass - the class of the bean containing the property to which the column corresponds
pPropertyName - the name of the property to which this column corresponds
pTableName - the name of the table containing this column
pColumnName - the name of the column
pReadOnly - flag indicating if the column is read-only. If so, then Cortex operations such as insert and update will ignore this column.
pInsertSQL - the SQL to be used for an insert statement. If null, then the property value will be used in the insert. Otherwise, the SQL here will be substituted in directly as the value. This can be used to set a field using a database function call as opposed to an application-generated value.
pUpdateSQL - the SQL to be used for an update statement. If null, then the property value will be used in the update. Otherwise, the SQL here will be substituted in directly as the value. This can be used to set a field using a database function call as opposed to an application-generated value.
pJDBCType - the JDBC type of the column (from java.sql.Types). Unless this is specified, setting null column values may not work correctly

ColumnProperty

public ColumnProperty(java.lang.Class pBeanClass,
                      java.lang.String pPropertyName,
                      java.lang.String pTableName,
                      java.lang.String pColumnName,
                      boolean pReadOnly)
Constructs a new ColumnProperty

Parameters:
pBeanClass - the class of the bean containing the property to which the column corresponds
pPropertyName - the name of the property to which this column corresponds
pTableName - the name of the table containing this column
pColumnName - the name of the column
pReadOnly - flag indicating if the column is read-only. If so, then Cortex operations such as insert and update will ignore this column.

ColumnProperty

public ColumnProperty(java.lang.Class pBeanClass,
                      java.lang.String pPropertyName,
                      java.lang.String pTableName,
                      java.lang.String pColumnName)
Constructs a new read/write ColumnProperty

Parameters:
pBeanClass - the class of the bean containing the property to which the column corresponds
pPropertyName - the name of the property to which this column corresponds
pTableName - the name of the table containing this column
pColumnName - the name of the column
Method Detail

getFullColumnName

public java.lang.String getFullColumnName()
Returns the full name of the column, as {table name}.{column name}.


getTableName

public java.lang.String getTableName()
Returns the name of the table containing this column.


getColumnName

public java.lang.String getColumnName()
Returns the name of the column within the table.


isReadOnly

public boolean isReadOnly()
Returns the flag indicating if this column can only be read


getInsertSQL

public java.lang.String getInsertSQL()
Returns the SQL clause that will be used for this column in an INSERT statement. If null, then the property value will be used, otherwise, the SQL clause is inserted verbatim. This can be used to set fields using database function calls rather than application-generated values.


getUpdateSQL

public java.lang.String getUpdateSQL()
Returns the SQL clause that will be used for this column in an UPDATE statement. If null, then the property value will be used, otherwise, the SQL clause is inserted verbatim. This can be used to set fields using database function calls rather than application-generated values.


isJDBCTypeKnown

public boolean isJDBCTypeKnown()
Returns the flag indicating if the JDBC type of the column is known (i.e., was specified in the constructor)


getJDBCType

public int getJDBCType()
If the JDBC type is known, this contains the JDBC type