com.tivoli.twg.engine
Class TWGDatabaseTable

java.lang.Object
  extended bycom.tivoli.twg.engine.TWGObject
      extended bycom.tivoli.twg.engine.TWGPersistentObject
          extended bycom.tivoli.twg.engine.TWGDatabaseTable
Direct Known Subclasses:
MSCSClusterInfoTable, MSCSGroupResTable, MSCSGroupTable, MSCSNetIntTable, MSCSResourceTable, TWGAS400HardwareTable, TWGClusterMembershipTable, TWGClusterMemberTable, TWGComponentIdTable, TWGDiskTable, TWGIdeAdapterTable, TWGIdeDeviceTable, TWGInstalledMemoryTable, TWGIpAddressTable, TWGIpxAddressTable, TWGKeyboardTable, TWGLogicalDriveTable, TWGLogicalMemoryTable, TWGManagedObjectTable, TWGMemoryModuleTable, TWGMotherboardTable, TWGNetworkAdapterTable, TWGOperatingSystemTable, TWGParallelPortTable, TWGPartitionTable, TWGPciDeviceTable, TWGPhysicalContainerGlobalTable, TWGPointingDeviceTable, TWGPrinterTable, TWGProcessorTable, TWGScsiAdapterTable, TWGScsiDeviceTable, TWGSerialPortTable, TWGSnmpMib2Table, TWGSoftwareTable, TWGSystemBiosTable, TWGSystemLocationTable, TWGSystemResourceTable, TWGSystemUserTable, TWGVideoTable, TWGWindowsNetworkIdTable

public abstract class TWGDatabaseTable
extends TWGPersistentObject

TWGDatabaseTable: The abstract base class for all database tables in the Director Server database. To subclass this class you must override the create and getTableVersion methods. In addition every subclass must have a column called MANAGED_OBJ_ID. The physical database tables will be created during Director Server initialization. Changes: 03/19/99, Dennis Brown: - changed DEFAULT_GRAPHIC_NAME to an actual file name - make validChars public so UserTableFactory could use it


Field Summary
static java.lang.String CLASSNAME
           
static java.lang.String[] DbKeyWords
           
static java.lang.String DEFAULT_TABLE_BUNDLE_NAME
           
static java.lang.String MANAGED_OBJ_ID
           
static java.lang.String validChars
           
 
Fields inherited from class com.tivoli.twg.engine.TWGPersistentObject
CLASS_NAME, SIZEOF_BYTE, SIZEOF_CHAR, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_SHORT
 
Constructor Summary
TWGDatabaseTable()
          Default constructor.
 
Method Summary
abstract  void create()
          Abstract method must be overriden by subclass to define the table.
 int deleteManagedObject(long managed_obj_id, TWGDbConnection conn)
          Delete all rows with specified managed object id.
 void deleteTable(TWGDbConnection conn)
          Method to delete the physical database table.
