org.sormula.operation.cascade
Class ModifyCascadeOperation<S,T>

java.lang.Object
  extended by org.sormula.operation.cascade.CascadeOperation<S,T>
      extended by org.sormula.operation.cascade.ModifyCascadeOperation<S,T>
Type Parameters:
S - row class of table that is source of cascade
T - row class of table that is target of cascade
Direct Known Subclasses:
DeleteCascadeOperation, InsertCascadeOperation, SaveCascadeOperation, UpdateCascadeOperation

public abstract class ModifyCascadeOperation<S,T>
extends CascadeOperation<S,T>

Base class for cascades that modify database.

Author:
Jeff Miller

Constructor Summary
ModifyCascadeOperation(SormulaField<S,?> targetField, Table<T> targetTable, java.lang.Class<?> cascadeOperationClass, boolean post)
          Constructs.
 
Method Summary
 void cascade(S sourceRow)
          Performs cascade operation.
 void close()
          Cleans up by closing any JDBC resources.
 void prepare()
          Prepares operation by initializing JDBC statements.
 
Methods inherited from class org.sormula.operation.cascade.CascadeOperation
createOperation, getTargetField, getTargetTable, isPost
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ModifyCascadeOperation

public ModifyCascadeOperation(SormulaField<S,?> targetField,
                              Table<T> targetTable,
                              java.lang.Class<?> cascadeOperationClass,
                              boolean post)
Constructs.

Parameters:
targetField - cascade operation uses row(s) from this field
targetTable - cascade operation is performed on this table
cascadeOperationClass - class of cascade operation
post - true if cascade is performed after row execute (see ModifyOperation.postExecute(R)); false if cascade is performed before row execute (see ModifyOperation.preExecute(R)
Method Detail

cascade

public void cascade(S sourceRow)
             throws OperationException
Performs cascade operation.

Specified by:
cascade in class CascadeOperation<S,T>
Parameters:
sourceRow - row in parent table that was source the cascade
Throws:
OperationException - if error

prepare

public void prepare()
             throws OperationException
Prepares operation by initializing JDBC statements.

Specified by:
prepare in class CascadeOperation<S,T>
Throws:
OperationException - if error

close

public void close()
           throws OperationException
Cleans up by closing any JDBC resources.

Specified by:
close in class CascadeOperation<S,T>
Throws:
OperationException - if error