Class MatchingClauseConstantAction
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
,ConstantAction
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate String
private ResultSet
private int
private GeneratedMethod
private String
private String
private GeneratedMethod
private String
private ConstantAction
private ResultDescription
private static final int
private static final long
Serial version produced by the serialver utility.Fields inherited from interface org.apache.derby.iapi.sql.execute.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 ExecRow
bufferThenRow
(Activation activation) Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.(package private) TemporaryRowHolderImpl
bufferThenRow
(Activation activation, TemporaryRowHolderImpl thenRows, ExecRow selectRow) Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.int
Get the clause type: WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE(package private) void
cleanUp()
Release resources at the end.private TemporaryRowHolderImpl
createThenRows
(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) boolean
evaluateRefinementClause
(Activation activation) Run the matching refinement clause associated with this WHEN [ NOT ] MATCHED clause.void
executeConstantAction
(Activation activation) Run the ConstantAction.void
executeConstantAction
(Activation activation, TemporaryRowHolderImpl thenRows) int
Get the formatID which corresponds to this class.(package private) void
init()
Initialize this constant action, nulling out any transient state left over from a previous use.void
Read this object from a stream of stored objects.void
Write 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
Description copied from interface:ConstantAction
Run the ConstantAction.- Specified by:
executeConstantAction
in 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
Release resources at the end.
- Throws:
StandardException
-
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:
readExternal
in 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:
writeExternal
in 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:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- the formatID of this class
-