static TWGDatabaseTable findTableByClassName(java.lang.String table_class)
          Class method to get a reference to a TWGDatabaseTable by searching on class name.
 void flatten(TWGByteArrayOutputStream data)
          Write table contents to a byte array.
 java.util.Vector getAllFullColumnNames()
          Gets the full names of columns in the table.
 java.lang.String getAllTrue(java.util.Locale loc)
          Get the translated "all true" prompt string
 java.lang.String getAllTrueForSame(java.util.Locale loc)
          Get the translated "all true for same" prompt string
 java.lang.String getAnyTrue(java.util.Locale loc)
          Get the translated "any true" prompt string
 java.lang.String getBundleName()
          Returns the bundle name for this database table.
 java.lang.String getBundleString(java.lang.String bundleKey, java.util.Locale loc)
          Get the value for a bundle string key
 TWGDbColumn getColumn(java.lang.String token)
          Get a table column by column token name
 TWGDbColumn getColumnByColumnRealName(java.lang.String realName)
          Get a table column by column real name
 int getColumnLength(java.lang.String token)
          Get the number of characters in the column specified.
 java.util.Vector getColumnLength(java.util.Vector ColumnTokens)
          Get number of characters in columns specified.
 java.util.Vector getColumnLengths()
          Get the number of characters for each column in the table.
 java.util.Enumeration getColumns()
          Get database table columns
 int getColumnType(java.lang.String token)
          Get the data type for specified column.
 java.util.Vector getColumnType(java.util.Vector ColumnTokens)
          Get data types for columns specified.
 java.util.Vector getColumnTypes()
          Get data types for all the columns in the table.
 TWGDatabase getDatabase()
          Get the database that the table is in.
 java.lang.Object getDefaultValue(java.lang.String token)
          Get the default value for the specified column
 java.util.Vector getDefaultValue(java.util.Vector ColumnTokens)
          Get default values for specified columns
 java.util.Vector getDefaultValues()
          Get the default values for each column.
 java.lang.String getDisplayColumnName(java.lang.String token, java.util.Locale loc)
          Get the displayable translated name for a table column.
 java.util.Vector getDisplayFullColumnNames(java.util.Locale loc)
          Get the displayable translated table and column name pairs for all columns.
 java.lang.String getDisplayName(java.util.Locale loc)
          Get the translated table name for display.
 java.lang.String[] getDisplayValues(java.lang.String column, java.lang.String[] values, java.util.Locale loc)
          Get the translated display values for a list of values in a string (CHAR or VARCHAR) column.
 java.lang.String getEachTrueForAtLeastOne(java.util.Locale loc)
          Get the translated "each true for at least one" prompt string
 java.util.Vector getFilterColumns(java.util.Locale loc)
          Get all columns that are filter columns.
 java.lang.String getFilterPrompt(java.lang.String promptKey, java.util.Locale loc)
          Look up filter prompt string in resource bundle.
 java.lang.String getFilterSQL(TWGDbColumnFilter columnFilter)
          Build SQL for WHERE clause of a query.
 java.lang.String getGraphicName()
          Get name of the icon graphic for this table.
 java.util.Vector getKey()
          Get the token column names for each key field.
 IntValueSet getMatchingMoids(TWGFilterConstraint filterConstraint, TWGDbConnection conn, IntValueSet moids)
          This method implements the ALL_FOR_SAME_ADDRESS and for filters that have columns that require special processing.
 MultiLocaleBundle getMultiLocaleBundle()
          Get the bundle string key
protected static java.lang.String getMyClassName(java.lang.Object objectVariable)
          This method is protected as an implementation side effect.
 int getNumberOfColumns()
          Get the number of columns in the table.
 java.lang.String getRealColumnName(java.lang.String token)
          Get the real name for the specified column.
 java.util.Vector getRealColumnName(java.util.Vector ColumnTokens)
          Get real names for columns specified.
 java.util.Vector getRealColumnNames()
          Get all real column names.
 java.lang.String getRealName()
          Get the real table name.
 java.lang.String getShortClassName()
          The getBundleString requires that the key use the last piece of the class name to identify the table.
static TWGDatabaseTable getTable(java.lang.String tokenName)
          Class method to get a reference to a TWGDatabaseTable object.
static TWGDatabaseTable getTableBy(java.lang.String shortClassName)
          The resource bundles refer to tables by a shortened class name.
static TWGDatabaseTable getTableByRealTableName(java.lang.String tableRealName)
          Class method to get a reference to a TWGDatabaseTable object by table real name.
 TWGDbTableReply getTableInfo(java.util.Locale loc)
          Gets descriptive information about this table including translated titles
protected  MultiLocaleBundle getTableMultiLocaleBundle(java.lang.String bundleName)
          Get the requested multi-locale resource bundle
 java.lang.String getTableName()
          Method to return the table name.
static java.util.Hashtable getTables()
          Class method to get a hashtable that contains references for all table object.
abstract  java.lang.String getTableVersion()
          Abstract method must be overriden by subclass to get the version for table
 java.util.Vector getTokenColumnNames()
          Get all column token names.
 java.lang.String getTokenName()
          Get the token table name.
 int insertOrDeleteRow(Vect columnTokens, Vect columnValues, TWGDbConnection conn, boolean update_only, boolean delete_only)
          The instance method inserts or deletes a row into the table.
 int insertRow(Vect columnTokens, Vect columnValues, TWGDbConnection conn)
          The instance method inserts a row into the table.
 boolean isFilterColumn(java.lang.String token)
          Is the column to be displayed in the group edit (filter) panels as a selectable column?
 boolean isMappedColumn(java.lang.String token)
          Are the values for the specified column mapped to translated values in a resource bundle?
protected  void restoreData(TWGPersistentObjectDictionary dict, boolean do_resolve)
          Restore method for database table object
protected  void saveData(TWGPersistentObjectDictionary dict)
          Method for saving persistent object data.
 void setShortTableName(java.lang.String shortTableName)
          Specify the name of the table if short names are required
 java.lang.String toString()
          Convert Table to String for debug
 void TWGInitTable(java.lang.String dbName, java.lang.String tokenName, java.lang.String realName, TWGDbColumnData colData, TWGDbTableParms parms, java.lang.String bundleName)
          TWGDatabaseTable initialization for a table This method initializes the instance variables, checks that the real database table name and token table name are unique within the database, and runs SQL to create the table and any indices in the database.
protected  java.lang.String userTableFixClassName(java.lang.String className)
          If className is "TWGDbUserTable" then the user table token name is added to it, so that NLS works--all keys in the resource bundles use TWGDBUserTable?tabletoken as the classname.
 
Methods inherited from class com.tivoli.twg.engine.TWGPersistentObject
Destroy, enableAsyncWrites, fromPersistID, initialize, isNewPersistentStore, isSaveRequired, PersistID, restore, restoreAll, save, save, setSaveRequired, terminate, toPersistID
 
Methods inherited from class com.tivoli.twg.engine.TWGObject
AllObjects, AllObjects, Delete, DumpTWGObjects, FindObject, isDeleted, isNewObject, isPersistent, isPersistent, isValid, isValid, ObjectID, setDistinctObjectID, SetObjectID
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLASSNAME

public static final java.lang.String CLASSNAME
See Also:
Constant Field Values

DEFAULT_TABLE_BUNDLE_NAME

public static final java.lang.String DEFAULT_TABLE_BUNDLE_NAME
See Also:
Constant Field Values

MANAGED_OBJ_ID

public static final java.lang.String MANAGED_OBJ_ID
See Also:
Constant Field Values

validChars

public static final java.lang.String validChars
See Also:
Constant Field Values

DbKeyWords

public static final java.lang.String[] DbKeyWords
Constructor Detail

TWGDatabaseTable

public TWGDatabaseTable()
Default constructor.

Method Detail

create

public abstract void create()
                     throws TWGDbException
Abstract method must be overriden by subclass to define the table.

Throws:
TWGDbException

getTableVersion

public abstract java.lang.String getTableVersion()
Abstract method must be overriden by subclass to get the version for table

Returns:
the version id for this table

TWGInitTable

public void TWGInitTable(java.lang.String dbName,
                         java.lang.String tokenName,
                         java.lang.String realName,
                         TWGDbColumnData colData,
                         TWGDbTableParms parms,
                         java.lang.String bundleName)
                  throws TWGDbRealTableNameNotUniqueException,
                         TWGDbTokenTableNameNotUniqueException,
                         TWGDbException
TWGDatabaseTable initialization for a table This method initializes the instance variables, checks that the real database table name and token table name are unique within the database, and runs SQL to create the table and any indices in the database.

Parameters:
dbName - - the identifier of the Director database in which the table will be created. Currently TWGDatabase.TWG_DB_NAME is the only database defined.
tokenName - - the proposed token name for the table.
realName - - the proposed real name for the table. Name will be set to upper case
colData - - An object describing the database columns. There must be a column called MANAGED_OBJ_ID in each subclass.
parms - - optional table parameters
bundleName - - the name of the resource bundle that stores displayable table names, column names, column values for mapped columns, and prompt strings
Throws:
TWGDbException - - general database exception
TWGDbRealTableNameNotUniqueException - - real table name already in use
TWGDbTokenTableNameNotUniqueException - - token table name already in use
See Also:
TWGDbColumnData, TWGDbTableParms

getTable

public static TWGDatabaseTable getTable(java.lang.String tokenName)
                                 throws TWGDbException
Class method to get a reference to a TWGDatabaseTable object.

Returns:
the table object
Throws:
TWGDbException - if table not found

getTableBy

public static TWGDatabaseTable getTableBy(java.lang.String shortClassName)
                                   throws TWGDbException
The resource bundles refer to tables by a shortened class name. This method allows looking up the TWGDatabaseTable by the shortened className.

Parameters:
shortClassName - - short class name ( used in resource bundles.)
Returns:
the table object
Throws:
TWGDbException - if table not found
See Also:
getShortClassName

getTableByRealTableName

public static TWGDatabaseTable getTableByRealTableName(java.lang.String tableRealName)
Class method to get a reference to a TWGDatabaseTable object by table real name.

Parameters:
tableRealName - - table real name for the table
Returns:
the table object. Return null if table not found.
Since:
ITD V2.1

getTables

public static java.util.Hashtable getTables()
Class method to get a hashtable that contains references for all table object.

Returns:
Hashtable of references to each table

findTableByClassName

public static TWGDatabaseTable findTableByClassName(java.lang.String table_class)
                                             throws TWGDbException
Class method to get a reference to a TWGDatabaseTable by searching on class name.

Parameters:
table_class - the class name for the table
Returns:
the table object. If table is not found return null
Throws:
TWGDbException - for database exceptions

getTableMultiLocaleBundle

protected MultiLocaleBundle getTableMultiLocaleBundle(java.lang.String bundleName)
Get the requested multi-locale resource bundle

Parameters:
bundleName - - the name of the resource bundle used for translating table data
Returns:
If bundleName is null the default table multilocale bundle is returned. otherwise, the requested bundle is returned.

getMyClassName

protected static java.lang.String getMyClassName(java.lang.Object objectVariable)
This method is protected as an implementation side effect. Do not call or change. Its interface may be changed in a later release.

Parameters:
objectVariable - - reference to an object
Returns:
String

getShortClassName

public java.lang.String getShortClassName()
The getBundleString requires that the key use the last piece of the class name to identify the table. This method will return the class name in the format the the call to getBundleString requires.

Returns:
String - class name used by the key passed to getBundleString

userTableFixClassName

protected java.lang.String userTableFixClassName(java.lang.String className)
If className is "TWGDbUserTable" then the user table token name is added to it, so that NLS works--all keys in the resource bundles use TWGDBUserTable?tabletoken as the classname. Returns className unaltered if it's not "TWGDbUserTable."

Parameters:
className - the classname to fix
Returns:
the fixed classname.

deleteTable

public void deleteTable(TWGDbConnection conn)
                 throws TWGDbException
Method to delete the physical database table.

Parameters:
conn - - a connection to the database
Throws:
TWGDbException

insertRow

public int insertRow(Vect columnTokens,
                     Vect columnValues,
                     TWGDbConnection conn)
              throws TWGDbException
The instance method inserts a row into the table. If the row exists, update it.

Parameters:
columnTokens - - a list of column token names provided for the row
columnValues - - values for the corresponding columns. If not all columns are provided, use default values for non-key columns.
conn - - a TWGDbConnection to the database
Throws:
TWGDbException
See Also:
TWGDbConnection

insertOrDeleteRow

public int insertOrDeleteRow(Vect columnTokens,
                             Vect columnValues,
                             TWGDbConnection conn,
                             boolean update_only,
                             boolean delete_only)
                      throws TWGDbException
The instance method inserts or deletes a row into the table. If the row exists on an insert, update it.

Parameters:
columnTokens - - a list of column token names provided for the row
columnValues - - values for the corresponding columns. If not all columns are provided, use default values for non-key columns.
conn - - a TWGDbConnection to the database
update_only - - only do update if set, try insert first if clear
delete_only - - only do delete if set, do insert or update if clear
Throws:
TWGDbException
See Also:
TWGDbConnection

deleteManagedObject

public int deleteManagedObject(long managed_obj_id,
                               TWGDbConnection conn)
                        throws TWGDbException
Delete all rows with specified managed object id.

Parameters:
managed_obj_id - - the managed object id whose rows should be deleted
conn - - a connection to the database
Returns:
int indicating number of rows affected.
Throws:
TWGDbException

