org.opengts.dbtools
Class DBFactory<gDBR extends DBRecord>

java.lang.Object
  extended by org.opengts.dbtools.DBFactory<gDBR>
All Implemented Interfaces:
DBRecordListener<gDBR>

public class DBFactory<gDBR extends DBRecord>
extends java.lang.Object
implements DBRecordListener<gDBR>

DBFactory provides SQL table specific information


Nested Class Summary
static interface DBFactory.CustomFactoryHandler
          CustomFactoryHandler interface
static interface DBFactory.InsertionValidator
          InsertionValidator interface
static class DBFactory.KeyType
          DBRecord key type
protected static class DBFactory.MySQLDumpReader
          MySQLDumpReader class
static class DBFactory.ValidationLog
          ValidationLog class
static class DBFactory.ValidationNotImplementedException
          ValidationNotImplementedException class
 
Field Summary
static java.lang.String _DUMP_EXT_CSV
           
static java.lang.String _DUMP_EXT_SQL
           
static java.lang.String _DUMP_EXT_TXT
           
static java.lang.String _DUMP_EXT_XML
           
static java.lang.String _LOAD_EXT_CSV
           
static java.lang.String _LOAD_EXT_DUMP
           
static java.lang.String _LOAD_EXT_SQL
           
static java.lang.String _LOAD_EXT_TXT
           
static java.lang.String ARCHIVE_EXT_CSV
           
static java.lang.String ARCHIVE_EXT_DUMP
           
static java.lang.String ARCHIVE_EXT_SQL
           
static java.lang.String ARCHIVE_EXT_TXT
           
static java.lang.String ARCHIVE_EXT_XML
           
static java.lang.String ATTR_alternateKeys
           
static java.lang.String ATTR_count
           
static java.lang.String ATTR_name
           
static java.lang.String ATTR_partial
           
static java.lang.String ATTR_primaryKey
           
static java.lang.String ATTR_sequence
           
static java.lang.String ATTR_table
           
static java.lang.String ATTR_title
           
static java.lang.String ATTR_type
           
static java.lang.String CMD_dbcreate
           
static java.lang.String CMD_dbdel
           
static java.lang.String CMD_dbget
           
static java.lang.String CMD_dbput
           
static java.lang.String CMD_dbschema
           
static int DUMP_FORMAT_CSV
           
static int DUMP_FORMAT_SQL
           
static int DUMP_FORMAT_XML
           
protected static java.util.List<DBFactory> factoryList
           
static int MSQL_ERR_CANT_DROP_TABLE
           
static int MSQL_ERR_INVALID_OBJECT
           
static int MSQL_ERR_LOGIN_EXISTS
           
static int MSQL_ERR_USER_EXISTS
           
static int SQLERR_DATABASE_EXISTS
           
static int SQLERR_DUPLICATE_KEY
           
static int SQLERR_INVALID_AUTH
           
static int SQLERR_SYNTAX_ERROR
           
static int SQLERR_TABLE_NONEXIST
           
static int SQLERR_TABLE_NOTLOCKED
           
static int SQLERR_UNKNOWN_COLUMN
           
static int SQLERR_UNKNOWN_DATABASE
           
protected static java.util.HashMap<java.lang.String,java.lang.String> TableNameMap
           
static java.lang.String TAG_Description
           
static java.lang.String TAG_Field
           
static java.lang.String TAG_Record
           
static java.lang.String TAG_RecordKey
           
static java.lang.String TAG_RecordKeys
           
static java.lang.String TAG_Records
           
static java.lang.String TAG_TableSchema
           
static java.lang.String TAG_TableSchemas
           
 
Constructor Summary
DBFactory(java.lang.String utableName, DBField[] field, DBFactory.KeyType keyType, java.lang.Class<gDBR> rcdClass, java.lang.Class<? extends DBRecordKey<gDBR>> keyClass, boolean editable, boolean viewable)
          Constructor
 
Method Summary
protected  int _addColumns(DBField[] cols, int ndx)
          Adds the specified column to this table, or alters the column if it already exists.
protected static java.lang.String _beanMethodName(java.lang.String prefix, java.lang.String fieldName)
          Returns the BeanMethod name for the specified field name
protected  void _dropColumn(DBField col)
          Drips the specified column from this table
protected  void _dumpTable(java.io.PrintWriter dumpOutStream, DBSelect<gDBR> dsel, java.lang.String[] fldn, int outFmt)
          Dumps the table represented by this DBFactory to the specified file.
protected  long _loadTable(java.lang.String[] oldFieldNames, java.io.File fromFile, DBFactory.InsertionValidator validator, boolean insertRecords, boolean overwriteExisting, boolean noDropWarning)
          Loads the data in the specified file into the table represented by this DBFactory
protected  long _loadTableCSV(java.io.File fromFile, DBFactory.InsertionValidator validator, boolean insertRecords, boolean overwriteExisting, boolean noDropWarning)
          Loads table data from the specified CSV file
protected static java.lang.String _methodScope(int mods)
          Returns the String representation of the scope 'modifications'
protected static void addActualTableName(java.lang.String globalTableName, java.lang.String actualTableName)
          Add a table name mapping
 int addColumns(DBField[] cols, int ndx)
          Adds the specified column to this table, or alters the column if it already exists.
 void addParentTable(java.lang.String utableName)
          Adds this table as a dependent of the specified parent table name
 void clearExistingColumnMap()
          Clears the column map for the existing columns
