|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.tivoli.twg.engine.TWGDbColumn
TWGDbColumn is an abstract class that encapsulates a database7 table column. It describe column-related parameters for a single table column. The subclasses of this column are collected in a TWGDbColumnData object that is passed as a parameter when the database table is initialized.
TWGDbColumnData
,
Serialized FormConstructor Summary | |
---|---|
protected |
TWGDbColumn(java.lang.String realName,
java.lang.String tokenName,
int colType,
int colLength,
java.lang.Object defaultValue)
Constructor for Character or Varchar columns |
protected |
TWGDbColumn(java.lang.String realName,
java.lang.String tokenName,
int colType,
java.lang.Object defaultValue)
Constructor for TWGDbColumn - non-character columns |
protected |
TWGDbColumn(TWGDbColumn copyCol)
Create a TWGDbColumn by copying another one |
Method Summary | |
---|---|
boolean |
allowsGTLT()
Get whether the column is allowed to have greater than or less than operation for queries and filters. |
boolean |
compareTo(DataValue dv,
TWGDbColumnFilter colFilter)
Classes that implement filter processing must override the compareTo method to allow comparing a data value to the information stored in the TWGDbColumnFilter. |
protected abstract TWGDbColumn |
createFilterColumn(java.util.Locale loc,
TWGDatabaseTable table)
Abstract method to create a filter column version of this column. |
java.lang.Object |
getColumnDefaultValue()
Get the default value for the column. |
int |
getColumnId()
Get the column number. |
java.lang.Integer |
getColumnlength()
Get the number of characters in column. |
int |
getColumnType()
Get the column type. |
java.lang.String |
getDisplayName()
Get the column display name. |
protected abstract java.io.Serializable |
getDistinctValues(java.util.Locale loc,
TWGDatabaseTable table)
New in Director v2.1. |
DataValue |
getInitialDistinctValues()
Returns the data value that is used to prime the distinct values for this column |
java.lang.Integer |
getKeyNum()
Get the key number of the column. |
IntValueSet |
getMatchingMoids(TWGFilterConstraint filterConstraint,
TWGDbConnection conn,
IntValueSet moids)
If the standard filter query won't work then override this method in the derived class and implement the filter. |
java.lang.String |
getMetaType()
Get the meta type for the column |
java.lang.String |
getRealColumnName()
Get the real column name. |
protected TWGDatabaseTable |
getTable()
Get database table for this column (engine use only) |
java.lang.String |
getTokenColumnName()
Get the token column name. |
boolean |
implementsFilterProcessing()
This method will return true if this column has special filter processing needs. |
protected abstract void |
insertDistinctValue(java.lang.Object value)
Abstract class to be insert a distinct value into the list of distinct values. |
boolean |
isFilterColumn()
Get whether the column should be displayed on the edit dynamic group (filter) panel. |
boolean |
isMappedColumn()
Return true if the column value in a query result set will be translated. |
boolean |
queryDistinctValues()
Is this column one for which we query the table for distinct values? |
protected void |
refreshDistinctIfNeeded()
Refresh distinct column values (if cache expired) (Console use only) |
protected void |
refreshDistinctValues(java.lang.String tableName,
TWGDbConnection conn)
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. |
void |
setAllowsGTLT(boolean gtlt)
Set whether the column is allowed to have greater than and less than operations for queries and filters. |
protected void |
setColumnId(int column_id)
This method is protected as an implementation side effect. |
void |
setColumnLength(java.lang.Integer columnLength)
|
static void |
setColumnNameLength(int columnLength)
The column length is specified during the ctr of the TWGDbColumn object. |
void |
setDefaultValue(java.lang.Object defaultValue)
Set the default value for the column. |
protected void |
setDisplayName(java.util.Locale loc,
TWGDatabaseTable table)
Set the column display name used in printouts and displays. |
protected abstract void |
setDistinctValues(java.lang.Object vals)
Set distinct values for this column (console use only) |
void |
setFilterColumn(boolean filter)
Set whether the column should be displayed on the edit dynamic group (filter) panel. |
void |
setFilterProcessing(boolean processing)
Allows setting this TWGDbColumn to have special filter processing needs. |
protected void |
setInitialDistinctValues(DataValue dv)
Set the initial distinct values for this column. |
protected void |
setKeyNum(int keyNum)
This method is protected as an implementation side effect. |
protected void |
setMappedColumn(boolean mapped)
Set whether column values are translated via resource bundles. |
void |
setMetaType(java.lang.String metaType)
Set the meta type for this column. |
protected void |
setQueryDistinctValues(boolean queryDistinct)
Set whether distinct values should be retrieved by querying the database |
void |
setShortColumnName(java.lang.String shortColumnName)
Get the token column name. |
void |
setTableName(java.lang.String name)
Set database table for this column (console use only) |
java.lang.String |
toString()
Convert column to String for debug |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
protected TWGDbColumn(java.lang.String realName, java.lang.String tokenName, int colType, java.lang.Object defaultValue)
realName
- - real column nametokenName
- - token column namecolType
- - type of the columndefaultValue
- - the column default valueprotected TWGDbColumn(java.lang.String realName, java.lang.String tokenName, int colType, int colLength, java.lang.Object defaultValue)
realName
- - real column nametokenName
- - token column namecolType
- - type of the columncolLength
- - the number of characters in the column.defaultValue
- - the column default valueprotected TWGDbColumn(TWGDbColumn copyCol)
copyCol
- -- the column to be copiedMethod Detail |
protected TWGDatabaseTable getTable() throws TWGDbException
TWGDbException
public void setTableName(java.lang.String name)
name
- database table nameprotected abstract TWGDbColumn createFilterColumn(java.util.Locale loc, TWGDatabaseTable table)
loc
- - the locale to use for translationstable
- - the TWGDatabaseTable that this column belongs toprotected void setMappedColumn(boolean mapped)
This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table
mapped
- - true if the column can is to be translated, otherwise false
/*public boolean isMappedColumn()
public void setFilterColumn(boolean filter)
This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table
filter
- - true to make the column a filter columnpublic boolean isFilterColumn()
public void setAllowsGTLT(boolean gtlt)
This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table
gtlt
- - true to allow greater than and less than, otherwise falsepublic boolean allowsGTLT()
protected abstract void insertDistinctValue(java.lang.Object value) throws TWGDbException
value
- - The value to be inserted.
-
- TWGDbException
TWGDbException
public java.lang.String getRealColumnName()
public static void setColumnNameLength(int columnLength)
columnLength
- - length of columnpublic void setShortColumnName(java.lang.String shortColumnName)
public java.lang.String getTokenColumnName()
public java.lang.String getDisplayName()
protected void setDisplayName(java.util.Locale loc, TWGDatabaseTable table)
loc
- - Locale used for the columntable
- - reference to the TWGDatabaseTable which the column is in.public int getColumnType()
TWGDatabaseConstants
public java.lang.Integer getColumnlength()
public void setColumnLength(java.lang.Integer columnLength)
public java.lang.Integer getKeyNum()
protected void setKeyNum(int keyNum)
Set the key number of the column.
keyNum
- - key numberprotected void setColumnId(int column_id)
Set the column number.
column_id
- - column number.public int getColumnId()
public void setDefaultValue(java.lang.Object defaultValue)
This method should be called only in the create method of a TWGDatabaseTable subclass when defining the table
defaultValue
- - default valuepublic java.lang.String getMetaType()
public void setMetaType(java.lang.String metaType)
This method should be called to set the meta type of the column. An example would be a char column that is used to hold ip addresses. The meta type could be set to IPAddress.
public java.lang.Object getColumnDefaultValue()
protected abstract void setDistinctValues(java.lang.Object vals)
protected void refreshDistinctIfNeeded()
protected void refreshDistinctValues(java.lang.String tableName, TWGDbConnection conn) throws TWGDbException
Refresh the list of saved distinct column values with the values obtained from the physical database table.
tableName
- - the real table name for the tableconn
- - a TWGDbConnection for the database
TWGDbException
protected abstract java.io.Serializable getDistinctValues(java.util.Locale loc, TWGDatabaseTable table)
protected void replaceDistinctValues(java.sql.ResultSet rs) throws TWGDbException
Replace the saved set of distinct column values with the results from a database query such that the values are returned on subsequent calls to getDistinctValues().
rs
- - query result set
TWGDbException
protected void setQueryDistinctValues(boolean queryDistinct)
queryDistinct
- - true means we retrieve distinct values from tablepublic boolean queryDistinctValues()
protected void setInitialDistinctValues(DataValue dv)
dv
- - datavaluepublic DataValue getInitialDistinctValues()
public boolean implementsFilterProcessing()
public void setFilterProcessing(boolean processing)
public boolean compareTo(DataValue dv, TWGDbColumnFilter colFilter)
dv
- - the data value to comparecolFilter
- - the column filter to compare to
public IntValueSet getMatchingMoids(TWGFilterConstraint filterConstraint, TWGDbConnection conn, IntValueSet moids)
conn
- - database connection to use.filterConstraint
- - the filter constraint.moids
- - this is the list of moids to check. If the list is null then
check against all moids.
public java.lang.String toString()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |