org.sormula.active.operation
Class OperationTable<R extends ActiveRecord>

java.lang.Object
  extended by org.sormula.Table<R>
      extended by org.sormula.active.operation.OperationTable<R>
Type Parameters:
R - record type of table
All Implemented Interfaces:
TypeTranslatorMap

public class OperationTable<R extends ActiveRecord>
extends Table<R>

A Table for use by one transaction within an ActiveOperation. Uses a custom RowTranslator that ensures all records are attached to the active database for this table.

Intended for use by ActiveOperation only.

Since:
1.7 and 2.1
Author:
Jeff Miller

Constructor Summary
OperationTable(OperationDatabase operationDatabase, java.lang.Class<R> rowClass)
          Constructs for an operation database and class or record.
 
Method Summary
protected  RowTranslator<R> initRowTranslator()
          Creates a RowTranslator for use by this table. Creates a RowTranslator where ColumnsTranslator.read(ResultSet, int, Object) and ColumnsTranslator.write(PreparedStatement, int, Object) attach the active database to the row using ActiveRecord.attach(ActiveDatabase).
 
Methods inherited from class org.sormula.Table
delete, delete, deleteAll, deleteAll, deleteAllBatch, getDatabase, getLazySelectCascadeFields, getNameTranslator, getNameTranslators, getQualifiedTableName, getRowClass, getRowTranslator, getTableName, getTypeTranslator, initNameTranslators, initTableName, initTypeTranslatorMap, insert, insertAll, insertAllBatch, newRow, putTypeTranslator, putTypeTranslator, save, saveAll, select, selectAll, selectAllCustom, selectAllWhere, selectAllWhereOrdered, selectAvg, selectAvg, selectCount, selectCount, selectCount, selectCount, selectCustom, selectMax, selectMax, selectMin, selectMin, selectSum, selectSum, selectWhere, setTableName, translateName, update, updateAll, updateAllBatch
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OperationTable

public OperationTable(OperationDatabase operationDatabase,
                      java.lang.Class<R> rowClass)
               throws SormulaException
Constructs for an operation database and class or record.

Parameters:
operationDatabase - source of tables to use in active record operation
rowClass - type of record
Throws:
SormulaException - if error
Method Detail

initRowTranslator

protected RowTranslator<R> initRowTranslator()
                                                           throws TranslatorException
Creates a RowTranslator for use by this table. Invoked by constructor. Creates a RowTranslator where ColumnsTranslator.read(ResultSet, int, Object) and ColumnsTranslator.write(PreparedStatement, int, Object) attach the active database to the row using ActiveRecord.attach(ActiveDatabase).

Overrides:
initRowTranslator in class Table<R extends ActiveRecord>
Returns:
row translator
Throws:
TranslatorException - if error