getFilterSQL

public java.lang.String getFilterSQL(TWGDbColumnFilter columnFilter)
                              throws TWGDbException
Build SQL for WHERE clause of a query.

Parameters:
columnFilter - - the column filter
Returns:
String for the WHERE clause
Throws:
TWGDbException
See Also:
TWGDbColumnFilter

getNumberOfColumns

public int getNumberOfColumns()
Get the number of columns in the table.

Returns:
the number of columns

isMappedColumn

public boolean isMappedColumn(java.lang.String token)
                       throws TWGDbException
Are the values for the specified column mapped to translated values in a resource bundle?

Parameters:
token - - token name for the column
Returns:
true if values are part of the key for mapping into a resource bundle, otherwise false
Throws:
TWGDbException

isFilterColumn

public boolean isFilterColumn(java.lang.String token)
                       throws TWGDbException
Is the column to be displayed in the group edit (filter) panels as a selectable column?

Parameters:
token - - token name for the column
Returns:
true if the column is used for group edit, otherwise false
Throws:
TWGDbException

getTableInfo

public TWGDbTableReply getTableInfo(java.util.Locale loc)
                             throws TWGDbException
Gets descriptive information about this table including translated titles

Parameters:
loc - - the Locale for translations
Returns:
TWGDbTableReply
Throws:
TWGDbException
See Also:
TWGDbTableReply

getColumn

public TWGDbColumn getColumn(java.lang.String token)
                      throws TWGDbException
Get a table column by column token name

Parameters:
token - - the column token name
Returns:
the TWGDbColumn object
Throws:
TWGDbException

getColumnByColumnRealName

public TWGDbColumn getColumnByColumnRealName(java.lang.String realName)
                                      throws TWGDbException
Get a table column by column real name

Parameters:
realName - - the column real name
Returns:
the TWGDbColumn object
Throws:
TWGDbException - if column not found
Since:
ITD V2.1

getColumnType

public java.util.Vector getColumnType(java.util.Vector ColumnTokens)
                               throws TWGDbException
Get data types for columns specified.

Parameters:
ColumnTokens - - a list of column token names.
Returns:
Vector containing a list of Integer data types for the columns specified. Valid values for column types are found in TWGDatabase
Throws:
-TWGDbException
TWGDbException
See Also:
TWGDatabase

getColumnType

public int getColumnType(java.lang.String token)
                  throws TWGDbException
Get the data type for specified column.

Returns:
the data type for the column. Valid values for column types are found in TWGDatabase
Throws:
TWGDbException
See Also:
TWGDatabase

getColumnTypes

public java.util.Vector getColumnTypes()
                                throws TWGDbException
Get data types for all the columns in the table.

Returns:
Vector containing a list of Integer data types for the columns specified. Valid values for column types are found in TWGDatabase
Throws:
TWGDbException
See Also:
TWGDatabase

getRealColumnName

public java.util.Vector getRealColumnName(java.util.Vector ColumnTokens)
                                   throws TWGDbException
Get real names for columns specified.

Parameters:
ColumnTokens - - a list of column token names.
Returns:
Vector containing a list of real names for the columns specified.
Throws:
-TWGDbException
TWGDbException

getRealColumnName

public java.lang.String getRealColumnName(java.lang.String token)
                                   throws TWGDbException
Get the real name for the specified column.

Parameters:
token - - the token name for the column.
Returns:
String indicating the real name for the column.
Throws:
TWGDbException

getRealColumnNames

public java.util.Vector getRealColumnNames()
                                    throws TWGDbException
Get all real column names.

Returns:
Vector containing real names for all the columns in the table.
Throws:
-TWGDbException
TWGDbException

getDisplayFullColumnNames

public java.util.Vector getDisplayFullColumnNames(java.util.Locale loc)
                                           throws TWGDbException
Get the displayable translated table and column name pairs for all columns.

Returns:
Vector containing display names for all the columns in the table as Strings in the format "displayTableName.displayColumnName"
Throws:
-TWGDbException
TWGDbException

getDisplayColumnName

public java.lang.String getDisplayColumnName(java.lang.String token,
                                             java.util.Locale loc)
                                      throws TWGDbException
