com.tivoli.twg.engine
Class TWGDbVarcharColumn

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGDbColumn
      extended bycom.tivoli.twg.engine.TWGDbVarcharColumn
All Implemented Interfaces:
java.io.Serializable

public class TWGDbVarcharColumn
extends TWGDbColumn

TWGDbVarcharColumn is a container class that encapsulates a database table column where the column type is character varying..

See Also:
Serialized Form

Field Summary
protected  TWGStringArray columnDisplayValues
           
protected  StringValueSet columnDistinctValues
           
protected  TWGStringArray columnValues
           
static java.lang.String NULL
          Value substituted into query results to indicate the database value was null.
 
Constructor Summary
TWGDbVarcharColumn(java.lang.String realName, java.lang.String tokenName, int colLength)
          Create a character varying column.
TWGDbVarcharColumn(TWGDbVarcharColumn copyCol)
          Create a TWGDbVarcharColumn by copying another one
 
Method Summary
protected  TWGDbColumn createFilterColumn(java.util.Locale loc, TWGDatabaseTable table)
          Create a TWGFilterVarcharColumn version of this column.
 java.lang.String[] getDisplayValues()
           
protected  java.io.Serializable getDistinctValues(java.util.Locale loc, TWGDatabaseTable table)
          The mothod is only to be used on Director Engine.
 java.lang.String[] getValues()
          Gets the array of distinct values for this column.
protected  void insertDistinctValue(java.lang.Object value)
          This method is protected as an implementation side effect.
protected  void replaceDistinctValues(java.sql.ResultSet rs)
          This method is protected as an implementation side effect.
protected  void replaceDistinctValues(TWGStringArray newValues)
          This method is protected as an implementation side effect.
 void setDefaultValue(java.lang.String defaultValue)
          Set a default value for this column.
protected  void setDistinctValues(java.lang.Object vals)
          Set column distinct values (console use)
 void setDistinctValues(TWGStringArray values)
          Set the distinct values for this column to a constant set.
 void setInitialDistinctValues(TWGString dv)
          Set the initial distinct values for this column.
 void setInitialDistinctValues(TWGStringArray dv)
          Set the initial distinct values for this column.
 void setMappedColumn(boolean mapped)
          Set whether column is translated via resource bundles.
 void sortValues(java.util.Locale loc)
          This method is protected as an implementation side effect.
 java.lang.String toString()
          Convert column to String for debug
 
Methods inherited from class com.tivoli.twg.engine.TWGDbColumn
allowsGTLT, compareTo, getColumnDefaultValue, getColumnId, getColumnlength, getColumnType, getDisplayName, getInitialDistinctValues, getKeyNum, getMatchingMoids, getMetaType, getRealColumnName, getTable, getTokenColumnName, implementsFilterProcessing, isFilterColumn, isMappedColumn, queryDistinctValues, refreshDistinctIfNeeded, refreshDistinctValues, setAllowsGTLT, setColumnId, setColumnLength, setColumnNameLength, setDefaultValue, setDisplayName, setFilterColumn, setFilterProcessing, setInitialDistinctValues, setKeyNum, setMetaType, setQueryDistinctValues, setShortColumnName, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

columnValues

protected TWGStringArray columnValues

columnDisplayValues

protected TWGStringArray columnDisplayValues

columnDistinctValues

protected StringValueSet columnDistinctValues

NULL

public static final java.lang.String NULL
Value substituted into query results to indicate the database value was null. Also used to indicate no value exists for a particular row-column entry for REPORT_FORMAT queries.

See Also:
Constant Field Values
Constructor Detail

TWGDbVarcharColumn

public TWGDbVarcharColumn(java.lang.String realName,
                          java.lang.String tokenName,
                          int colLength)
Create a character varying column.

Parameters:
realName - -- the actual column name for the table
tokenName - -- a nickname used to refer to the column for all
colLength - -- the length for the column

TWGDbVarcharColumn

public TWGDbVarcharColumn(TWGDbVarcharColumn copyCol)
Create a TWGDbVarcharColumn by copying another one

