S
- row class of table that is source of cascadeT
- row class of table that is target of cascadepublic abstract class ModifyCascadeOperation<S,T> extends CascadeOperation<S,T>
Constructor and Description |
---|
ModifyCascadeOperation(ModifyOperation<S> sourceOperation,
RowField<S,?> targetField,
Table<T> targetTable,
java.lang.Class<?> cascadeSqlOperationClass)
Constructs from source operation and targets of the cascade.
|
Modifier and Type | Method and Description |
---|---|
void |
cascade(S sourceRow)
Performs cascade operation.
|
void |
close()
Cleans up by closing any JDBC resources.
|
protected void |
deriveSqlOperationAttributes()
Sets the sql operation attributes that are the same as source attributes for
all levels.
|
boolean |
isBatch()
Returns source operation
ModifyOperation.isBatch() . |
void |
prepare()
Prepares operation by initializing JDBC statements.
|
createOperation, getDepth, getForeignKeyReferenceFieldName, getForeignKeyValueFieldNames, getKeyFieldCount, getNamedParameterMap, getRequiredCascades, getSourceOperation, getSourceRow, getSourceTable, getTargetField, getTargetForeignKeyValueFieldList, getTargetTable, isPost, prepareForeignKeyReferenceField, prepareForeignKeyValueFields, setForeignKeyFieldNames, setForeignKeyReference, setForeignKeyReference, setForeignKeyReferenceFieldName, setForeignKeyValues, setForeignKeyValues, setPost
public ModifyCascadeOperation(ModifyOperation<S> sourceOperation, RowField<S,?> targetField, Table<T> targetTable, java.lang.Class<?> cascadeSqlOperationClass)
sourceOperation
- operation where cascade originatestargetField
- cascade operation uses row(s) from this fieldtargetTable
- cascade operation is performed on this tablecascadeSqlOperationClass
- class of cascade operation
false if cascade is performed before row execute (see ModifyOperation.preExecute(R)
public boolean isBatch()
ModifyOperation.isBatch()
.
Note that batch operations do not support identity operations (InsertOperation.setAutoGeneratedKeys(boolean)
and Column.identity()
). So cascaded inserts cannot have values generated for identity columns.
public void cascade(S sourceRow) throws OperationException
cascade
in class CascadeOperation<S,T>
sourceRow
- row in parent table that was source the cascadeOperationException
- if errorpublic void prepare() throws OperationException
CascadeOperation.prepareForeignKeyValueFields()
. Subclasses should override
to perform additional preparation.prepare
in class CascadeOperation<S,T>
OperationException
- if errorprotected void deriveSqlOperationAttributes()
CascadeOperation
deriveSqlOperationAttributes
in class CascadeOperation<S,T>
public void close() throws OperationException
close
in interface java.lang.AutoCloseable
close
in class CascadeOperation<S,T>
OperationException
- if error