static
<T extends DBRecord<T>>
DBFactory<T>
createDBFactory(java.lang.String utableName, DBField[] field, DBFactory.KeyType keyType, java.lang.Class<T> rcdClass, java.lang.Class<? extends DBRecordKey<T>> keyClass, boolean editable, boolean viewable)
          Create a DBFactory instance.
 DBRecordKey<gDBR> createKey()
          Creates/returns an empty DBRecordKey for this DBFactory
 DBRecordKey<gDBR> createKey(java.util.Map<java.lang.String,java.lang.String> valMap)
          Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified Value-Map
 DBRecordKey<gDBR> createKey(java.util.Map<java.lang.String,java.lang.String> valMap, int partialKeyType)
          Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified Value-Map
 DBRecordKey<gDBR> createKey(java.sql.ResultSet rs)
          Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified ResultSet
 gDBR createRecord(org.w3c.dom.Element record)
          Creates/returns a DBRecord for this DBFactory populated with key values from the specified XML Element
 gDBR createRecord(java.util.Map<java.lang.String,java.lang.String> valMap)
          Creates/returns a DBRecord for this DBFactory populated with key values from the specified Value-Map (record not yet saved)
 gDBR createRecord(java.sql.ResultSet rs)
          Creates/returns a DBRecord for this DBFactory populated with key values from the specified ResultSet (record not yet saved)
 void createTable()
          Creates the table represented by this DBFactory
 void dropColumn(DBField col)
          Drips the specified column from this table
 void dropTable()
          Drops the table represented by this DBFactory
 void dumpTable(java.io.File toFile)
          Dumps the table represented by this DBFactory to the specified file
 void dumpTable(java.io.File toFile, DBSelect<gDBR> dsel)
          Dumps the table represented by this DBFactory to the specified file.
 void dumpTable(java.io.File toFile, DBSelect<gDBR> dsel, java.lang.String[] fldn)
          Dumps the table represented by this DBFactory to the specified file.
 boolean equals(java.lang.Object other)
          Returns true if this DBFactory is equal to the specified object.
static java.lang.String getActualTableName(java.lang.String utableName)
          Gets the actual table name for the specified class module table name
 boolean getAllowInnoDBCOUNT()
          Gets Allow 'COUNT(*)'
 DBAlternateIndex getAlternateIndex(java.lang.String name)
          Returns the DBAlternateIndex definition for the specified alternate index name
 int getAlternateIndexCount()
          Returns the number of alternate indexes defined for this table
 DBAlternateIndex[] getAlternateIndexes()
          Returns the DBAlternateIndex definition (if any) for this DBFactory
 java.lang.String[] getAlternateIndexNames()
          Returns an array of alternate index names (if any) for this DBFactory
 DBField getAutoIndexField()
          Gets the "autoIndex" key field (if any)
 DBFactory<? extends DBRecord>[] getChildFactories()
          Returns the DBFactories of the dependent children of this table
 java.lang.String getDescription(java.util.Locale loc)
          Return the description of the table represented by this DBFactory
 java.util.Map<java.lang.String,DBField> getExistingColumnMap(boolean update)
          Retrieves the list of existing columns in the database for this DBFactory
 DBField[] getExistingColumns(boolean update)
          Retrieves an array of existing columns in the database for this DBFactory
static DBFactory getFactoryByName(java.lang.String utableName)
          Gets the DBFactory for the specified table name
 DBField getField(java.lang.String name)
          Gets the DBField for the specified name
 int getFieldCount()
          Returns the number of defined fields in this DBFactory
 java.lang.String[] getFieldNames()
          Returns a String array of all field names defined in this DBFactory
static java.lang.String[] getFieldNames(DBField[] flds)
          Returns an array of names for the specified fields
 DBField[] getFields()
          Returns an array of all DBFields defined by this DBFactory
 DBField[] getFields(java.util.Set<java.lang.String> fieldNames)
          Returns a set of DBFields defined by this DBFactory
 DBField[] getFields(java.lang.String... fieldNames)
          Returns a set of DBFields defined by this DBFactory
 int getFieldStringLength(java.lang.String name)
          Gets the String length for the specified DBField
 DBField[] getFieldsWithBoolean(java.lang.String key, boolean value)
          Returns all fields which have the specified property set to the specified boolean value.
 java.lang.String getIndexType()
          Gets the MySQL index type (engine)
 java.lang.Class<? extends DBRecordKey<gDBR>> getKeyClass()
          Gets the key class
 DBField[] getKeyFields()
          Gets a list of primary key fields
 java.lang.String[] getKeyNames()
          Gets a list of field names representing the primary keys fields
 java.lang.String getKeyType()
          Gets the key type
static java.lang.String getKeyTypeName(DBFactory.KeyType type)
          Returns the key type String name for the specified key type index
 java.lang.String getMappedFieldName(java.lang.String cn)
          This method can be used for field 'renaming'.
 long getMySQLTableStatus()
          Retrieve the current table status.
 DBField[] getNamedFields(java.lang.String[] fieldNames)
          Return an array of DBFields matching the names of the specified fields.
 java.util.List<java.lang.String> getParentTables()
          Get the list of parent ancestors
 java.lang.Class<gDBR> getRecordClass()
          Returns the DBRecord class for this DBFactory
 long getRecordCount(DBWhere where, boolean actualCount)
          Returns the number of records contained in the table represented by this DBFactory and based on the specified 'where' clause.
 long getRecordCount(java.lang.String where, boolean actualCount)
          Returns the number of records contained in the table represented by this DBFactory and based on the specified 'where' clause.
 DBRecordListener<gDBR> getRecordListener()
          Gets the DBRecordListnener for this DBFactory
 java.lang.String getTranslatedTableName()
          Gets the translated table name for this DBSelect
 java.lang.String getUntranslatedTableName()
          Returns the untranslated table for for this DBFactory
 boolean hasAlternateIndexes()
          Returns true if this DBFactory supports any alternate indexes
 boolean hasField(java.lang.String name)
          Returns true if the specified field exists in this DBFactory
 int hashCode()
          Returns this hashcode for this DBFactory
 boolean hasParentTable(java.lang.String utableName)
          Returns true if this table has the specified table name as a parent
 boolean isEditable()
          Returns true if this table is editable
 boolean isMySQLInnoDB()
          Returns true if this table is MySQL and "InnoDB"
 boolean isRequired()
          Returns true if this table is required.
 boolean isViewable()
          Returns true if this table is viewable
 long loadTable(java.io.File fromFile)
          Loads the data in the specified file into the table represented by this DBFactory
 long loadTable(java.io.File fromFile, boolean insertRecords, boolean overwriteExisting)
          Deprecated. 
 long loadTable(java.io.File fromFile, boolean insertRecords, boolean overwriteExisting, boolean noDropWarning)
          Loads the data in the specified file into the table represented by this DBFactory
 long loadTable(java.io.File fromFile, DBFactory.InsertionValidator validator, boolean insertRecords, boolean overwriteExisting)
          Deprecated. 
 long loadTable(java.io.File fromFile, DBFactory.InsertionValidator validator, boolean insertRecords, boolean overwriteExisting, boolean noDropWarning)
          Loads the data in the specified file into the table represented by this DBFactory
 boolean logMissingColumnWarning()
          Returns true to log warnings regarding missing columns on insert/update