Parameters:
copyCol - -- the column to be copied
Method Detail

createFilterColumn

protected TWGDbColumn createFilterColumn(java.util.Locale loc,
                                         TWGDatabaseTable table)
Create a TWGFilterVarcharColumn version of this column. This method is to be used only in the Director engine.

Specified by:
createFilterColumn in class TWGDbColumn
Parameters:
loc - - the locale to use for translations
table - - the TWGDatabaseTable that this column belongs to
Returns:
a TWGDbColumn

setDefaultValue

public void setDefaultValue(java.lang.String defaultValue)
Set a default value for this column. Any default values for columns in the table key are ignored. Default is TWGDbVarcharColumn.NULL.

Parameters:
defaultValue - - the value as a string

setMappedColumn

public void setMappedColumn(boolean mapped)
Set whether column is translated via resource bundles. The default is false. This method is implemented only by columns that hold string data.

This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table.

Overrides:
setMappedColumn in class TWGDbColumn
Parameters:
mapped - - true if the column can is to be translated, otherwise false

sortValues

public void sortValues(java.util.Locale loc)
This method is protected as an implementation side effect. Do not call or change. The interface will be changed later.

Sort the column values.

Parameters:
loc - - Locale

getValues

public java.lang.String[] getValues()
Gets the array of distinct values for this column.

Returns:
a String array of distinct values /*

getDisplayValues

public java.lang.String[] getDisplayValues()

getDistinctValues

protected java.io.Serializable getDistinctValues(java.util.Locale loc,
                                                 TWGDatabaseTable table)
The mothod is only to be used on Director Engine. Get values as an object which can be serialized and sent as an IPC output parm.

Specified by:
getDistinctValues in class TWGDbColumn
Parameters:
loc - - Locale for displayable values.
table - - a TWGDatabaseTable instance. The column is in the table.
Returns:
Vector containing distinct real and displayable values if the column values need to be translated. Otherwise return StringValueSet containing real distinct values.
Since:
V2.1

setDistinctValues

protected void setDistinctValues(java.lang.Object vals)
Set column distinct values (console use)

Specified by:
setDistinctValues in class TWGDbColumn

replaceDistinctValues

protected void replaceDistinctValues(java.sql.ResultSet rs)
                              throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Replace the saved list of distinct values with a new set from a database query.

Overrides:
replaceDistinctValues in class TWGDbColumn
Parameters:
rs - - The query ResultSet.
Throws:
- - TWGDbException
TWGDbException

replaceDistinctValues

protected void replaceDistinctValues(TWGStringArray newValues)
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Replace the saved list of distinct values with a new set from a database query.

Parameters:
newValues - - The StringValueSet containing the new values
Throws:
- - TWGDbException
See Also:
StringValueSet

insertDistinctValue

protected void insertDistinctValue(java.lang.Object value)
                            throws TWGDbException
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Insert a distinct value into the list of distinct values.

Specified by:
insertDistinctValue in class TWGDbColumn
Parameters:
value - - The value to be inserted.
Throws:
TWGDbException

setDistinctValues

public void setDistinctValues(TWGStringArray values)
Set the distinct values for this column to a constant set. The distinct values are used when displaying column values for selection (for example when defining dynamic groups). The only distinct values used will be those provided in the set of values. No refresh from actual database column contents will be done for this column if this method was called.

This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table

Parameters:
values - - The StringValueSet containing the constant distinct values
See Also:
StringValueSet

setInitialDistinctValues

public void setInitialDistinctValues(TWGString dv)
Set the initial distinct values for this column. These values will always be displayed in the dynamic filter builder.

Parameters:
dv - - TWGString datavalue

setInitialDistinctValues

public void setInitialDistinctValues(TWGStringArray dv)
Set the initial distinct values for this column. These values will always be displayed in the dynamic filter builder.

Parameters:
dv - - TWGStringArray datavalue

toString

public java.lang.String toString()
Convert column to String for debug

Overrides:
toString in class TWGDbColumn
Returns:
String with a textual description of the column.