public class TableObjectMediator extends AbstractBusinessObjectMediator
This table object mediator is an extension to the concept of a business object mediator for data load. The table object mediator is responsible for accepting pre-populated value objects representing physical tables (table data objects) in the data base. The partially populated table data objects will be additionally populated by this mediator with values that need to be resolved through the business context service or an ID resolution.
The TableObjectMediator extends the AbstractBusinessObjectMediator. The data object passed to the transform() method is an instance of List and each element in the list is an instance of ExtendedTableDataObject.
The table object builder will populate the table data object using all column values which are from the input data and fixed value. The values which are from business context and need to be resolved by ID resolution are populated by this TableObjectMediator.
Constructor and Description |
---|
TableObjectMediator() |
Modifier and Type | Method and Description |
---|---|
void | close()
This method will perform de-initialization required for the table object mediator and call the super class close() method.
|
void | init()
This method will perform initialization required for the table object mediator and call the super class init() method.
|
protected boolean | isPhysicalObjectSortRequired()
Check if the list of physical objects need to be sorted before passed to the data writer.
|
protected TableDataObject | populateTableDataObject(ExtendedTableDataObject extendedTableDataObject)
This method will populate the table data object using the configured column and data mapping information.
|
protected java.lang.String | resolveValueFromBusinessContext(java.lang.String businessContextKey)
This method will determine a value for a business context property by requesting it from the business context service.
|
protected java.util.List | sortPhysicalObjects(java.util.List aListOfPhysicalObjects)
Sort the list of physical objects.
|
protected void | transform(java.lang.Object listOfDataObjects, boolean deleteFlag)
This method will transform the data object passed in into a set of physical objects which represent table rows in the data base.
|
public void init() throws DataLoadException
This method will perform initialization required for the table object mediator and call the super class init() method.
public void close() throws DataLoadException
This method will perform de-initialization required for the table object mediator and call the super class close() method.
protected void transform(java.lang.Object listOfDataObjects, boolean deleteFlag) throws DataLoadException
This method will transform the data object passed in into a set of physical objects which represent table rows in the data base.
protected TableDataObject populateTableDataObject(ExtendedTableDataObject extendedTableDataObject) throws DataLoadException
This method will populate the table data object using the configured column and data mapping information. This method is passed the pre-populated table data object that was processed by the table object builder as well as the configured table information.
This method will also cache previously ID resolved keys and values so that they do not have to be looked up again. This will ease the amount of configuration needed in the business object configuration file.
This method should be overridden by a subclass if the behavior of the options below is not sufficient to determine the data needed to be set for a column in a table.
For example, if it is desired to add additional 'valueFrom' support, or override the behavior of the 'valueFrom' options below.
Current support for the column data mapping (valueFrom attribute):
For the 'valueFrom' support for InputData and Fixed, the values are assumed to be determined already for the table data object. This method will only resolve the values who's 'valueFrom' attribute is BusinessContext and IDResolve.
protected java.lang.String resolveValueFromBusinessContext(java.lang.String businessContextKey) throws DataLoadException
This method will determine a value for a business context property by requesting it from the business context service. If the value cannot be resolved a null value will be returned.
protected boolean isPhysicalObjectSortRequired()
protected java.util.List sortPhysicalObjects(java.util.List aListOfPhysicalObjects) throws DataLoadException