Executes a number of SQL statements, in the same order as passed to the constructor. Each SQL statement is executed once and only once, without any iteration. Each SQL statement must perform an INSERT, DELETE, or UPDATE operation. No SELECTs are allowed.
It is likely that a significant fraction (perhaps as high as 50%) of all transactions can be implemented with this class.
Example use case:
Object[] sqlIds = {ADD_THIS, DELETE_THAT}; Object[] params = {blah.getX(), blah.getY(), blah.getZ(), blah.getQ()}; Tx doStuff = new TxSimple(sqlIds, params); int numRecordsAffected = doStuff.executeTx();
In this example, blah will usually represent a Model Object. The data in params is divided up among the various sqlIds. (This division is performed internally by this class.)
This class uses strong ordering conventions. The order of items in each array passed to the constructor is very important (see {@link #TxSimple(SqlId[],Object[])}).
|
|
|
|
|
|