goldengate.common.database.data
Class DbDataModel

java.lang.Object
  extended by goldengate.common.database.data.AbstractDbData
      extended by goldengate.common.database.data.DbDataModel

public class DbDataModel
extends AbstractDbData

Example of Table object

Author:
Frederic Bregier

Nested Class Summary
static class DbDataModel.Columns
           
 
Nested classes/interfaces inherited from class goldengate.common.database.data.AbstractDbData
AbstractDbData.UpdatedInfo
 
Field Summary
static int[] dbTypes
           
static String fieldseq
           
static DbDataModel.Columns[] indexes
           
protected static String insertAllValues
           
static int NBPRKEY
           
protected static String selectAllFields
           
static String table
           
protected static String updateAllFields
           
 
Fields inherited from class goldengate.common.database.data.AbstractDbData
allFields, dbSession, isSaved, otherFields, primaryKey
 
Constructor Summary
DbDataModel(DbSession dbSession, String hostid)
           
DbDataModel(DbSession dbSession, String hostid, long rg, long wg, long rs, long ws, long del)
           
 
Method Summary
 void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
          Change UpdatedInfo status
 void delete()
          Delete object from table
 boolean exist()
          Test the existence of the current object
static DbDataModel getFromStatement(DbPreparedStatement preparedStatement)
          For instance from Commander when getting updated information
protected  String getInsertAllValues()
           
protected  String getSelectAllFields()
           
protected  String getTable()
           
protected  String getUpdateAllFields()
           
static DbPreparedStatement getUpdatedPrepareStament(DbSession session)
           
protected  String getWherePrimaryKey()
           
protected  void initObject()
          To setup primaryKey, otherFields, allFields.
 void insert()
          Insert object into table
 void select()
          Select object from table
protected  void setFromArray()
          Internal function to retrieve data from Array to pull data from database
protected  void setPrimaryKey()
          Set the primary Key as current value
protected  void setToArray()
          Internal function to set to Array used to push data to database
 void update()
          Update object to table
 
Methods inherited from class goldengate.common.database.data.AbstractDbData
get, getTrueValue, getValue, getValues, setTrueValue, setValue, setValues
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

dbTypes

public static final int[] dbTypes

table

public static final String table
See Also:
Constant Field Values

fieldseq

public static final String fieldseq
See Also:
Constant Field Values

indexes

public static final DbDataModel.Columns[] indexes

NBPRKEY

public static final int NBPRKEY
See Also:
Constant Field Values

selectAllFields

protected static final String selectAllFields

updateAllFields

protected static final String updateAllFields

insertAllValues

protected static final String insertAllValues
See Also:
Constant Field Values
Constructor Detail

DbDataModel

public DbDataModel(DbSession dbSession,
                   String hostid,
                   long rg,
                   long wg,
                   long rs,
                   long ws,
                   long del)
Parameters:
dbSession -
hostid -
rg - Read Global Limit
wg - Write Global Limit
rs - Read Session Limit
ws - Write Session Limit
del - Delay Limit

DbDataModel

public DbDataModel(DbSession dbSession,
                   String hostid)
            throws GoldenGateDatabaseException
Parameters:
dbSession -
hostid -
Throws:
GoldenGateDatabaseException
Method Detail

initObject

protected void initObject()
Description copied from class: AbstractDbData
To setup primaryKey, otherFields, allFields. Note this initObject is called within constructor of AbstractDbData. Be careful that no data is actually initialized at this stage.

Specified by:
initObject in class AbstractDbData

setToArray

protected void setToArray()
Description copied from class: AbstractDbData
Internal function to set to Array used to push data to database

Specified by:
setToArray in class AbstractDbData

setFromArray

protected void setFromArray()
                     throws GoldenGateDatabaseSqlException
Description copied from class: AbstractDbData
Internal function to retrieve data from Array to pull data from database

Specified by:
setFromArray in class AbstractDbData
Throws:
GoldenGateDatabaseSqlException

getSelectAllFields

protected String getSelectAllFields()
Specified by:
getSelectAllFields in class AbstractDbData

getTable

protected String getTable()
Specified by:
getTable in class AbstractDbData

getInsertAllValues

protected String getInsertAllValues()
Specified by:
getInsertAllValues in class AbstractDbData

getUpdateAllFields

protected String getUpdateAllFields()
Specified by:
getUpdateAllFields in class AbstractDbData

getWherePrimaryKey

protected String getWherePrimaryKey()
Specified by:
getWherePrimaryKey in class AbstractDbData
Returns:
The Where condition on Primary Key

setPrimaryKey

protected void setPrimaryKey()
Set the primary Key as current value

Specified by:
setPrimaryKey in class AbstractDbData

delete

public void delete()
            throws GoldenGateDatabaseException
Description copied from class: AbstractDbData
Delete object from table

Overrides:
delete in class AbstractDbData
Throws:
GoldenGateDatabaseException

insert

public void insert()
            throws GoldenGateDatabaseException
Description copied from class: AbstractDbData
Insert object into table

Overrides:
insert in class AbstractDbData
Throws:
GoldenGateDatabaseException

exist

public boolean exist()
              throws GoldenGateDatabaseException
Description copied from class: AbstractDbData
Test the existence of the current object

Overrides:
exist in class AbstractDbData
Returns:
True if the object exists
Throws:
GoldenGateDatabaseException

select

public void select()
            throws GoldenGateDatabaseException
Description copied from class: AbstractDbData
Select object from table

Overrides:
select in class AbstractDbData
Throws:
GoldenGateDatabaseException

update

public void update()
            throws GoldenGateDatabaseException
Description copied from class: AbstractDbData
Update object to table

Overrides:
update in class AbstractDbData
Throws:
GoldenGateDatabaseException

getFromStatement

public static DbDataModel getFromStatement(DbPreparedStatement preparedStatement)
                                    throws GoldenGateDatabaseNoConnectionException,
                                           GoldenGateDatabaseSqlException
For instance from Commander when getting updated information

Parameters:
preparedStatement -
Returns:
the next updated Configuration
Throws:
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException

getUpdatedPrepareStament

public static DbPreparedStatement getUpdatedPrepareStament(DbSession session)
                                                    throws GoldenGateDatabaseNoConnectionException,
                                                           GoldenGateDatabaseSqlException
Returns:
the DbPreparedStatement for getting Updated Object
Throws:
GoldenGateDatabaseNoConnectionException
GoldenGateDatabaseSqlException

changeUpdatedInfo

public void changeUpdatedInfo(AbstractDbData.UpdatedInfo info)
Description copied from class: AbstractDbData
Change UpdatedInfo status

Specified by:
changeUpdatedInfo in class AbstractDbData


Copyright © 2009-2012 Frederic Bregier. All Rights Reserved.