| java.lang.Object com.knowgate.dataobjs.DBTable
All known Subclasses: com.knowgate.hipergate.datamodel.TableLoader,
DBTable | public class DBTable (Code) | | A database table as a Java Object
author: Sergio Montoro Ten version: 3.0 |
Constructor Summary | |
public | DBTable(String sTableName) Constructor
Catalog and schema names are set to null.
Table index is set to 1. | public | DBTable(String sCatalogName, String sSchemaName, String sTableName, int iIndex) |
Method Summary | |
public int | columnCount() | public boolean | deleteRegister(JDCConnection oConn, HashMap AllValues) Delete a single register from this table at the database
Parameters: oConn - Database connection Parameters: AllValues - A Map with, at least, the primary key values for the register. | public boolean | existsRegister(JDCConnection oConn, String sQueryString) | public boolean | existsRegister(JDCConnection oConn, String sQueryString, Object[] oQueryParams) | public boolean | existsRegister(JDCConnection oConn, HashMap AllValues) | public String | getCatalog() | public DBColumn | getColumnByName(String sColumnName) | public int | getColumnIndex(String sColumnName) | public LinkedList | getColumns() | public String | getColumnsStr() | public String | getName() | public LinkedList | getPrimaryKey() | public String | getSchema() | public int | hashCode() | public boolean | loadRegister(JDCConnection oConn, Object[] PKValues, HashMap AllValues) Load a single table register into a Java HashMap
Parameters: oConn - Database Connection Parameters: PKValues - Primary key values of register to be readed, in the same order as they appear in table source. Parameters: AllValues - Output parameter. | public void | readColumns(Connection oConn, DatabaseMetaData oMData) Read DBColumn List from DatabaseMetaData
This is primarily an internal initialization method for DBTable object. | public void | setCatalog(String sCatalogName) | public void | setSchema(String sSchemaName) | public boolean | storeRegister(JDCConnection oConn, HashMap AllValues) Store a single register at the database representing a Java Object
for register containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use
storeRegisterLong() method.
Columns named "dt_created" are invisible for storeRegister() method so that
register creation timestamp is not altered by afterwards updates.
Parameters: oConn - Database Connection Parameters: AllValues - Values to assign to fields. | public boolean | storeRegisterLong(JDCConnection oConn, HashMap AllValues, HashMap BinaryLengths) Store a single register at the database representing a Java Object
for register NOT containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use
storeRegister() method witch is faster than storeRegisterLong().
Columns named "dt_created" are invisible for storeRegisterLong() method so that
register creation timestamp is not altered by afterwards updates.
Parameters: oConn - Database Connection Parameters: AllValues - Values to assign to fields. Parameters: BinaryLengths - map of lengths for long fields. |
DBTable | public DBTable(String sTableName)(Code) | | Constructor
Catalog and schema names are set to null.
Table index is set to 1.
Parameters: sSchemaName - Database schema name |
DBTable | public DBTable(String sCatalogName, String sSchemaName, String sTableName, int iIndex)(Code) | | Constructor
Parameters: sCatalogName - Database catalog name Parameters: sSchemaName - Database schema name Parameters: sTableName - Database table name (not qualified) Parameters: iIndex - Ordinal number identifier for table |
deleteRegister | public boolean deleteRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code) | | Delete a single register from this table at the database
Parameters: oConn - Database connection Parameters: AllValues - A Map with, at least, the primary key values for the register. Other Map values are ignored. true if register was delete, false if register to be deleted was not found. throws: SQLException - |
existsRegister | public boolean existsRegister(JDCConnection oConn, String sQueryString) throws SQLException(Code) | | Checks if register exists at this table
Parameters: oConn - Database Connection Parameters: sQueryString - Register Query String, as a SQL WHERE clause syntax true if register exists, false otherwise. throws: SQLException - |
existsRegister | public boolean existsRegister(JDCConnection oConn, String sQueryString, Object[] oQueryParams) throws SQLException(Code) | | Checks if register exists at this table
Parameters: oConn - Database Connection Parameters: sQueryString - Register Query String, as a SQL WHERE clause syntax true if register exists, false otherwise. throws: SQLException - |
existsRegister | public boolean existsRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code) | | Checks if register exists at this table
Parameters: oConn - Database Connection true if register exists, false otherwise. throws: SQLException - |
getColumnByName | public DBColumn getColumnByName(String sColumnName) throws IllegalStateException(Code) | | Get DBColumn by name
Parameters: sColumnName - Column Name Reference to DBColumn ot null if no column with such name was found. throws: IllegalStateException - If column list for table has not been initialized |
getColumnIndex | public int getColumnIndex(String sColumnName)(Code) | | Get DBColumn index given its by name
Parameters: sColumnName - Column Name Column Index[1..columnsCount()] or -1 if no column with such name was found. |
getPrimaryKey | public LinkedList getPrimaryKey()(Code) | | List of primary key column names |
hashCode | public int hashCode()(Code) | | |
readColumns | public void readColumns(Connection oConn, DatabaseMetaData oMData) throws SQLException(Code) | | Read DBColumn List from DatabaseMetaData
This is primarily an internal initialization method for DBTable object.
Usually there is no need to call it from any other class.
Parameters: oConn - Database Connection Parameters: oMData - DatabaseMetaData throws: SQLException - |
setSchema | public void setSchema(String sSchemaName)(Code) | | Set schema name
Parameters: sSchemaName - String |
storeRegister | public boolean storeRegister(JDCConnection oConn, HashMap AllValues) throws SQLException(Code) | | Store a single register at the database representing a Java Object
for register containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use
storeRegisterLong() method.
Columns named "dt_created" are invisible for storeRegister() method so that
register creation timestamp is not altered by afterwards updates.
Parameters: oConn - Database Connection Parameters: AllValues - Values to assign to fields. true if register was inserted for first time, if it was updated. throws: SQLException - |
storeRegisterLong | public boolean storeRegisterLong(JDCConnection oConn, HashMap AllValues, HashMap BinaryLengths) throws IOException, SQLException(Code) | | Store a single register at the database representing a Java Object
for register NOT containing LONGVARBINARY, IMAGE, BYTEA or BLOB fields use
storeRegister() method witch is faster than storeRegisterLong().
Columns named "dt_created" are invisible for storeRegisterLong() method so that
register creation timestamp is not altered by afterwards updates.
Parameters: oConn - Database Connection Parameters: AllValues - Values to assign to fields. Parameters: BinaryLengths - map of lengths for long fields. true if register was inserted for first time, if it was updated. throws: SQLException - |
|
|