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

public abstract Class DMLWriteResultSet

extends NoRowsResultSetImpl
Class Inheritance
Known Direct Subclasses
org.apache.derby.impl.sql.execute.DeleteResultSet, org.apache.derby.impl.sql.execute.DMLVTIResultSet, org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet
Imports
java.io.InputStream, org.apache.derby.catalog.UUID, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.io.FormatableBitSet, .StreamStorable, org.apache.derby.iapi.sql.Activation, .ResultColumnDescriptor, .ResultDescription, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.execute.ConstantAction, .ExecRow, .NoPutResultSet, org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo, .TransactionController, org.apache.derby.iapi.transaction.TransactionControl, org.apache.derby.iapi.types.DataTypeDescriptor, .DataValueDescriptor, org.apache.derby.shared.common.sanity.SanityManager

For INSERT/UPDATE/DELETE impls. Used to tag them.

Field Summary

Modifier and TypeField and Description
protected int[]
protected DataValueDescriptor[]
cachedDestinations

This array contains data value descriptors that can be used (and reused) to hold the normalized column values.

protected WriteCursorConstantAction
protected DynamicCompiledOpenConglomInfo
protected DynamicCompiledOpenConglomInfo[]
private boolean
protected ResultDescription
public long
protected int[]
Inherited from org.apache.derby.impl.sql.execute.NoRowsResultSetImpl:
activationbeginExecutionTimebeginTimeendExecutionTimeendTimelcc

Constructor Summary

AccessConstructor and Description
pack-priv
DMLWriteResultSet(Activation
an activation
activation
)

Constructor

pack-priv
DMLWriteResultSet(Activation activation, ConstantAction constantAction)

Method Summary

Modifier and TypeMethod and Description
pack-priv int

Returns:

the lock mode (record or table) to use to open the result set
decodeLockMode
(int
the compiled encoded lock mode for this query
lockMode
)

Decode the update lock mode.

pack-priv String

Returns:

index name of given index.
getIndexNameFromCID
(long
conglomerate ID of the index.
indexCID
)

get the index name given the conglomerate id of the index.

protected ExecRow

Returns:

The next row in the result set
getNextRowCore
(NoPutResultSet
SourceResultSet Also look at Track#2432/change 12433
source
)

Get next row from the source result set.

public ResultDescription

Returns:

the description of the inserted rows
getResultDescription
()

Overrides org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.getResultDescription.

Implements org.apache.derby.iapi.sql.ResultSet.getResultDescription.

Returns the description of the inserted rows.

protected ExecRow

Returns:

the deferred sparse row
makeDeferredSparseRow
(ExecRow
the deferred non-sparse row
deferredBaseRow
,
FormatableBitSet
the columns to include (1-based bit map)
baseRowReadList
,
LanguageConnectionContext
the language connection context
lcc
)

For deferred update, get a deferred sparse row based on the deferred non-sparse row.

public final long
protected ExecRow

Returns:

the normalized row
normalizeRow
(NoPutResultSet
the result set for which this action is to be performed
sourceResultSet
,
ExecRow
the row to be normalized
row
)

Normalize a row as part of the INSERT/UPDATE action of a MERGE statement.

private void
public void
Inherited from org.apache.derby.impl.sql.execute.NoRowsResultSetImpl:
addWarningcheckRowPositionclearCurrentRowclosedoesCommitevaluateGenerationClausesfinishgetAbsoluteRowgetActivationgetAutoGeneratedKeysResultsetgetBeginExecutionTimestampgetCurrentTimeMillisgetCursorNamegetEndExecutionTimestampgetExecuteTimegetFirstRowgetLastRowgetNextRowgetPreviousRowgetQueryPlanTextgetRelativeRowgetRowNumbergetSubqueryTrackingArraygetTimeSpentgetWarningsisClosedreturnsRowssetAfterLastRowsetBeforeFirstRowsetuptoXML

Field Detail

baseRowReadMapback to summary
protected int[] baseRowReadMap
cachedDestinationsback to summary
protected DataValueDescriptor[] cachedDestinations

This array contains data value descriptors that can be used (and reused) to hold the normalized column values.

