public class OperationDatabase extends Database
Database
for one transaction within an ActiveOperation
. Creates OperationTable
for Database.getTable(Class)
for all tables in operation.
Intended for use by ActiveOperation
only.
Constructor and Description |
---|
OperationDatabase(ActiveDatabase activeDatabase)
Constructs for an active database.
|
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes connection and then invokes
Database.close() . |
ActiveDatabase |
getActiveDatabase()
Gets the active database supplied in the constructor.
|
<R> Table<R> |
getTable(java.lang.Class<R> rowClass)
Gets table object for reading/writing row objects of type R from/to
table.
|
addNameTranslatorClass, addTable, createOperationTime, flush, getConnection, getDataSource, getDataSourceName, getNameTranslatorClasses, getOperationTime, getOperationTimeMap, getSchema, getTable, getTotalOperationTime, getTransaction, getTypeTranslator, getTypeTranslator, init, initTransaction, initTypeTranslatorMap, isAutoGeneratedKeys, isReadOnly, isTimings, logTimings, putTypeTranslator, putTypeTranslator, removeNameTranslatorClass, setAutoGeneratedKeys, setConnection, setReadOnly, setTimings, setTransaction
public OperationDatabase(ActiveDatabase activeDatabase) throws java.lang.Exception
Database.setAutoGeneratedKeys(boolean)
defaults to Database.isAutoGeneratedKeys()
.activeDatabase
- active database determines data sourcejava.sql.SQLException
- if errorjava.lang.Exception
public ActiveDatabase getActiveDatabase()
public <R> Table<R> getTable(java.lang.Class<R> rowClass) throws SormulaException
This method is optional. A table object may also be created with Table
constructor.
Cascade operations for Table$lt;R> may invoke getTable for some cascaded Table<T> where T is different from R.
getTable
in class Database
R
- row class typerowClass
- annotations on this class determine mapping from row objects to/from databaseSormulaException
- if errorpublic void close()
Database.close()
.