public class ExtDBSyncUpdate
extends java.lang.Object
Constructor and Description |
---|
ExtDBSyncUpdate(ExtDBSyncTableDef tableDef)
constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
checkDestExists(ExtDBSyncTableDef tableDef,
java.util.HashMap valMap)
Determines if a record already exists in the destination database
|
protected void |
doInsert(ExtDBSyncTableDef tableDef,
java.util.HashMap valMap)
Inserts a record into the destination database
|
void |
doUpdate()
Updates the destination database based on the action
|
protected void |
doUpdate(ExtDBSyncTableDef tableDef,
java.util.HashMap valMap)
Updates a record in the destination database
|
java.lang.String |
getAction()
the action to be performed
|
Executor |
getExecutor()
The st executor (connection)
|
java.lang.String |
getSrcKeyValue()
the value of the src key
|
ExtDBSyncTableDef |
getTableDef()
the definition of the table
|
java.lang.String |
getTransId()
the transaction id that the update was triggered from
|
java.util.HashMap |
getValMap()
the table of values
|
protected void |
processDelete(ExtDBSyncTableDef tableDef,
java.util.HashMap valMap)
Deletes a record from the destination database
|
protected void |
processUpdate(ExtDBSyncTableDef tableDef,
java.util.HashMap valMap)
Performs an insert or updated based on whether the data already exists in the destination database or not;
|
void |
setData(java.lang.String transId,
java.lang.String action,
java.util.HashMap valMap)
Sets the data to be used by updates
|
void |
setExecutor(Executor executor)
Set the st executor (connection)
|
public ExtDBSyncUpdate(ExtDBSyncTableDef tableDef)
tableDef
- - Table and field definitionspublic void setData(java.lang.String transId, java.lang.String action, java.util.HashMap valMap)
transId
- - Id of transactionaction
- - Action to be performed i.e D for deletevalMap
- - Field/value mappingpublic java.lang.String getAction()
public ExtDBSyncTableDef getTableDef()
public java.lang.String getTransId()
public java.lang.String getSrcKeyValue()
public java.util.HashMap getValMap()
public void doUpdate() throws java.lang.Exception
java.lang.Exception
- A serious errorprotected void processUpdate(ExtDBSyncTableDef tableDef, java.util.HashMap valMap) throws java.lang.Exception
tableDef
- - Table and field definitionsvalMap
- - Field/value mappingjava.lang.Exception
- A serious errorprotected void processDelete(ExtDBSyncTableDef tableDef, java.util.HashMap valMap) throws java.lang.Exception
tableDef
- - Table and field definitionsvalMap
- - Field/value mappingjava.lang.Exception
- A serious errorprotected void doInsert(ExtDBSyncTableDef tableDef, java.util.HashMap valMap) throws java.lang.Exception
tableDef
- - Table and field definitionsvalMap
- - Field/value mappingjava.lang.Exception
- A serious errorprotected void doUpdate(ExtDBSyncTableDef tableDef, java.util.HashMap valMap) throws java.lang.Exception
tableDef
- - Table and field definitionsvalMap
- - Field/value mappingjava.lang.Exception
- A serious errorpublic boolean checkDestExists(ExtDBSyncTableDef tableDef, java.util.HashMap valMap) throws java.lang.Exception
tableDef
- - database to be updatedvalMap
- - name of destination table to be updatedjava.lang.Exception
- A serious errorpublic Executor getExecutor()
public void setExecutor(Executor executor)
executor
- - a connectionstSoftware Copyright © 2001-2014 stSoftware All Rights Reserved.