com.tivoli.twg.engine
Class TWGDbSmallintColumn

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

public class TWGDbSmallintColumn
extends TWGDbColumn

TWGDbSmallintColumn is a container class that encapsulates a database table column where the column type is SMALLINT (short).

See Also:
Serialized Form

Field Summary
static short NULL
          Value substituted into query results to indicate the database value was null.
 
Constructor Summary
TWGDbSmallintColumn(java.lang.String realName, java.lang.String tokenName)
          Create a smallint (short) column
TWGDbSmallintColumn(TWGDbSmallintColumn copyCol)
          Create a TWGDbSmallintColumn by copying another one
 
Method Summary
protected  TWGDbColumn createFilterColumn(java.util.Locale loc, TWGDatabaseTable table)
          Create a filter version of his column (display name is translated).
protected  java.io.Serializable getDistinctValues(java.util.Locale loc, TWGDatabaseTable table)
          Get column distinct values
 short[] 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(ShortValueSet newValues)
          This method is protected as an implementation side effect.
 void setDefaultValue(short defaultValue)
          Set a default value for this column.
 void setDefaultValue(java.lang.Short defaultValue)
          Set a default value for this column.
protected  void setDistinctValues(java.lang.Object vals)
          Set column distinct values (console use)
 void setDistinctValues(ShortValueSet values)
          Set the distinct values for this column to a constant set.
 void setInitialDistinctValues(TWGShort dv)
          Set the initial distinct values for this column.
 void setInitialDistinctValues(TWGShortArray dv)
          Set the initial distinct values for this column.
 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, setMappedColumn, setMetaType, setQueryDistinctValues, setShortColumnName, setTableName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

NULL

public static final short 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. The value is set to Short.MAX_VALUE.

See Also:
Constant Field Values
Constructor Detail

TWGDbSmallintColumn

public TWGDbSmallintColumn(java.lang.String realName,
                           java.lang.String tokenName)
Create a smallint (short) column

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

TWGDbSmallintColumn

public TWGDbSmallintColumn(TWGDbSmallintColumn copyCol)
Create a TWGDbSmallintColumn 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 filter version of his column (display name is translated). 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

getDistinctValues

protected java.io.Serializable getDistinctValues(java.util.Locale loc,
                                                 TWGDatabaseTable table)
Get column distinct values

Specified by:
getDistinctValues in class TWGDbColumn
Returns:
ShortValueSet containing values

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(ShortValueSet 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 ShortValueSet array containing the new values
Throws:
- - TWGDbException
See Also:
ShortValueSet

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
TWGDbException

getValues

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

Returns:
an int array of distinct values /*

setDefaultValue

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

Parameters:
defaultValue - -- the value

setDefaultValue

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

Parameters:
defaultValue - -- the value

setDistinctValues

public void setDistinctValues(ShortValueSet 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 ShortValueSet containing the constant distinct values
See Also:
ShortValueSet

setInitialDistinctValues

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

Parameters:
dv - - TWGShort datavalue

setInitialDistinctValues

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

Parameters:
dv - - TWGShortArray 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.