static boolean mysqlTableExistsUseSelectCount()
           
static DBFactory parseXML_DBFactory(org.w3c.dom.Element node, java.lang.String... nodeNames)
          Parse and return a DBFactory from the specified XML node atribute "table".
static DBRecord<?> parseXML_DBRecord(org.w3c.dom.Element rcdTag)
          Parse and return a DBRecord from the specified XML node.
static DBRecordKey<?> parseXML_DBRecordKey(org.w3c.dom.Element rcdTag)
          Parse and return a DBRecordKey from the specified XML node.
static java.util.Map<java.lang.String,java.lang.String> parseXML_FieldValueMap(org.w3c.dom.Element node, DBFactory tableFact)
          Parse and return a field value map from "Field" child node of the specified XML node element.
 void recordDidInsert(gDBR rcd)
          Callback after record has been be inserted into the table
 void recordDidUpdate(gDBR rcd)
          Callback after record has been be updated in the table
 void recordWillInsert(gDBR rcd)
          Callback when record is about to be inserted into the table
 void recordWillUpdate(gDBR rcd)
          Callback when record is about to be updated in the table
 void recreateAlternateIndexes()
          Recreates the alternate key index for the table represented by this DBFactory
 void recreatePrimaryKey()
          Recreates the Primary Key for the table represented by this DBFactory
 void setAllowInnoDBCOUNT(boolean countOK)
          Gets Allow 'COUNT(*)'
static void setCustomFactoryHandler(DBFactory.CustomFactoryHandler factoryHandler)
          Sets the global CustomFactoryHandler
 boolean setFieldDefaultValue(java.lang.String fldName, java.lang.Object dftVal)
          Set the field default value.
 void setLogMissingColumnWarnings(boolean state)
          Sets the state for logging warnings for missing table columns
 void setRecordListener(DBRecordListener<gDBR> rcdListener)
          Sets the DBRecordListnener for this DBFactory param rcdListener The DBRecordListener
 void setRequired(boolean required)
          Sets the 'required' state of this DBFactory
 boolean supportsEfficientCount()
          Return true if this DBFactory suports efficient records countins.
 boolean tableExists()
          Return true if the table represented by this DBFactory exists
 boolean tableRequired()
          Return true if the table represented by this DBFactory is required
 java.lang.String toString()
          Returns a String representation of this DBFactory (the table name)
 java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent)
          Returns an XML representation of this DBFactory
 java.lang.StringBuffer toXML(java.lang.StringBuffer sb, int indent, boolean soapXML)
          Returns an XML representation of this DBFactory
 boolean validateColumns()
          Validate all existing table columns against the list of defined table columns.
 boolean validateColumns(int validateMask)
          Validate all existing table columns against the list of defined table columns.
 boolean validateColumns(int validateMask, boolean refreshColumns)
          Validate all existing table columns against the list of defined table columns.
 java.util.List validateFieldBeanMethods(DBField field)
          Validate the specified DBField for proper getter/setter bean access methods
 boolean validateTable(boolean inclWarn)
          Validates the table defined by this DBFactory.
 void validateTableBeanMethods()
          Validates all bean-access methods for this DBFactory
static java.lang.StringBuffer writeXML_DBField(java.lang.StringBuffer sb, int indent, DBField fld, boolean inclInfo, java.lang.String value)
          Create an XML DBField description tag
static java.lang.StringBuffer writeXML_DBField(java.lang.StringBuffer sb, int indent, DBField fld, boolean inclInfo, java.lang.String value, boolean soapXML)
          Create an XML DBField description tag
static java.lang.StringBuffer writeXML_DBFields(java.lang.StringBuffer sb, int indent, DBField[] fld, DBFieldValues fldVals)
          Create a list of XML DBField description tags with values
static java.lang.StringBuffer writeXML_DBFields(java.lang.StringBuffer sb, int indent, DBField[] fld, DBFieldValues fldVals, boolean soapXML)
          Create XML DBField description XML (entity reference encoded)
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

ARCHIVE_EXT_CSV

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

ARCHIVE_EXT_DUMP

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

ARCHIVE_EXT_SQL

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

ARCHIVE_EXT_TXT

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

ARCHIVE_EXT_XML

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

CMD_dbget

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

CMD_dbput

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

CMD_dbdel

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

CMD_dbcreate

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

CMD_dbschema

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

TAG_TableSchemas

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

TAG_TableSchema

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

TAG_Records

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

TAG_Record

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

TAG_RecordKeys

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

TAG_RecordKey

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

TAG_Field

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

TAG_Description

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

ATTR_table

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

ATTR_name

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

ATTR_sequence

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

ATTR_type

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

ATTR_title

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

ATTR_primaryKey

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

ATTR_alternateKeys

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

ATTR_partial

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

ATTR_count

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

SQLERR_DATABASE_EXISTS

public static final int SQLERR_DATABASE_EXISTS
See Also:
Constant Field Values

SQLERR_INVALID_AUTH

public static final int SQLERR_INVALID_AUTH
See Also:
Constant Field Values

SQLERR_UNKNOWN_DATABASE

public static final int SQLERR_UNKNOWN_DATABASE
See Also:
Constant Field Values

SQLERR_UNKNOWN_COLUMN

public static final int SQLERR_UNKNOWN_COLUMN
See Also:
Constant Field Values

SQLERR_DUPLICATE_KEY

public static final int SQLERR_DUPLICATE_KEY
See Also:
Constant Field Values

SQLERR_SYNTAX_ERROR

public static final int SQLERR_SYNTAX_ERROR
See Also:
Constant Field Values

SQLERR_TABLE_NOTLOCKED

public static final int SQLERR_TABLE_NOTLOCKED
See Also:
Constant Field Values

