public class TableDataObject
extends java.lang.Object
This class represents a row in a physical table.
Each business object mediator must generate a list of TableDataObject
to be persisted by a DataWriter
.
Constructor and Description |
---|
TableDataObject(java.lang.String aTableName)
Constructor for creating a table data object, representing a table.
|
Modifier and Type | Method and Description |
---|---|
void |
addColumnData(java.lang.String aColumnName,
java.lang.Object aColumnValue)
Add the column name and value to the column data map.
|
void |
addMultipleColumnData(java.util.Map columnData)
Add multiple column data to column data map.
|
static TableDataObject |
findByPrimaryKey(java.lang.String tableName,
java.util.Map primaryKeyData)
Find a row from the table by primary key and return the populated TableDataObject.
|
java.util.Map |
getColumnDataMap()
This method returns the column data map.
|
java.lang.String |
getColumnValue(java.lang.String aColumnName)
Get the column value for a given column name.
|
char |
getOpMode()
Get the operation mode.
|
java.lang.String |
getTableName()
This method returns the table name.
|
boolean |
isInsertForced()
Checks if the flag is set.
|
void |
setColumnDataMap(java.util.Map aColumnDataMap)
This method sets the column data map.
|
void |
setInsertForced(boolean insertForced)
Sets the flag true or false
|
void |
setOpMode(char anOpMode)
Set the operation mode.
|
void |
setTableName(java.lang.String aTableName)
This method sets the table name.
|
java.lang.String |
toString()
Format the object to have a better display.
|
public TableDataObject(java.lang.String aTableName)
Constructor for creating a table data object, representing a table. Table name should be in upper case.
aTableName
- The table name of the table to be persisted to.public static TableDataObject findByPrimaryKey(java.lang.String tableName, java.util.Map primaryKeyData) throws DataLoadException
tableName
- the table nameprimaryKeyData
- a map containing the primary key name to the value mapDataLoadException
- this error is thrown if the database throws the sql exceptionpublic java.util.Map getColumnDataMap()
This method returns the column data map. The key is the column name and value is the column value. All column names are in upper case.
public void setColumnDataMap(java.util.Map aColumnDataMap)
This method sets the column data map. The key is the column name and value is the column value. All column names are in upper case.
aColumnDataMap
- The column data map used to store column data for a table.public java.lang.String getTableName()
This method returns the table name.
public void setTableName(java.lang.String aTableName)
This method sets the table name.
aTableName
- The table name for the table.public char getOpMode()
Get the operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.
public void setOpMode(char anOpMode)
Set the operation mode. The operation mode can be 'I', 'U', 'D' for insert, update and delete.
anOpMode
- The operation mode. The operation mode can be 'I', 'U', 'D'
for insert, update and delete.public java.lang.String getColumnValue(java.lang.String aColumnName)
Get the column value for a given column name. aColumnName is in upper case.
aColumnName
- A column name to retrieve a value for.public void addColumnData(java.lang.String aColumnName, java.lang.Object aColumnValue)
Add the column name and value to the column data map. aColumnName is in upper case.
aColumnName
- A column name.aColumnValue
- A column value.public void addMultipleColumnData(java.util.Map columnData)
Add multiple column data to column data map. The key in the columnData is the column name and the value is the column value. All column name are in upper cases.
columnData
- public boolean isInsertForced()
public void setInsertForced(boolean insertForced)
insertForced
- the flag.public java.lang.String toString()
Format the object to have a better display.
toString
in class java.lang.Object