Get the displayable translated name for a table column.

Parameters:
token - - the token name for the table
loc - - the locale for the translation
Returns:
the translated display name, if found in the table resource bundle. If not found in bundle, the real physical column name is returned.
Throws:
TWGDbException

getTokenColumnNames

public java.util.Vector getTokenColumnNames()
                                     throws TWGDbException
Get all column token names.

Returns:
Vector containing token names for all the columns in the table.
Throws:
-TWGDbException
TWGDbException

getAllFullColumnNames

public java.util.Vector getAllFullColumnNames()
                                       throws TWGDbException
Gets the full names of columns in the table. Each full name is "TableName.ColumnName"

Returns:
Vector of full column names
Throws:
TWGDbException

getFilterColumns

public java.util.Vector getFilterColumns(java.util.Locale loc)
                                  throws TWGDbException
Get all columns that are filter columns. Translated displayable titles are provided.

Parameters:
loc - - the Locale for translations
Returns:
A vector of filter columns ( all subclasses of TWGDbColumn)
Throws:
TWGDbException

getColumnLength

public java.util.Vector getColumnLength(java.util.Vector ColumnTokens)
                                 throws TWGDbException
Get number of characters in columns specified.

Parameters:
ColumnTokens - - a list of column token names.
Returns:
Vector containing a list of number of characters for the columns specified as Integers
Throws:
-TWGDbException
TWGDbException

getColumnLength

public int getColumnLength(java.lang.String token)
                    throws TWGDbException
Get the number of characters in the column specified.

Parameters:
token - - column token name
Returns:
the length of the column.
Throws:
TWGDbException

getColumnLengths

public java.util.Vector getColumnLengths()
                                  throws TWGDbException
Get the number of characters for each column in the table.

Returns:
Vector containing a list of number of characters for the columns specified as Integers
Throws:
-TWGDbException
TWGDbException

getDefaultValue

public java.util.Vector getDefaultValue(java.util.Vector ColumnTokens)
                                 throws TWGDbException
Get default values for specified columns

Parameters:
ColumnTokens - - a list of column token names.
Returns:
Vector containing a list of values for the columns specified.
Throws:
-TWGDbException
TWGDbException

getDefaultValue

public java.lang.Object getDefaultValue(java.lang.String token)
                                 throws TWGDbException
Get the default value for the specified column

Parameters:
token - - column token name
Returns:
Object
Throws:
TWGDbException

getDefaultValues

public java.util.Vector getDefaultValues()
                                  throws TWGDbException
Get the default values for each column.

Returns:
Vector containing a list of values for the columns specified.
Throws:
-TWGDbException
TWGDbException

getKey

public java.util.Vector getKey()
Get the token column names for each key field.

Returns:
Vector containing strings of the token column names for each field in the key

getDatabase

public TWGDatabase getDatabase()
Get the database that the table is in.

Returns:
TWGDatabase

getRealName

public java.lang.String getRealName()
Get the real table name.

Returns:
String.

getTokenName

public java.lang.String getTokenName()
Get the token table name.

Returns:
String

getDisplayName

public java.lang.String getDisplayName(java.util.Locale loc)
Get the translated table name for display.

Parameters:
loc - - the locale for the translation
Returns:
the translated display name, if found in the table resource bundle If not found in bundle, the real physical table name is returned.

getFilterPrompt

public java.lang.String getFilterPrompt(java.lang.String promptKey,
                                        java.util.Locale loc)
Look up filter prompt string in resource bundle. If not found in specific bundle for this table, get default from default table bundle.

Parameters:
promptKey - - the id of the prompt we are looking for. One of
  • AllTrue
  • AnyTrue
  • AllTrueForSame
  • EachTrueForAtLeastOne
loc - - the locale for the user
Returns:
the translated prompt, if found in the table specific resource bundle. If not found in bundle, the default prompt is returned.

getAllTrue

public java.lang.String getAllTrue(java.util.Locale loc)
Get the translated "all true" prompt string

Parameters:
loc - - the locale for the user
Returns:
the translated "all true" string. If found in the specific table resource bundle, get the default from the default bundle.

getAnyTrue

