Package | Description |
---|---|
org.sormula.operation |
Classes that perform SQL operations such as select, update, insert, save, and delete.
|
org.sormula.operation.aggregate |
Classes that perform SQL aggregate operations such as MIN, MAX, AVG, COUNT.
|
org.sormula.operation.cascade |
Classes that perform cascade (one-to-many and one-to-one) operations that are defined
by cascade annotations.
|
Modifier and Type | Class and Description |
---|---|
class |
BatchException
Used for one of several error conditions that can occur when
ModifyOperation.setBatch(boolean) is set to true. |
class |
MissingFieldException
Indicates a field name was not found in a class.
|
class |
ReadOnlyException
Indicates an insert, update, or delete was attempted for a table that is
read only.
|
Modifier and Type | Method and Description |
---|---|
protected abstract boolean |
SelectOperation.add(R row)
Implement to add row to collection created
SelectOperation.createReadAllCollection() . |
protected boolean |
MapSelectOperation.add(R row)
Implement to add row to collection created
SelectOperation.createReadAllCollection() . |
void |
SqlOperation.cancel()
Requests cancel for currently executing statement.
|
protected void |
SqlOperation.cascade(R row,
boolean post)
Executes all cascade operations that were created by
SqlOperation.prepareCascades() . |
void |
SqlOperation.close()
Cleans up after operation is no longer needed.
|
void |
ScalarSelectOperation.close()
Cleans up after operation is no longer needed.
|
void |
SaveOperation.close() |
void |
ModifyOperation.close()
Cleans up after operation is no longer needed.
|
protected void |
SqlOperation.closeCascades()
Closes the
CascadeOperation objects for this operation. |
protected void |
SqlOperation.closeStatement()
Closes the prepared statement for this operation.
|
protected RowField<R,?> |
SqlOperation.createRowField(Table<R> targetTable,
java.lang.reflect.Field field)
|
int |
DeleteOperation.delete(java.lang.Object... parameters)
Deletes rows based upon parameters.
|
int |
DeleteOperation.delete(R row)
Deletes a row.
|
int |
DeleteOperation.deleteAll(java.util.Collection<R> rows)
Deletes all rows in collection.
|
abstract void |
SqlOperation.execute()
Invokes an execute method on a prepared statement.
|
void |
ScalarSelectOperation.execute()
Performs query.
|
void |
SaveOperation.execute()
Executes by updating all row(s) using
UpdateOperation . |
void |
ModifyOperation.execute()
Executes operation for all row parameters using current prepared statement.
|
protected K |
MapSelectOperation.getKey(R row)
Gets key for row.
|
protected Table<?> |
SqlOperation.getTargetTable(java.lang.Class<?> targetClass)
Gets a table object from database associated with this operation.
|
int |
InsertOperation.insert(java.lang.Object... parameters)
Inserts rows based upon parameters.
|
int |
InsertOperation.insert(R row)
Inserts a row.
|
int |
InsertOperation.insertAll(java.util.Collection<R> rows)
Inserts all rows in collection.
|
int |
ModifyOperation.modify(java.lang.Object... parameters)
Modifies row(s) with sql parameters as Objects.
|
int |
ModifyOperation.modify(R row)
Modifies one row.
|
int |
ModifyOperation.modifyAll(java.util.Collection<R> rows)
Modifies a collection of rows.
|
void |
UpdateOperation.notifyCacheModified(R row)
Notifies cache that row has been updated into database.
|
void |
SaveOperation.notifyCacheModified(R row)
Delegates to
Cache.inserted(Object) , Cache.updated(Object) ,
Cache.deleted(Object) based upon the subclass operation. |
protected abstract void |
ModifyOperation.notifyCacheModified(R row)
Delegates to
Cache.inserted(Object) , Cache.updated(Object) ,
Cache.deleted(Object) based upon the subclass operation. |
void |
InsertOperation.notifyCacheModified(R row)
Notifies cache that row has been inserted into database.
|
void |
DeleteOperation.notifyCacheModified(R row)
Notifies cache that row has been deleted from database.
|
protected boolean |
UpdateOperation.notifyCacheModify(R row)
Tests if row is managed by cache.
|
protected boolean |
SaveOperation.notifyCacheModify(R row)
Delegates to
Cache.insert(Object) , Cache.update(Object) ,
Cache.delete(Object) based upon the subclass operation. |
protected abstract boolean |
ModifyOperation.notifyCacheModify(R row)
Delegates to
Cache.insert(Object) , Cache.update(Object) ,
Cache.delete(Object) based upon the subclass operation. |
protected boolean |
InsertOperation.notifyCacheModify(R row)
Tests if row is managed by cache.
|
protected boolean |
DeleteOperation.notifyCacheModify(R row)
Tests if row is managed by cache.
|
void |
ScalarSelectOperation.positionAbsolute(int rowNumber)
Positions the result set cursor to a specific row.
|
void |
ScalarSelectOperation.positionRelative(int rowOffset)
Positions the result set cursor to a row relative to the current row.
|
protected void |
SaveOperation.postExecute(R row)
Invoked after JDBC execute.
|
protected void |
ModifyOperation.postExecute(R row)
Invoked after JDBC execute.
|
protected void |
InsertOperation.postExecute(R row)
Updates identity column with generated key if
InsertOperation.isAutoGeneratedKeys() is true. |
protected void |
SaveOperation.postExecuteCascade(R row)
Invoked after JDBC execute.
|
protected void |
ModifyOperation.postExecuteCascade(R row)
Invoked after JDBC execute.
|
protected void |
ScalarSelectOperation.postReadCascade(R row)
Invoked after reading row.
|
protected void |
SaveOperation.preExecute(R row)
Invoked prior to JDBC execute.
|
protected void |
ModifyOperation.preExecute(R row)
Invoked prior to JDBC execute.
|
protected void |
SaveOperation.preExecuteCascade(R row)
Invoked prior to JDBC execute.
|
protected void |
ModifyOperation.preExecuteCascade(R row)
Invoked prior to JDBC execute.
|
protected void |
SqlOperation.prepare()
Creates prepared statement for this operation and invokes
SqlOperation.prepareCascades()
to prepare statements for any cascade operations. |
protected void |
MapSelectOperation.prepare()
Creates prepared statement for this operation and invokes
SqlOperation.prepareCascades()
to prepare statements for any cascade operations. |
protected void |
SqlOperation.prepareCascades()
Prepares cascades for all cascade annotations on row class.
|
protected java.util.List<CascadeOperation<R,?>> |
UpdateOperation.prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected abstract java.util.List<CascadeOperation<R,?>> |
SqlOperation.prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected java.util.List<CascadeOperation<R,?>> |
ScalarSelectOperation.prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected java.util.List<CascadeOperation<R,?>> |
SaveOperation.prepareCascades(java.lang.reflect.Field field)
Creates save cascade operations based upon the save annotations for field.
|
protected java.util.List<CascadeOperation<R,?>> |
InsertOperation.prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected java.util.List<CascadeOperation<R,?>> |
DeleteOperation.prepareCascades(java.lang.reflect.Field field)
Creates and prepares cascade operations based upon cascade annotations for a field.
|
protected void |
SqlOperation.prepareCheck()
Prepares statement with
SqlOperation.prepare() if it is null. |
protected void |
ScalarSelectOperation.preReadCascade(R row)
Invoked prior to reading row.
|
protected void |
InsertOperation.processIdentityColumn(R row)
Reads the generated key using
Statement.getGeneratedKeys() . |
C |
SelectOperation.readAll()
Reads all rows from current result set.
|
R |
ScalarSelectOperation.readNext()
Reads next row from current result set.
|
int |
SaveOperation.save(java.lang.Object... parameters)
Saves rows based upon parameters.
|
int |
SaveOperation.save(R row)
Saves a row.
|
int |
SaveOperation.saveAll(java.util.Collection<R> rows)
Saves all rows in collection.
|
R |
ScalarSelectOperation.select(java.lang.Object... parameters)
Set parameters, executes, reads one row, closes.
|
R |
ScalarSelectOperation.select(R whereParameters)
Set parameters, executes, reads one row, closes.
|
C |
SelectOperation.selectAll(java.lang.Object... parameters)
Set parameters, executes, reads all rows in result set, closes.
|
C |
SelectOperation.selectAll(R whereParameters)
Set parameters, executes, reads all rows in result set, closes.
|
void |
MapSelectOperation.setGetKeyMethodName(java.lang.String getKeyMethodName)
Sets the method name of row class R that gets key of type K to use in Map.
|
void |
ScalarSelectOperation.setOrderBy(java.lang.String orderByName)
Sets order of results in list.
|
void |
SqlOperation.setWhere(java.lang.String whereConditionName)
Sets where condition from annotation name as defined in
Where.name() for row. |
void |
SelectOperation.setWhere(java.lang.String whereConditionName)
Sets where condition from annotation name as defined in
Where.name() for row. |
int |
UpdateOperation.update(java.lang.Object... parameters)
Updates rows based upon parameters.
|
int |
UpdateOperation.update(R row)
Updates a row.
|
int |
UpdateOperation.updateAll(java.util.Collection<R> rows)
Updates all rows in collection.
|
protected void |
SqlOperation.writeColumns(R row)
Sets all column parameters from a row using the table's
RowTranslator . |
protected void |
DeleteOperation.writeColumns(R row)
Does nothing since delete statements have no columns.
|
protected void |
SqlOperation.writeParameters()
Prepares statement and then sets all parameters with
SqlOperation.writeParameter(int, Object) . |
protected void |
SqlOperation.writeWhere(R row)
Sets all where parameters from a row using the table's
WhereTranslator . |
Constructor and Description |
---|
ArrayListSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
ArrayListSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
DeleteOperation(Table<R> table)
Constructs standard sql delete for primary key as:
DELETE FROM table WHERE primary key clause |
DeleteOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for standard sql delete statement as:
DELETE FROM table WHERE ... |
HashMapSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
HashMapSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
InsertOperation(Table<R> table)
Constructs for standard sql insert statement as:
INSERT INTO table (c1, c2, c3, ...) VALUES (?, ?, ?, ...) |
InsertOperation(Table<R> table,
boolean identity)
Constructs for optional identity column.
|
LinkedHashMapSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
LinkedHashMapSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
ListSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
ListSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
MapSelectOperation(Table<R> table)
Constructs for a table to use primary key where condition.
|
MapSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for a table and where condition.
|
ModifyOperation(Table<R> table)
Constructs for a table.
|
SaveOperation(Table<R> table)
Constructs to update by primary key or insert if update fails.
|
SaveOperation(Table<R> table,
boolean identity)
Constructs to update by primary key or insert if update fails.
|
SaveOperation(Table<R> table,
boolean identity,
java.lang.String whereConditionName)
Constructs to update by where condition or insert if update fails.
|
SaveOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs to update by where condition or insert if update fails.
|
ScalarSelectOperation(Table<R> table)
Constructs standard sql select by primary key as:
SELECT c1, c2, c3, ... |
ScalarSelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs standard sql select by primary key as:
SELECT c1, c2, c3, ... |
SelectOperation(Table<R> table)
Constructs standard sql to select by primary key as:
SELECT c1, c2, c3, ...
|
SelectOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs standard sql to by a where condition:
SELECT c1, c2, c3, ...
|
SqlOperation(Table<R> table)
Constructs for a table.
|
UpdateOperation(Table<R> table)
Constructs standard sql update for primary key as:
UPDATE table SET c1=?, c2=?, c3... |
UpdateOperation(Table<R> table,
java.lang.String whereConditionName)
Constructs for standard sql update statement as:
UPDATE table SET c1=?, c2=?, c3... |
Modifier and Type | Method and Description |
---|---|
T |
SelectAggregateOperation.readAggregate()
Reads the aggregate value from the current result set.
|
Constructor and Description |
---|
SelectAggregateOperation(Table<R> table,
java.lang.String function,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT f(e), ... |
SelectAvgOperation(Table<R> table,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT AVG(e), ... |
SelectCountOperation(Table<R> table,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT COUNT(e), ... |
SelectMaxOperation(Table<R> table,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT MAX(e), ... |
SelectMinOperation(Table<R> table,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT MIN(e), ... |
SelectSumOperation(Table<R> table,
java.lang.String expression)
Constructs for standard sql select statement as:
SELECT SUM(e), ... |
Modifier and Type | Method and Description |
---|---|
void |
SelectCascadeOperation.cascade(S sourceRow)
Performs cascade operation.
|
void |
ModifyCascadeOperation.cascade(S sourceRow)
Performs cascade operation.
|
void |
CascadeOperation.cascade(S sourceRow)
Performs cascade operation.
|
void |
SelectCascadeOperation.close()
Cleans up by closing any JDBC resources.
|
void |
ModifyCascadeOperation.close()
Cleans up by closing any JDBC resources.
|
abstract void |
CascadeOperation.close()
Cleans up by closing any JDBC resources.
|
protected SqlOperation<?> |
UpdateCascadeOperation.createOperation()
Creates new instance of sql operation from
CascadeOperation.cascadeSqlOperationClass supplied in the
constructor. |
protected SqlOperation<?> |
SaveCascadeOperation.createOperation()
Creates new instance of sql operation from
CascadeOperation.cascadeSqlOperationClass supplied in the
constructor. |
protected SqlOperation<?> |
DeleteCascadeOperation.createOperation()
Creates new instance of sql operation from
CascadeOperation.cascadeSqlOperationClass supplied in the
constructor. |
protected SqlOperation<?> |
CascadeOperation.createOperation()
Creates new instance of sql operation from
CascadeOperation.cascadeSqlOperationClass supplied in the
constructor. |
void |
SelectCascadeOperation.prepare()
Prepares operation by initializing JDBC statements.
|
void |
ModifyCascadeOperation.prepare()
Prepares operation by initializing JDBC statements.
|
void |
CascadeOperation.prepare()
Prepares operation by initializing JDBC statements.
|
protected void |
CascadeOperation.prepareForeignKeyReferenceField()
Prepares accessor that will set foreign key reference on cascaded target rows as defined by
Cascade.foreignKeyReferenceField() . |
protected void |
CascadeOperation.prepareForeignKeyValueFields()
Prepares accessors that will set foreign key(s) on cascaded target rows as defined by
Cascade.foreignKeyValueFields() . |
protected void |
SelectCascadeOperation.prepareParameterFields()
Uses reflection to get fields for each of the source class
variables that will be read from source and set as parameters on
cascade operation.
|
protected void |
SelectCascadeOperation.prepareWhere()
Configures the
WhereTranslator to use for cascade. |
protected void |
CascadeOperation.setForeignKeyReference(java.util.Collection<T> rows)
Sets the foreign key reference in target (child) rows as source (parent) row.
|
protected void |
CascadeOperation.setForeignKeyReference(T row)
Sets the foreign key reference in target (child) row as source (parent) row.
|
protected void |
CascadeOperation.setForeignKeyValues(java.util.Collection<T> rows)
Sets the foreign key(s) in target (child) rows from primary key(s) in source (parent) row.
|
protected void |
CascadeOperation.setForeignKeyValues(T row)
Sets the foreign key(s) in target (child) row from primary key(s) in source (parent) row.
|
protected void |
SelectCascadeOperation.setParameters(S sourceRow)
SelectCascadeOperation.cascade(S) invokes this method to set parameters in cascade operation based
upon parameter fields that were created by SelectCascadeOperation.prepareParameterFields() . |
protected T[] |
SelectCascadeOperation.toTargetArray(java.util.Collection<T> c) |