Class MatchingClauseConstantAction
- All Implemented Interfaces:
Externalizable, Serializable, Formatable, TypedFormat, ConstantAction
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Stringprivate ResultSetprivate int////////////////////////////////////////////////////////////////////////////////private GeneratedMethodprivate Stringprivate Stringprivate GeneratedMethodprivate Stringprivate ConstantActionprivate ResultDescriptionprivate static final intprivate static final longSerial version produced by the serialver utility.Fields inherited from interface ConstantAction
WHEN_MATCHED_THEN_DELETE, WHEN_MATCHED_THEN_UPDATE, WHEN_NOT_MATCHED_THEN_INSERT -
Constructor Summary
ConstructorsConstructorDescription0-arg constructor needed by Formatable machineryMatchingClauseConstantAction(int clauseType, String matchRefinementName, ResultDescription thenColumnSignature, String rowMakingMethodName, String resultSetFieldName, String actionMethodName, ConstantAction thenAction) Construct from thin air. -
Method Summary
Modifier and TypeMethodDescriptionprivate ExecRowbufferThenRow(Activation activation) Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.(package private) TemporaryRowHolderImplbufferThenRow(Activation activation, TemporaryRowHolderImpl thenRows, ExecRow selectRow) Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.intGet the clause type: WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE(package private) voidcleanUp()Release resources at the end.private TemporaryRowHolderImplcreateThenRows(Activation activation) Create the temporary table for holding the rows which are buffered up for bulk-processing after the driving left join completes.(package private) booleanevaluateRefinementClause(Activation activation) Run the matching refinement clause associated with this WHEN [ NOT ] MATCHED clause.voidexecuteConstantAction(Activation activation) ////////////////////////////////////////////////////////////////////////////////voidexecuteConstantAction(Activation activation, TemporaryRowHolderImpl thenRows) intGet the formatID which corresponds to this class.(package private) voidinit()Initialize this constant action, nulling out any transient state left over from a previous use.voidRead this object from a stream of stored objects.voidWrite this object to a stream of stored objects.
-
Field Details
-
serialVersionUID
private static final long serialVersionUIDSerial version produced by the serialver utility. Needed in order to make serialization work reliably across different compilers.- See Also:
-
FIRST_VERSION
private static final int FIRST_VERSION- See Also:
-
_clauseType
private int _clauseType//////////////////////////////////////////////////////////////////////////////// -
_matchRefinementName
-
_thenColumnSignature
-
_rowMakingMethodName
-
_resultSetFieldName
-
_actionMethodName
-
_thenAction
-
_matchRefinementMethod
-
_rowMakingMethod
-
_actionRS
-
-
Constructor Details
-
MatchingClauseConstantAction
public MatchingClauseConstantAction()0-arg constructor needed by Formatable machinery -
MatchingClauseConstantAction
public MatchingClauseConstantAction(int clauseType, String matchRefinementName, ResultDescription thenColumnSignature, String rowMakingMethodName, String resultSetFieldName, String actionMethodName, ConstantAction thenAction) Construct from thin air.- Parameters:
clauseType- WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETEmatchRefinementName- Name of the method which evaluates the boolean expression in the WHEN clause.thenColumnSignature- The shape of the row which goes into the temporary table.rowMakingMethodName- Name of the method which populates the "then" row with expressions from the driving left join.resultSetFieldName- Name of the field which will be stuffed at runtime with the temporary table of relevant rows.actionMethodName- Name of the method which invokes the INSERT/UPDATE/DELETE action.thenAction- The ConstantAction describing the associated INSERT/UPDATE/DELETE action.
-
-
Method Details
-
clauseType
public int clauseType()Get the clause type: WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE -
executeConstantAction
////////////////////////////////////////////////////////////////////////////////- Specified by:
executeConstantActionin interfaceConstantAction- Parameters:
activation- The execution environment for this constant action.- Throws:
StandardException- Thrown on failure
-
executeConstantAction
public void executeConstantAction(Activation activation, TemporaryRowHolderImpl thenRows) throws StandardException - Throws:
StandardException
-
init
Initialize this constant action, nulling out any transient state left over from a previous use.
- Throws:
StandardException
-
evaluateRefinementClause
Run the matching refinement clause associated with this WHEN [ NOT ] MATCHED clause. The refinement is a boolean expression. Return the boolean value it resolves to. A boolean NULL is treated as false. If there is no refinement clause, then this method evaluates to true.
- Throws:
StandardException
-
bufferThenRow
TemporaryRowHolderImpl bufferThenRow(Activation activation, TemporaryRowHolderImpl thenRows, ExecRow selectRow) throws StandardException Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause. The buffered row is built from columns in the passed-in row. The passed-in row is the SELECT list of the MERGE statement's driving left join.
- Throws:
StandardException
-
cleanUp
-
bufferThenRow
Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.
- Throws:
StandardException
-
createThenRows
Create the temporary table for holding the rows which are buffered up for bulk-processing after the driving left join completes.
- Throws:
StandardException
-
readExternal
Read this object from a stream of stored objects.- Specified by:
readExternalin interfaceExternalizable- Parameters:
in- read this.- Throws:
IOException- thrown on errorClassNotFoundException- thrown on error
-
writeExternal
Write this object to a stream of stored objects.- Specified by:
writeExternalin interfaceExternalizable- Parameters:
out- write bytes here.- Throws:
IOException- thrown on error
-
getTypeFormatId
public int getTypeFormatId()Get the formatID which corresponds to this class.- Specified by:
getTypeFormatIdin interfaceTypedFormat- Returns:
- the formatID of this class
-