SQLERR_TABLE_NONEXIST

public static final int SQLERR_TABLE_NONEXIST
See Also:
Constant Field Values

MSQL_ERR_INVALID_OBJECT

public static final int MSQL_ERR_INVALID_OBJECT
See Also:
Constant Field Values

MSQL_ERR_CANT_DROP_TABLE

public static final int MSQL_ERR_CANT_DROP_TABLE
See Also:
Constant Field Values

MSQL_ERR_LOGIN_EXISTS

public static final int MSQL_ERR_LOGIN_EXISTS
See Also:
Constant Field Values

MSQL_ERR_USER_EXISTS

public static final int MSQL_ERR_USER_EXISTS
See Also:
Constant Field Values

TableNameMap

protected static java.util.HashMap<java.lang.String,java.lang.String> TableNameMap

factoryList

protected static java.util.List<DBFactory> factoryList

_DUMP_EXT_TXT

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

_DUMP_EXT_SQL

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

_DUMP_EXT_CSV

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

_DUMP_EXT_XML

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

DUMP_FORMAT_CSV

public static final int DUMP_FORMAT_CSV
See Also:
Constant Field Values

DUMP_FORMAT_SQL

public static final int DUMP_FORMAT_SQL
See Also:
Constant Field Values

DUMP_FORMAT_XML

public static final int DUMP_FORMAT_XML
See Also:
Constant Field Values

_LOAD_EXT_CSV

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

_LOAD_EXT_DUMP

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

_LOAD_EXT_SQL

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

_LOAD_EXT_TXT

public static final java.lang.String _LOAD_EXT_TXT
See Also:
Constant Field Values
Constructor Detail

DBFactory

public DBFactory(java.lang.String utableName,
                 DBField[] field,
                 DBFactory.KeyType keyType,
                 java.lang.Class<gDBR> rcdClass,
                 java.lang.Class<? extends DBRecordKey<gDBR>> keyClass,
                 boolean editable,
                 boolean viewable)
Constructor

Parameters:
utableName - The untranslated name of the table
field - The DBFields in the table
keyType - The table key type
rcdClass - The DBRecord subclass representing the table
keyClass - The DBRecordKey subclass representing the table key
editable - True if this table should be editable, false otherwise. This value is used by the GTSAdmin application.
viewable - True if this table should be viewable, false otherwise. An 'editable' table is automatically considered viewable. This value is used by the GTSAdmin application.
Method Detail

mysqlTableExistsUseSelectCount

public static boolean mysqlTableExistsUseSelectCount()

setCustomFactoryHandler

public static void setCustomFactoryHandler(DBFactory.CustomFactoryHandler factoryHandler)
Sets the global CustomFactoryHandler

Parameters:
factoryHandler - The CustomFactoryHandler

addActualTableName

protected static void addActualTableName(java.lang.String globalTableName,
                                         java.lang.String actualTableName)
Add a table name mapping

Parameters:
globalTableName - Class name of table (sans package name)
actualTableName - Assigned name of table (untranslated)

getActualTableName

public static java.lang.String getActualTableName(java.lang.String utableName)
Gets the actual table name for the specified class module table name


getFactoryByName

public static DBFactory getFactoryByName(java.lang.String utableName)
Gets the DBFactory for the specified table name

Parameters:
utableName - The untranslated table name
Returns:
The DBFactory for the specified table, or null if the table cannot be found

createDBFactory

public static <T extends DBRecord<T>> DBFactory<T> createDBFactory(java.lang.String utableName,
                                                                   DBField[] field,
                                                                   DBFactory.KeyType keyType,
                                                                   java.lang.Class<T> rcdClass,
                                                                   java.lang.Class<? extends DBRecordKey<T>> keyClass,
                                                                   boolean editable,
                                                                   boolean viewable)
Create a DBFactory instance.

Parameters:
utableName - The untranslated name of the table
field - The DBFields in the table
keyType - The table key type
rcdClass - The DBRecord subclass representing the table
keyClass - The DBRecordKey subclass representing the table key
editable - True if this table should be editable, false otherwise. This value is used by the GTSAdmin application.
viewable - True if this table should be viewable, false otherwise. An 'editable' table is automatically considered viewable. This value is used by the GTSAdmin application.
Returns:
The DBFactory instance.

getDescription

public java.lang.String getDescription(java.util.Locale loc)
Return the description of the table represented by this DBFactory

Parameters:
loc - The Locale representing the language for the returned description
Returns:
The description of the table

setRequired

public void setRequired(boolean required)
Sets the 'required' state of this DBFactory

Parameters:
required - The 'required' state

isRequired

public boolean isRequired()
Returns true if this table is required.

Returns:
True if this table is required

isEditable

public boolean isEditable()
Returns true if this table is editable

Returns:
True if this table is editable

isViewable

public boolean isViewable()
Returns true if this table is viewable

Returns:
True if this table is viewable

clearExistingColumnMap

public void clearExistingColumnMap()
Clears the column map for the existing columns


getExistingColumnMap

public java.util.Map<java.lang.String,DBField> getExistingColumnMap(boolean update)
                                                             throws DBException
Retrieves the list of existing columns in the database for this DBFactory

Parameters:
update - True to update the current map, false to return the previously cached map
Returns:
A map of exiting table columns
Throws:
DBException - If a database error occurs

getExistingColumns

public DBField[] getExistingColumns(boolean update)
                             throws DBException
Retrieves an array of existing columns in the database for this DBFactory

Parameters:
update - True to update the current list of columns, false to return the previously cached columns
Returns:
An array of exiting table columns
Throws:
DBException - If a database error occurs

validateColumns

public boolean validateColumns()
Validate all existing table columns against the list of defined table columns. Warnings will be printed to the console.

Returns:
True if the validation was successful with no errors, false otherwise

validateColumns

public boolean validateColumns(int validateMask)
Validate all existing table columns against the list of defined table columns.

Parameters:
validateMask - A bitmask indicating which type(s) of validation to perform
Returns:
True if the validation was successful with no errors, false otherwise

validateColumns

public boolean validateColumns(int validateMask,
                               boolean refreshColumns)