public java.lang.String getAnyTrue(java.util.Locale loc)
Get the translated "any true" prompt string

Parameters:
loc - - the locale for the user
Returns:
the translated "any true" string. If found in the specific table resource bundle, get the default from the default bundle.

getAllTrueForSame

public java.lang.String getAllTrueForSame(java.util.Locale loc)
Get the translated "all true for same" prompt string

Parameters:
loc - - the locale for the user
Returns:
the translated "all true for same" string. If found in the specific table resource bundle, get the default from the default bundle.

getEachTrueForAtLeastOne

public java.lang.String getEachTrueForAtLeastOne(java.util.Locale loc)
Get the translated "each true for at least one" prompt string

Parameters:
loc - - the locale for the user
Returns:
the translated "all true for same" string. If found in the specific table resource bundle, get the default from the default bundle.

getDisplayValues

public java.lang.String[] getDisplayValues(java.lang.String column,
                                           java.lang.String[] values,
                                           java.util.Locale loc)
Get the translated display values for a list of values in a string (CHAR or VARCHAR) column.

Parameters:
column - - the token name for the column
values - - the values to look up the display values
loc - - the locale
Returns:
the translated values, if found in the table resource bundle If not found in bundle, the original value is returned.

getBundleString

public java.lang.String getBundleString(java.lang.String bundleKey,
                                        java.util.Locale loc)
                                 throws java.util.MissingResourceException
Get the value for a bundle string key

Parameters:
loc - - locale
Returns:
the value
Throws:
java.util.MissingResourceException

getMultiLocaleBundle

public MultiLocaleBundle getMultiLocaleBundle()
                                       throws java.util.MissingResourceException
Get the bundle string key

Returns:
the MultiLocaleBundle
Throws:
java.util.MissingResourceException

getGraphicName

public java.lang.String getGraphicName()
Get name of the icon graphic for this table.

Returns:
a String containing the name of the icon graphic for this table

flatten

public void flatten(TWGByteArrayOutputStream data)
             throws TWGPersistentObjectSaveException
Write table contents to a byte array. Used for saveData (persistent store)

Parameters:
data - - the TWGByteArrayOutputStream
Throws:
TWGPersistentObjectSaveException

saveData

protected void saveData(TWGPersistentObjectDictionary dict)
                 throws TWGPersistentObjectSaveException
Method for saving persistent object data.

Overrides:
saveData in class TWGPersistentObject
Parameters:
dict - - dictionary used to accumulate data
Throws:
TWGPersistentObjectSaveException - thrown to abort save procedure.

restoreData

protected void restoreData(TWGPersistentObjectDictionary dict,
                           boolean do_resolve)
                    throws TWGPersistentObjectRestoreException
Restore method for database table object

Overrides:
restoreData in class TWGPersistentObject
Parameters:
dict - - dictionary containing data to be restored
do_resolve - - true if second pass of restore (do resolve)
Throws:
TWGPersistentObjectRestoreException - if restore aborted

setShortTableName

public void setShortTableName(java.lang.String shortTableName)
Specify the name of the table if short names are required

Parameters:
shortTableName - - name of table if short names required

toString

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

Returns:
String with a textual description of the column.

getTableName

public java.lang.String getTableName()
Method to return the table name. The table name is the class name except for the case of com.tivoli.twg classes. If it is a com.tivoli.twg class, then the class part of com.tivoli.twg is split off.

Returns:
- return table name

getColumns

public java.util.Enumeration getColumns()
Get database table columns

Returns:
TWGDbColumn instances for this table

getMatchingMoids

public IntValueSet getMatchingMoids(TWGFilterConstraint filterConstraint,
                                    TWGDbConnection conn,
                                    IntValueSet moids)
This method implements the ALL_FOR_SAME_ADDRESS and for filters that have columns that require special processing.

Parameters:
filterConstraint - - filter constraint that describes the filter
conn - - the TWGDbConnection to use for the database query
moids - - this is the list of moids to check for inclusion in the filter. If the moids value is null, then check all against all moids.
Returns:
- the set of moids that satisfy the filter.

getBundleName

public java.lang.String getBundleName()
Returns the bundle name for this database table.

Returns:
bundle name.