Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

public Class MatchingClauseConstantAction

extends Object
implements ConstantAction, Formatable
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.services.io.Formatable, org.apache.derby.iapi.services.io.TypedFormat, java.io.Externalizable, java.io.Serializable, org.apache.derby.iapi.sql.execute.ConstantAction
Imports
java.io.ObjectOutput, .ObjectInput, .IOException, java.lang.reflect.Field, .Method, java.util.Properties, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.shared.common.util.ArrayUtil, org.apache.derby.iapi.services.io.Formatable, .StoredFormatIds, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.ResultDescription, .ResultSet, .Activation, org.apache.derby.iapi.sql.execute.ConstantAction, .CursorResultSet, .ExecRow, org.apache.derby.iapi.types.SQLBoolean, org.apache.derby.shared.common.sanity.SanityManager

Describes the execution machinery needed to evaluate a WHEN [ NOT ] MATCHING clause of a MERGE statement.

Field Summary

Modifier and TypeField and Description
private String
private transient ResultSet
private int
private transient GeneratedMethod
private String
private String
private transient GeneratedMethod
private String
private ConstantAction
private ResultDescription
private static final int
private static final long
serialVersionUID

Serial version produced by the serialver utility.

Constructor Summary

AccessConstructor and Description
public
MatchingClauseConstantAction()

0-arg constructor needed by Formatable machinery

public
MatchingClauseConstantAction(int
WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE
clauseType
,
String
Name of the method which evaluates the boolean expression in the WHEN clause.
matchRefinementName
,
ResultDescription
The shape of the row which goes into the temporary table.
thenColumnSignature
,
String
Name of the method which populates the "then" row with expressions from the driving left join.
rowMakingMethodName
,
String
Name of the field which will be stuffed at runtime with the temporary table of relevant rows.
resultSetFieldName
,
String
Name of the method which invokes the INSERT/UPDATE/DELETE action.
actionMethodName
,
ConstantAction
The ConstantAction describing the associated INSERT/UPDATE/DELETE action.
thenAction
)

Construct from thin air.

Method Summary

Modifier and TypeMethod and Description
pack-priv 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.

private ExecRow
bufferThenRow(Activation activation)

Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.

public int
clauseType()

Get the clause type: WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE

pack-priv 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.

pack-priv boolean
evaluateRefinementClause(Activation activation)

Run the matching refinement clause associated with this WHEN [ NOT ] MATCHED clause.

public void
executeConstantAction(Activation
The execution environment for this constant action.
activation
)

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

Run the ConstantAction.

public void
public int

Returns:

the formatID of this class
getTypeFormatId
()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

pack-priv void
init()

Initialize this constant action, nulling out any transient state left over from a previous use.

public void
readExternal(ObjectInput
read this.
in
)

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

public void
writeExternal(ObjectOutput
write bytes here.
out
)

Implements java.io.Externalizable.writeExternal.

Write this object to a stream of stored objects.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_actionMethodNameback to summary
private String _actionMethodName
_actionRSback to summary
private transient ResultSet _actionRS
_clauseTypeback to summary
private int _clauseType
_matchRefinementMethodback to summary
private transient GeneratedMethod _matchRefinementMethod
_matchRefinementNameback to summary
private String _matchRefinementName
_resultSetFieldNameback to summary
private String _resultSetFieldName
_rowMakingMethodback to summary
private transient GeneratedMethod _rowMakingMethod
_rowMakingMethodNameback to summary
private String _rowMakingMethodName
_thenActionback to summary
private ConstantAction _thenAction
_thenColumnSignatureback to summary
private ResultDescription _thenColumnSignature
FIRST_VERSIONback to summary
private static final int FIRST_VERSION
serialVersionUIDback to summary
private static final long serialVersionUID

Serial version produced by the serialver utility. Needed in order to make serialization work reliably across different compilers.

Constructor Detail

MatchingClauseConstantActionback to summary
public MatchingClauseConstantAction()

0-arg constructor needed by Formatable machinery

MatchingClauseConstantActionback to summary
public MatchingClauseConstantAction(int clauseType, String matchRefinementName, ResultDescription thenColumnSignature, String rowMakingMethodName, String resultSetFieldName, String actionMethodName, ConstantAction thenAction)

Construct from thin air.

Parameters
clauseType:int

WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE

matchRefinementName:String

Name of the method which evaluates the boolean expression in the WHEN clause.

thenColumnSignature:ResultDescription

The shape of the row which goes into the temporary table.

rowMakingMethodName:String

Name of the method which populates the "then" row with expressions from the driving left join.

resultSetFieldName:String

Name of the field which will be stuffed at runtime with the temporary table of relevant rows.

actionMethodName:String

Name of the method which invokes the INSERT/UPDATE/DELETE action.

thenAction:ConstantAction

The ConstantAction describing the associated INSERT/UPDATE/DELETE action.

Method Detail

bufferThenRowback to summary
pack-priv 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.

bufferThenRowback to summary
private ExecRow bufferThenRow(Activation activation) throws StandardException

Construct and buffer a row for the INSERT/UPDATE/DELETE action corresponding to this [ NOT ] MATCHED clause.

clauseTypeback to summary
public int clauseType()

Get the clause type: WHEN_NOT_MATCHED_THEN_INSERT, WHEN_MATCHED_THEN_UPDATE, WHEN_MATCHED_THEN_DELETE

cleanUpback to summary
pack-priv void cleanUp() throws StandardException

Release resources at the end.

createThenRowsback to summary
private TemporaryRowHolderImpl createThenRows(Activation activation) throws StandardException

Create the temporary table for holding the rows which are buffered up for bulk-processing after the driving left join completes.

evaluateRefinementClauseback to summary
pack-priv boolean evaluateRefinementClause(Activation activation) throws StandardException

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.

executeConstantActionback to summary
public void executeConstantAction(Activation activation) throws StandardException

Implements org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

Doc from org.apache.derby.iapi.sql.execute.ConstantAction.executeConstantAction.

Run the ConstantAction.

Parameters
activation:Activation

The execution environment for this constant action.

Exceptions
StandardException:
Thrown on failure
executeConstantActionback to summary
public void executeConstantAction(Activation activation, TemporaryRowHolderImpl thenRows) throws StandardException
getTypeFormatIdback to summary
public int getTypeFormatId()

Implements org.apache.derby.iapi.services.io.TypedFormat.getTypeFormatId.

Get the formatID which corresponds to this class.

Returns:int

the formatID of this class

initback to summary
pack-priv void init() throws StandardException

Initialize this constant action, nulling out any transient state left over from a previous use.

readExternalback to summary
public void readExternal(ObjectInput in) throws IOException, ClassNotFoundException

Implements java.io.Externalizable.readExternal.

Read this object from a stream of stored objects.

Parameters
in:ObjectInput

read this.

Exceptions
IOException:
thrown on error
ClassNotFoundException:
thrown on error
writeExternalback to summary
public void writeExternal(ObjectOutput out) throws IOException

Implements java.io.Externalizable.writeExternal.

Write this object to a stream of stored objects.

Parameters
out:ObjectOutput

write bytes here.

Exceptions
IOException:
thrown on error