Validate all existing table columns against the list of defined table columns.

Parameters:
validateMask - A bitmask indicating which type(s) of validation to perform
refreshColumns - If true, the list of existing columns will be updated prior to validation.
Returns:
True if the validation was successful with no errors, false otherwise

getFields

public DBField[] getFields()
Returns an array of all DBFields defined by this DBFactory

Returns:
An array of defined DBFields

getFields

public DBField[] getFields(java.util.Set<java.lang.String> fieldNames)
Returns a set of DBFields defined by this DBFactory

Parameters:
fieldNames - A set of field names representing fields to return (null for all) field names which are not defined in this DBFactory are quietly ignored.
Returns:
A set of DBFields

getFields

public DBField[] getFields(java.lang.String... fieldNames)
Returns a set of DBFields defined by this DBFactory

Parameters:
fieldNames - An array of field names representing fields to return (null for all). Field names which are not defined in this DBFactory are quietly ignored.
Returns:
A set of DBFields

getMappedFieldName

public java.lang.String getMappedFieldName(java.lang.String cn)
This method can be used for field 'renaming'. That is, converting an old obsolete name (ie. 'interval') to a new field name (ie. 'intervalMinutes'). This feature is currently not in use and exists here for future use.

Parameters:
cn - The old field name
Returns:
The new field name

hasField

public boolean hasField(java.lang.String name)
Returns true if the specified field exists in this DBFactory

Parameters:
name - A field name to test
Returns:
True if the specified field exists, false otherwise

getField

public DBField getField(java.lang.String name)
Gets the DBField for the specified name

Parameters:
name - The name of the field to retrieve
Returns:
The DBField for the specified name, or null if the field name was not found

getFieldStringLength

public int getFieldStringLength(java.lang.String name)
Gets the String length for the specified DBField

Parameters:
name - The name of the field for which the String length is retrieved.
Returns:
The String length of the specified DBField

getFieldCount

public int getFieldCount()
Returns the number of defined fields in this DBFactory

Returns:
The number of defined fields in this DBFactory

getFieldNames

public java.lang.String[] getFieldNames()
Returns a String array of all field names defined in this DBFactory

Returns:
The String array of field names defined in this DBFactory

getFieldNames

public static java.lang.String[] getFieldNames(DBField[] flds)
Returns an array of names for the specified fields

Parameters:
flds - An array of fields
Returns:
An array of the specified field names

getFieldsWithBoolean

public DBField[] getFieldsWithBoolean(java.lang.String key,
                                      boolean value)
Returns all fields which have the specified property set to the specified boolean value. This method searches the field property/attribute string for matching key/values.

Parameters:
key - The property key searched in the property/attribute string
value - The required value of the specified property used for inclusion in the return field list
Returns:
The list of fields matching the property/value criteria.

getNamedFields

public DBField[] getNamedFields(java.lang.String[] fieldNames)
Return an array of DBFields matching the names of the specified fields. If a field name is not found, it will be omitted from the returned DBField array.

Parameters:
fieldNames - The field names for which the array of DBFields will be returned
Returns:
The array of DBFields

setFieldDefaultValue

public boolean setFieldDefaultValue(java.lang.String fldName,
                                    java.lang.Object dftVal)
Set the field default value.

Parameters:
fldName - The field name
dftVal - The default value (no checking is done on the datatype)
Returns:
True if the specified field name exists, false otherwise

setLogMissingColumnWarnings

public void setLogMissingColumnWarnings(boolean state)
Sets the state for logging warnings for missing table columns

Parameters:
state - True to warn (default), false otherwise

logMissingColumnWarning

public boolean logMissingColumnWarning()
Returns true to log warnings regarding missing columns on insert/update

Returns:
True to log warnings, false otherwise

getAutoIndexField

public DBField getAutoIndexField()
Gets the "autoIndex" key field (if any)

Returns:
The "autoIndex" key field, or null if not found

getKeyFields

public DBField[] getKeyFields()
Gets a list of primary key fields

Returns:
An array of primary key fields

getKeyNames

public java.lang.String[] getKeyNames()
Gets a list of field names representing the primary keys fields

Returns:
A String arry of primary key field names

getKeyType

public java.lang.String getKeyType()
Gets the key type

Returns:
The key type

getKeyTypeName

public static java.lang.String getKeyTypeName(DBFactory.KeyType type)
Returns the key type String name for the specified key type index

Parameters:
type - The key type index
Returns:
The key type name

getKeyClass

public java.lang.Class<? extends DBRecordKey<gDBR>> getKeyClass()
Gets the key class

Returns:
The key class

createKey

public DBRecordKey<gDBR> createKey()
                                             throws DBException
Creates/returns an empty DBRecordKey for this DBFactory

Returns:
A DBRecordKey instance
Throws:
DBException - If a database error occurs

createKey

public DBRecordKey<gDBR> createKey(java.sql.ResultSet rs)
                                             throws DBException
Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified ResultSet

Parameters:
rs - The SQL query ResultSet
Returns:
The DBRecordKey
Throws:
DBException - If a database error occurs

createKey

public DBRecordKey<gDBR> createKey(java.util.Map<java.lang.String,java.lang.String> valMap)
                                             throws DBException
Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified Value-Map

Parameters:
valMap - The Field==>Value map
Returns:
The DBRecordKey
Throws:
DBException - If a database error occurs

createKey

public DBRecordKey<gDBR> createKey(java.util.Map<java.lang.String,java.lang.String> valMap,
                                   int partialKeyType)
                                             throws DBException
Creates/returns a DBRecordKey for this DBFactory populated with key values from the specified Value-Map

Parameters:
valMap - The Field==>Value map
partialKeyType - DBWhere [KEY_FULL|KEY_PARTIAL_FIRST|KEY_PARTIAL_ALL]
Returns:
The DBRecordKey [CHECK]
Throws:
DBException - If no key field specified or field no found

createRecord

public gDBR createRecord(java.sql.ResultSet rs)
                                   throws DBException
Creates/returns a DBRecord for this DBFactory populated with key values from the specified ResultSet (record not yet saved)

Parameters:
rs - The SQL query ResultSet
Returns:
The DBRecord
Throws:
DBException - If a database error occurs

