Package | Description |
---|---|
org.sormula.active |
An implementation of the
active record pattern built on top of sormula.
|
org.sormula.active.operation |
Thread-safe and transaction-compliant database operations used by
ActiveTable . |
Modifier and Type | Class and Description |
---|---|
class |
NoDefaultActiveDatabaseException
Indicates there is no active database defined but default was expected with
ActiveDatabase.getDefault() . |
Modifier and Type | Method and Description |
---|---|
void |
ActiveTransaction.begin()
Starts the transaction.
|
void |
ActiveRecord.checkLazySelects(java.lang.String fieldName)
Selects record(s) from database for field based upon definitions in select annotations of field
where
SelectCascade.lazy() is true. |
protected void |
ActiveTransaction.close()
Cleans up resources that are used by this transaction.
|
void |
ActiveTransaction.commit()
Completes the transaction.
|
protected ActiveTable<R> |
ActiveRecord.createTable()
Creates an
ActiveTable for record class returned by ActiveRecord.getRecordClass() . |
int |
ActiveRecord.delete()
Deletes record from database.
|
int |
ActiveTable.delete(R record)
Deletes by primary key.
|
int |
ActiveTable.deleteAll()
Deletes all records in table.
|
int |
ActiveTable.deleteAll(java.util.Collection<R> records)
Deletes many records by primary key.
|
int |
ActiveTable.deleteAllBatch(java.util.Collection<R> records)
Deletes many records by primary key in batch mode.
|
int |
ActiveRecord.deleteBatch()
Deletes record from database in batch mode.
|
int |
ActiveTable.deleteBatch(R record)
Deletes by primary key in batch mode.
|
void |
ActiveTable.flush()
Writes uncommitted table cache records to database and removes them from the cache.
|
Cache<R> |
ActiveTable.getCache()
Gets this table's cache.
|
int |
ActiveRecord.insert()
Inserts record into database.
|
int |
ActiveTable.insert(R record)
Inserts one record into table.
|
int |
ActiveTable.insertAll(java.util.Collection<R> records)
Inserts collection of records.
|
int |
ActiveTable.insertAllBatch(java.util.Collection<R> records)
Inserts collection of records in batch mode.
|
int |
ActiveRecord.insertBatch()
Inserts record into database in batch mode.
|
int |
ActiveTable.insertBatch(R record)
Inserts an a record in batch mode.
|
boolean |
ActiveTable.isCached()
Tests if this table is cached.
|
R |
ActiveTable.newActiveRecord()
Creates a new active record of type R using zero-arg constructor.
|
void |
ActiveTransaction.rollback()
Rolls back the transaction.
|
int |
ActiveRecord.save()
Saves record into database.
|
int |
ActiveTable.save(R record)
Updates an existing record or insert record if it is not already in database.
|
int |
ActiveTable.saveAll(java.util.Collection<R> records)
Updates an existing records or insert records if they are not already in database.
|
int |
ActiveTable.saveAllBatch(java.util.Collection<R> records)
Updates an existing records or insert records if they are not already in database in batch mode.
|
int |
ActiveRecord.saveBatch()
Saves record into database in batch mode.
|
int |
ActiveTable.saveBatch(R record)
Updates an existing record or insert record if it is not already in database in batch mode.
|
R |
ActiveTable.select(java.lang.Object... primaryKeys)
Selects one record in table using primary key.
|
java.util.List<R> |
ActiveTable.selectAll()
Selects all records in table.
|
java.util.List<R> |
ActiveTable.selectAllCustom(java.lang.String customSql,
java.lang.Object... parameters)
Select list of records using custom sql.
|
java.util.List<R> |
ActiveTable.selectAllWhere(java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects list of records for where condition and parameters.
|
java.util.List<R> |
ActiveTable.selectAllWhereOrdered(java.lang.String whereConditionName,
java.lang.String orderByName,
java.lang.Object... parameters)
Selects list of records for where condition and parameters.
|
<T> T |
ActiveTable.selectAvg(java.lang.String expression)
Selects average value.
|
<T> T |
ActiveTable.selectAvg(java.lang.String expression,
java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects average value.
|
<T> T |
ActiveTable.selectCount()
Selects count of records using "select count(*) from ...".
|
<T> T |
ActiveTable.selectCount(java.lang.String expression)
Selects count of records.
|
<T> T |
ActiveTable.selectCount(java.lang.String expression,
java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects count of records.
|
R |
ActiveTable.selectCustom(java.lang.String customSql,
java.lang.Object... parameters)
Select list of records using custom sql.
|
<T> T |
ActiveTable.selectMax(java.lang.String expression)
Selects maximum value.
|
<T> T |
ActiveTable.selectMax(java.lang.String expression,
java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects maximum value.
|
<T> T |
ActiveTable.selectMin(java.lang.String expression)
Selects minimum value.
|
<T> T |
ActiveTable.selectMin(java.lang.String expression,
java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects minimum value.
|
<T> T |
ActiveTable.selectSum(java.lang.String expression)
Selects sum.
|
R |
ActiveTable.selectWhere(java.lang.String whereConditionName,
java.lang.Object... parameters)
Selects one record for where condition and parameters.
|
void |
ActiveDatabase.setActiveTransaction(ActiveTransaction activeTransaction)
Sets the transaction in use.
|
static <R extends ActiveRecord<? super R>> |
ActiveRecord.table(java.lang.Class<R> recordClass)
Creates a table that can be used to for records of type recordClass for the default
active database.
|
int |
ActiveRecord.update()
Updates record in database.
|
int |
ActiveTable.update(R record)
Updates one record in table by primary key.
|
int |
ActiveTable.updateAll(java.util.Collection<R> records)
Updates collection of records using primary key.
|
int |
ActiveTable.updateAllBatch(java.util.Collection<R> records)
Updates collection of records using primary key in batch mode.
|
int |
ActiveRecord.updateBatch()
Updates record in database in batch mode.
|
int |
ActiveTable.updateBatch(R record)
Updates one record in table by primary key in batch mode.
|
Constructor and Description |
---|
ActiveDatabase(java.lang.String dataSourceName)
Constructs for a data source name and empty schema.
|
ActiveDatabase(java.lang.String dataSourceName,
java.lang.String schema)
Constructs for a data source name and schema.
|
ActiveTable(ActiveDatabase activeDatabase,
java.lang.Class<R> recordClass)
Constructs for a database and record type.
|
ActiveTable(java.lang.Class<R> recordClass)
Constructs for default active database and a record type.
|
ActiveTransaction()
Constructs for the default active database.
|
ActiveTransaction(ActiveDatabase activeDatabase)
Constructs an
ActiveDatabase . |
Modifier and Type | Method and Description |
---|---|
protected void |
ActiveOperation.close()
Cleans up any used resources.
|
T |
ActiveOperation.execute()
Executes
ActiveOperation.operate() within a try/catch and transaction. |