constantActionback to summary
protected WriteCursorConstantAction constantAction
heapDCOCIback to summary
protected DynamicCompiledOpenConglomInfo heapDCOCI
indexDCOCIsback to summary
protected DynamicCompiledOpenConglomInfo[] indexDCOCIs
needToObjectifyStreamback to summary
private boolean needToObjectifyStream
resultDescriptionback to summary
protected ResultDescription resultDescription
rowCountback to summary
public long rowCount
streamStorableHeapColIdsback to summary
protected int[] streamStorableHeapColIds

Constructor Detail

DMLWriteResultSetback to summary
pack-priv DMLWriteResultSet(Activation activation) throws StandardException

Constructor

Parameters
activation:Activation

an activation

Exceptions
StandardException:
on error
DMLWriteResultSetback to summary
pack-priv DMLWriteResultSet(Activation activation, ConstantAction constantAction) throws StandardException

Method Detail

decodeLockModeback to summary
pack-priv int decodeLockMode(int lockMode)

Decode the update lock mode.

The value for update lock mode is in the second most significant byte for TransactionControl.SERIALIZABLE_ISOLATION_LEVEL isolation level. Otherwise (REPEATABLE READ, READ COMMITTED, and READ UNCOMMITTED) the lock mode is located in the least significant byte.

This is done to override the optimizer choice to provide maximum concurrency of record level locking except in SERIALIZABLE where table level locking is required in heap scans for correctness. See org.apache.derby.impl.sql.compile.FromBaseTable#updateTargetLockMode

Parameters
lockMode:int

the compiled encoded lock mode for this query

Returns:int

the lock mode (record or table) to use to open the result set

getIndexNameFromCIDback to summary
pack-priv String getIndexNameFromCID(long indexCID)

get the index name given the conglomerate id of the index.

Parameters
indexCID:long

conglomerate ID of the index.

Returns:String

index name of given index.

getNextRowCoreback to summary
protected ExecRow getNextRowCore(NoPutResultSet source) throws StandardException

Get next row from the source result set.

Parameters
source:NoPutResultSet

SourceResultSet Also look at Track#2432/change 12433

Returns:ExecRow

The next row in the result set

Exceptions
StandardException:
Standard error policy
getResultDescriptionback to summary
public ResultDescription getResultDescription()

Overrides org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.getResultDescription.

Implements org.apache.derby.iapi.sql.ResultSet.getResultDescription.

Returns the description of the inserted rows.

Revisit

Do we want this to return NULL instead?

Returns:ResultDescription

the description of the inserted rows

Annotations
@Override
makeDeferredSparseRowback to summary
protected ExecRow makeDeferredSparseRow(ExecRow deferredBaseRow, FormatableBitSet baseRowReadList, LanguageConnectionContext lcc) throws StandardException

For deferred update, get a deferred sparse row based on the deferred non-sparse row. Share the underlying columns. If there is no column bit map, make them the same row.

Parameters
deferredBaseRow:ExecRow

the deferred non-sparse row

baseRowReadList:FormatableBitSet

the columns to include (1-based bit map)

lcc:LanguageConnectionContext

the language connection context

Returns:ExecRow

the deferred sparse row

Exceptions
StandardException:
Thrown on error
modifiedRowCountback to summary
public final long modifiedRowCount()

Overrides org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.modifiedRowCount.

Implements org.apache.derby.iapi.sql.ResultSet.modifiedRowCount.

Doc from org.apache.derby.impl.sql.execute.NoRowsResultSetImpl.modifiedRowCount.

Returns zero.

Returns:long

Doc from org.apache.derby.iapi.sql.ResultSet.modifiedRowCount.

The number of rows affect by the statement, so far.

Annotations
@Override
normalizeRowback to summary
protected ExecRow normalizeRow(NoPutResultSet sourceResultSet, ExecRow row) throws StandardException

Normalize a row as part of the INSERT/UPDATE action of a MERGE statement. This applies logic usually found in a NormalizeResultSet, which is missing for the MERGE statement.

Parameters
sourceResultSet:NoPutResultSet

the result set for which this action is to be performed

row:ExecRow

the row to be normalized

Returns:ExecRow

the normalized row

Exceptions
StandardException:
Standard error policy
objectifyStreamsback to summary
private void objectifyStreams(ExecRow row) throws StandardException
rememberConstraintback to summary
public void rememberConstraint(UUID cid) throws StandardException