createRecord

public gDBR createRecord(java.util.Map<java.lang.String,java.lang.String> valMap)
                                   throws DBException
Creates/returns a DBRecord for this DBFactory populated with key values from the specified Value-Map (record not yet saved)

Parameters:
valMap - The Field==>Value map
Returns:
The DBRecord
Throws:
DBException - If a database error occurs

createRecord

public gDBR createRecord(org.w3c.dom.Element record)
                                   throws DBException
Creates/returns a DBRecord for this DBFactory populated with key values from the specified XML Element

Parameters:
record - The XML Element
Returns:
The DBRecord
Throws:
DBException - If field does not specify a 'name' or a general DB exception occurs

getAlternateIndexCount

public int getAlternateIndexCount()
Returns the number of alternate indexes defined for this table

Returns:
The number of alternate indexes defined for this table

hasAlternateIndexes

public boolean hasAlternateIndexes()
Returns true if this DBFactory supports any alternate indexes

Returns:
True if this DBFactory supports any alternate indexes

getAlternateIndexes

public DBAlternateIndex[] getAlternateIndexes()
Returns the DBAlternateIndex definition (if any) for this DBFactory

Returns:
The DBAlternateIndex definition, or null if this table has no alternate indexes

getAlternateIndexNames

public java.lang.String[] getAlternateIndexNames()
Returns an array of alternate index names (if any) for this DBFactory

Returns:
An array of alternate index names (if any) for this DBFactory

getAlternateIndex

public DBAlternateIndex getAlternateIndex(java.lang.String name)
Returns the DBAlternateIndex definition for the specified alternate index name

Returns:
The DBAlternateIndex definition, or null if the named index is not found

getRecordClass

public java.lang.Class<gDBR> getRecordClass()
Returns the DBRecord class for this DBFactory

Returns:
The DBRecord class

getUntranslatedTableName

public java.lang.String getUntranslatedTableName()
Returns the untranslated table for for this DBFactory

Returns:
The table name

getTranslatedTableName

public java.lang.String getTranslatedTableName()
Gets the translated table name for this DBSelect

Returns:
The defined table name

tableExists

public boolean tableExists()
                    throws DBException
Return true if the table represented by this DBFactory exists

Returns:
True if the table exists
Throws:
DBException - If a database error occurs

tableRequired

public boolean tableRequired()
Return true if the table represented by this DBFactory is required

Returns:
True if the table is required

getMySQLTableStatus

public long getMySQLTableStatus()
                         throws DBException
Retrieve the current table status.

Returns:
The current number of rows in the table
Throws:
DBException - if an error occured fetching table status

validateTable

public boolean validateTable(boolean inclWarn)
Validates the table defined by this DBFactory.

Parameters:
inclWarn - If true, warnings will also be displayed
Returns:
True if this validation passed, false otherwise

addColumns

public int addColumns(DBField[] cols,
                      int ndx)
               throws DBException
Adds the specified column to this table, or alters the column if it already exists.

Parameters:
cols - An array of columns to add/alter
ndx - The index of the first column to start adding/altering
Returns:
The number of columns added/altered
Throws:
DBException - If a database error occurs

_addColumns

protected int _addColumns(DBField[] cols,
                          int ndx)
                   throws java.sql.SQLException,
                          DBException
Adds the specified column to this table, or alters the column if it already exists.

Parameters:
cols - An array of columns to add/alter
ndx - The index of the first column to start adding/altering
Returns:
The number of columns added/altered
Throws:
java.sql.SQLException - If an SQL error occurs
DBException - If a database error occurs

dropColumn

public void dropColumn(DBField col)
                throws DBException
Drips the specified column from this table

Parameters:
col - The column specification to drop
Throws:
DBException - If a database error occurs

_dropColumn

protected void _dropColumn(DBField col)
                    throws java.sql.SQLException,
                           DBException
Drips the specified column from this table

Parameters:
col - The column specification to drop
Throws:
java.sql.SQLException - If an SQL error occurs
DBException - If a database error occurs

recreatePrimaryKey

public void recreatePrimaryKey()
                        throws DBException
Recreates the Primary Key for the table represented by this DBFactory

Throws:
DBException - If a database error occurs

recreateAlternateIndexes

public void recreateAlternateIndexes()
                              throws DBException
Recreates the alternate key index for the table represented by this DBFactory

Throws:
DBException

createTable

public void createTable()
                 throws DBException
Creates the table represented by this DBFactory

Throws:
DBException - If a database error occurs

dropTable

public void dropTable()
               throws DBException
Drops the table represented by this DBFactory

Throws:
DBException - If a database error occurs

dumpTable

public void dumpTable(java.io.File toFile)
               throws DBException
Dumps the table represented by this DBFactory to the specified file

Parameters:
toFile - The destination file
Throws:
DBException - If a database error occurs

dumpTable

public void dumpTable(java.io.File toFile,
                      DBSelect<gDBR> dsel)
               throws DBException
Dumps the table represented by this DBFactory to the specified file.

Parameters:
toFile - The destination file
dsel - The selection specification indicating which records should be 'dumped'
Throws:
DBException - If a database error occurs

dumpTable

public void dumpTable(java.io.File toFile,
                      DBSelect<gDBR> dsel,
                      java.lang.String[] fldn)
               throws DBException
Dumps the table represented by this DBFactory to the specified file.

Parameters:
toFile - The destination file
dsel - The selection specification indicating which records should be 'dumped'
fldn - A list of field names to include in the dump file
Throws:
DBException - If a database error occurs

_dumpTable

protected void _dumpTable(java.io.PrintWriter dumpOutStream,
                          DBSelect<gDBR> dsel,
                          java.lang.String[] fldn,
                          int outFmt)
                   throws DBException
Dumps the table represented by this DBFactory to the specified file.

Parameters:
dumpOutStream - The destination output stream
dsel - The selection specification indicating which records should be 'dumped'
outFmt - The output format
Throws:
DBException - If unable to successfully dump the table

loadTable

public long loadTable(java.io.File fromFile)
               throws DBException
Loads the data in the specified file into the table represented by this DBFactory

