org.osesb.connectors.jdbc.test
Class UpdateCustomerTestTableSetAdapter

java.lang.Object
  extended by org.osesb.connectors.jdbc.TableSetAdapter
      extended by org.osesb.connectors.jdbc.test.UpdateCustomerTestTableSetAdapter

public class UpdateCustomerTestTableSetAdapter
extends TableSetAdapter

UpdateCustomerTestTableSetAdapter is a custom TableSetAdapter. Corresponds to org/osesb/connectors/jdbc/test/testdata/updatecustomer-tableset-test-config.xml.

processTableSet() expects a valid customer ID in a ProcessingContext variable named "customerID".


Field Summary
 
Fields inherited from class org.osesb.connectors.jdbc.TableSetAdapter
log, parentTableSet, tableSetAdapterConfiguration, thisClassName
 
Constructor Summary
UpdateCustomerTestTableSetAdapter(TableSet parentTableSet, TableSetAdapterConfiguration tableSetAdapterConfiguration)
          Creates a new instance of UpdateCustomerTableSetAdapter.
 
Method Summary
 java.lang.Object[] doCustomProcessing(java.lang.Object[] parameters)
          Custom processing method.
static void main(java.lang.String[] args)
          main() For testing and sandboxing.
 java.lang.Object[] processStatement(java.lang.String statementName)
          Process the named SQLStatement configured by the TableSetConfiguration.
 java.lang.Object[] processTableSet()
          processTableSet retrieves a customer by ID and sets shipping address columns to the values in the billing address columns.
 
Methods inherited from class org.osesb.connectors.jdbc.TableSetAdapter
getParentTableSet, logMessage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UpdateCustomerTestTableSetAdapter

public UpdateCustomerTestTableSetAdapter(TableSet parentTableSet,
                                         TableSetAdapterConfiguration tableSetAdapterConfiguration)
                                  throws java.lang.Exception
Creates a new instance of UpdateCustomerTableSetAdapter.

Parameters:
parentTableSet - The TableSet that constructed this TableSetAdapter.
Throws:
java.lang.Exception - if constructed with a null TableSet.
Method Detail

processTableSet

public java.lang.Object[] processTableSet()
                                   throws java.lang.Exception
processTableSet retrieves a customer by ID and sets shipping address columns to the values in the billing address columns.

Specified by:
processTableSet in class TableSetAdapter
Returns:
The updateCount as an Integer.
Throws:
java.lang.Exception - if there is a problem with processing the TableSet SQL.

processStatement

public java.lang.Object[] processStatement(java.lang.String statementName)
                                    throws java.lang.Exception
Process the named SQLStatement configured by the TableSetConfiguration. Returns the result of SQL processing of as an Object[].

TableSetAdapters are pluggable components that are application-specific, so the content of the Object[] is interpreted by the caller.

Concrete implementations override this method to do real work.

Specified by:
processStatement in class TableSetAdapter
Parameters:
statementName - The name of the SQLStatement to process.
Returns:
the result of processing TableSet SQL as an Object[].
Throws:
java.lang.Exception - if there is a problem with processing the TableSet SQL.

doCustomProcessing

public java.lang.Object[] doCustomProcessing(java.lang.Object[] parameters)
                                      throws java.lang.Exception
Custom processing method.

Specified by:
doCustomProcessing in class TableSetAdapter
Parameters:
parameters - Custom processing parameters.
Returns:
the result of custom processing as an Object[].
Throws:
java.lang.Exception - if an error is encountered during custom processing.

main

public static void main(java.lang.String[] args)
main() For testing and sandboxing.

Parameters:
args - commandline arguments