Tuscany DAS for Relational Databases

org.apache.tuscany.das.rdb
Interface ApplyChangesCommand

All Known Implementing Classes:
ApplyChangesCommandImpl

public interface ApplyChangesCommand

An ApplyChangesCommand is used to flush the changes associated with a modified graph of DataObjects to a database.


Method Summary
 void addCreateCommand(commonj.sdo.Type type, Command cmd)
          Adds a user-provided create command.
 void addDeleteCommand(commonj.sdo.Type type, Command cmd)
          Adds a user-provided delete command.
 void addUpdateCommand(commonj.sdo.Type type, Command cmd)
          Adds a user-provided update command.
 void execute(commonj.sdo.DataObject root)
          The change history is scanned and modifications to the graph of data objects are flushed to the database.
 void setConnection(java.sql.Connection connection)
          Provides the java.sql.Connection to be used for this executing this command.
 void setConnection(java.sql.Connection connection, boolean manageTransactions)
          Provides the java.sql.Connection to be used for this executing this command.
 

Method Detail

addUpdateCommand

void addUpdateCommand(commonj.sdo.Type type,
                      Command cmd)
Adds a user-provided update command. In the absence of a user-provided command, the DAS will generate one. However this alternative may make sense if the user requires a SQL statement different from what the DAS generates.

Parameters:
type - The DataObject type this command applys to
cmd - The Command used to UPDATE data objects of the specified type

addCreateCommand

void addCreateCommand(commonj.sdo.Type type,
                      Command cmd)
Adds a user-provided create command. In the absence of a user-provided command, the DAS will generate one. However this alternative may make sense if the user requires a SQL statement different from what the DAS generates.

Parameters:
type - The DataObject type this command applys to
cmd - The Command used to INSERT data objects of the specified type

addDeleteCommand

void addDeleteCommand(commonj.sdo.Type type,
                      Command cmd)
Adds a user-provided delete command. In the absence of a user-provided command, the DAS will generate one. However this alternative may make sense if the user requires a SQL statement different from what the DAS generates.

Parameters:
type - The DataObject type this command applys to
cmd - The Command used to DELETE data objects of the specified type

execute

void execute(commonj.sdo.DataObject root)
The change history is scanned and modifications to the graph of data objects are flushed to the database.

Parameters:
root - the topmost containing data object

setConnection

void setConnection(java.sql.Connection connection)
Provides the java.sql.Connection to be used for this executing this command.

Parameters:
connection - the java.sql.Connection

setConnection

void setConnection(java.sql.Connection connection,
                   boolean manageTransactions)
Provides the java.sql.Connection to be used for this executing this command.

Parameters:
connection - the java.sql.Connection
manageTransactions - true if the DAS should perform tx commit/rollback

Tuscany DAS for Relational Databases

-