Parameters:
fromFile - The file containing the record data to load
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If a database error occurs

loadTable

@Deprecated
public long loadTable(java.io.File fromFile,
                                 boolean insertRecords,
                                 boolean overwriteExisting)
               throws DBException
Deprecated. 

Loads the data in the specified file into the table represented by this DBFactory

Parameters:
fromFile - The file containing the record data to load
insertRecords - True to insert records, false otherwise
overwriteExisting - True to overwrite existing matching records
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If a database error occurs

loadTable

public long loadTable(java.io.File fromFile,
                      boolean insertRecords,
                      boolean overwriteExisting,
                      boolean noDropWarning)
               throws DBException
Loads the data in the specified file into the table represented by this DBFactory

Parameters:
fromFile - The file containing the record data to load
insertRecords - True to insert records, false otherwise
overwriteExisting - True to overwrite existing matching records
noDropWarning - True to supress field "will be dropped" warnings.
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If a database error occurs

loadTable

@Deprecated
public long loadTable(java.io.File fromFile,
                                 DBFactory.InsertionValidator validator,
                                 boolean insertRecords,
                                 boolean overwriteExisting)
               throws DBException
Deprecated. 

Loads the data in the specified file into the table represented by this DBFactory

Parameters:
fromFile - The file containing the record data to load
validator - The InserstionValidator filter which determines whether a given record should be inserted into the table.
insertRecords - True to insert records, false otherwise
overwriteExisting - True to overwrite existing matching records
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If unable to load the table

loadTable

public long loadTable(java.io.File fromFile,
                      DBFactory.InsertionValidator validator,
                      boolean insertRecords,
                      boolean overwriteExisting,
                      boolean noDropWarning)
               throws DBException
Loads the data in the specified file into the table represented by this DBFactory

Parameters:
fromFile - The file containing the record data to load
validator - The InserstionValidator filter which determines whether a given record should be inserted into the table.
insertRecords - True to insert records, false otherwise
overwriteExisting - True to overwrite existing matching records
noDropWarning - True to supress field "will be dropped" warnings.
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If unable to load the table

_loadTable

protected long _loadTable(java.lang.String[] oldFieldNames,
                          java.io.File fromFile,
                          DBFactory.InsertionValidator validator,
                          boolean insertRecords,
                          boolean overwriteExisting,
                          boolean noDropWarning)
                   throws DBException
Loads the data in the specified file into the table represented by this DBFactory

Parameters:
oldFieldNames - A list of field names to use for insertion validation instead of the list of field names present in the loaded file specification section.
fromFile - The file containing the record data to load
validator - The InserstionValidator filter which determines whether a given record should be inserted into the table.
insertRecords - True to insert records, false otherwise
overwriteExisting - True to overwrite existing matching records
noDropWarning - True to supress field "will be dropped" warnings.
Returns:
The number of records loaded into the table from the specified file
Throws:
DBException - If a database error occurs

_loadTableCSV

protected long _loadTableCSV(java.io.File fromFile,
                             DBFactory.InsertionValidator validator,
                             boolean insertRecords,
                             boolean overwriteExisting,
                             boolean noDropWarning)
                      throws DBException
Loads table data from the specified CSV file

Parameters:
fromFile - The CSV file
validator - The insertion validator
overwriteExisting - True to overwrite any existing db record, false to leave existing db record as-is
Returns:
The number of records loaded into the table
Throws:
DBException - If unable to load the table

addParentTable

public void addParentTable(java.lang.String utableName)
Adds this table as a dependent of the specified parent table name

Parameters:
utableName - The parent untranslated table name

getParentTables

public java.util.List<java.lang.String> getParentTables()
Get the list of parent ancestors

Returns:
A list of parent ancestor table names that this table is a depentend of

hasParentTable

public boolean hasParentTable(java.lang.String utableName)
Returns true if this table has the specified table name as a parent

Parameters:
utableName - The parent untranslated table name to test
Returns:
True if this table is a dependent of the specified table, false otherwise

getChildFactories

public DBFactory<? extends DBRecord>[] getChildFactories()
Returns the DBFactories of the dependent children of this table

Returns:
An array of dependent children DBFactories

getIndexType

public java.lang.String getIndexType()
Gets the MySQL index type (engine)


isMySQLInnoDB

public boolean isMySQLInnoDB()
Returns true if this table is MySQL and "InnoDB"


supportsEfficientCount

public boolean supportsEfficientCount()
Return true if this DBFactory suports efficient records countins.


getAllowInnoDBCOUNT

public boolean getAllowInnoDBCOUNT()
Gets Allow 'COUNT(*)'


setAllowInnoDBCOUNT

public void setAllowInnoDBCOUNT(boolean countOK)
Gets Allow 'COUNT(*)'


getRecordCount

public long getRecordCount(java.lang.String where,
                           boolean actualCount)
                    throws DBException
Returns the number of records contained in the table represented by this DBFactory and based on the specified 'where' clause.

Parameters:
where - The 'where' selection clause
actualCount - True to return actual record count, false for estimated (InnoDB only)
Returns:
The number of records contained in the SQL table.
Throws:
DBException - If a database error occurs

getRecordCount

public long getRecordCount(DBWhere where,
                           boolean actualCount)
                    throws DBException
Returns the number of records contained in the table represented by this DBFactory and based on the specified 'where' clause.

Parameters:
where - The 'where' selection clause
Returns:
The number of records contained in the SQL table.
Throws:
DBException - If a database error occurs

toXML

public java.lang.StringBuffer toXML(java.lang.StringBuffer sb,
                                    int indent)
Returns an XML representation of this DBFactory

Returns:
An XML representation of this DBFactory

toXML

public java.lang.StringBuffer toXML(java.lang.StringBuffer sb,
                                    int indent,
                                    boolean soapXML)
Returns an XML representation of this DBFactory

Returns:
An XML representation of this DBFactory

toString

public java.lang.String toString()
Returns a String representation of this DBFactory (the table name)

Overrides:
toString in class java.lang.Object
Returns:
The table name of this DBFactory

equals

public boolean equals(java.lang.Object other)
Returns true if this DBFactory is equal to the specified object. (DBFactories are considered equivalent if their table names are equivalent)

Overrides:
equals in class java.lang.Object
Parameters:
other - The other Object to test
Returns:
True if the 'other' Object is equals to this DBFactory

hashCode

public int hashCode()
Returns this hashcode for this DBFactory

Overrides:
hashCode in class java.lang.Object
Returns:
The hascode for this DBFactory

setRecordListener

public void setRecordListener(DBRecordListener<gDBR> rcdListener)
Sets the DBRecordListnener for this DBFactory param rcdListener The DBRecordListener


getRecordListener

public DBRecordListener<gDBR> getRecordListener()
Gets the DBRecordListnener for this DBFactory

Returns:
The DBRecordListener

recordWillInsert

public void recordWillInsert(gDBR rcd)
Callback when record is about to be inserted into the table

Specified by:
recordWillInsert in interface DBRecordListener<gDBR extends DBRecord>
Parameters:
rcd - The record about to be inserted

recordDidInsert

public void recordDidInsert(gDBR rcd)
Callback after record has been be inserted into the table

Specified by:
recordDidInsert in interface DBRecordListener<gDBR extends DBRecord>
Parameters:
rcd - The record that was just inserted

recordWillUpdate

public void recordWillUpdate(gDBR rcd)
Callback when record is about to be updated in the table

Specified by:
recordWillUpdate in interface DBRecordListener<gDBR extends DBRecord>
Parameters:
rcd - The record about to be updated

recordDidUpdate

public void recordDidUpdate(gDBR rcd)
Callback after record has been be updated in the table

Specified by:
recordDidUpdate in interface DBRecordListener<gDBR extends DBRecord>
Parameters:
rcd - The record that was just updated

_beanMethodName

protected static java.lang.String _beanMethodName(java.lang.String prefix,
                                                  java.lang.String fieldName)
Returns the BeanMethod name for the specified field name

Parameters:
prefix - The "get" or "set" prefix
fieldName - The field name
Returns:
The bean-method nane

_methodScope

protected static java.lang.String _methodScope(int mods)
Returns the String representation of the scope 'modifications'

Parameters:
mods - The method modifications
Returns:
The String representation of the scope

validateFieldBeanMethods

public java.util.List validateFieldBeanMethods(DBField field)
Validate the specified DBField for proper getter/setter bean access methods

Parameters:
field - The DBField to validate
Returns:
A list of error message Strings, or null if no errors were encountered

validateTableBeanMethods

public void validateTableBeanMethods()
Validates all bean-access methods for this DBFactory


writeXML_DBFields

public static java.lang.StringBuffer writeXML_DBFields(java.lang.StringBuffer sb,
                                                       int indent,
                                                       DBField[] fld,
                                                       DBFieldValues fldVals)
Create a list of XML DBField description tags with values

Parameters:
sb - The StringBuffer to write the tag to
indent - The number of spaces to indent
fld - The DBFields to include
fldVals - The field column values
Returns:
The StringBuffer

writeXML_DBFields

public static java.lang.StringBuffer writeXML_DBFields(java.lang.StringBuffer sb,
                                                       int indent,
                                                       DBField[] fld,
                                                       DBFieldValues fldVals,
                                                       boolean soapXML)
Create XML DBField description XML (entity reference encoded)

Parameters:
sb - The StringBuffer to write the tag to
indent - The number of spaces to indent
fld - The DBFields to include
fldVals - The field column values
soapXML - True if SOAP XML
Returns:
The StringBuffer

writeXML_DBField

public static java.lang.StringBuffer writeXML_DBField(java.lang.StringBuffer sb,
                                                      int indent,
                                                      DBField fld,
                                                      boolean inclInfo,
                                                      java.lang.String value)
Create an XML DBField description tag

Parameters:
sb - The StringBuffer to write the tag to
indent - The number of spaces to indent
fld - The DBField to create a tag for
inclInfo - True if field datatype/description should be included
value - The value of the tag element
Returns:
The StringBuffer

writeXML_DBField

public static java.lang.StringBuffer writeXML_DBField(java.lang.StringBuffer sb,
                                                      int indent,
                                                      DBField fld,
                                                      boolean inclInfo,
                                                      java.lang.String value,
                                                      boolean soapXML)
Create an XML DBField description tag

Parameters:
sb - The StringBuffer to write the tag to
indent - The number of spaces to indent
fld - The DBField to create a tag for
inclInfo - True if field datatype/description should be included
value - The value of the tag element
soapXML - True is SOAP XML
Returns:
The StringBuffer comtaining the XML

parseXML_DBFactory

public static DBFactory parseXML_DBFactory(org.w3c.dom.Element node,
                                           java.lang.String... nodeNames)
                                    throws DBException
Parse and return a DBFactory from the specified XML node atribute "table". The specified node is expected have a "table" attribute.

Parameters:
node - The XML node
nodeNames - A list of valid/expected node names
Returns:
The DBFactory
Throws:
DBException - if unable to create the DBFactory

parseXML_FieldValueMap

public static java.util.Map<java.lang.String,java.lang.String> parseXML_FieldValueMap(org.w3c.dom.Element node,
                                                                                      DBFactory tableFact)
                                                                               throws DBException
Parse and return a field value map from "Field" child node of the specified XML node element.

Parameters:
node - The XML node
Returns:
The field value map
Throws:
DBException - if unable to create the field value map

parseXML_DBRecordKey

public static DBRecordKey<?> parseXML_DBRecordKey(org.w3c.dom.Element rcdTag)
                                           throws DBException
Parse and return a DBRecordKey from the specified XML node. The specified node is expected to be a "RecordKey" tag

Parameters:
rcdTag - The XML node representing a "RecordKey" tag
Returns:
The DBRecordKey
Throws:
DBException - if unable to create the DBRecordKey

parseXML_DBRecord

public static DBRecord<?> parseXML_DBRecord(org.w3c.dom.Element rcdTag)
                                     throws DBException
Parse and return a DBRecord from the specified XML node. The specified node is expected to be a "Record" tag

Parameters:
rcdTag - The XML node representing a "Record" tag
Returns:
The DBRecord
Throws:
DBException - if unable to create the DBRecord