Class DMLWriteResultSet
- java.lang.Object
-
- org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
-
- org.apache.derby.impl.sql.execute.DMLWriteResultSet
-
- All Implemented Interfaces:
ResultSet
- Direct Known Subclasses:
DeleteResultSet,DMLVTIResultSet,DMLWriteGeneratedColumnsResultSet
public abstract class DMLWriteResultSet extends NoRowsResultSetImpl
For INSERT/UPDATE/DELETE impls. Used to tag them.
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]baseRowReadMapprotected DataValueDescriptor[]cachedDestinationsThis array contains data value descriptors that can be used (and reused) to hold the normalized column values.protected WriteCursorConstantActionconstantActionprotected DynamicCompiledOpenConglomInfoheapDCOCIprotected DynamicCompiledOpenConglomInfo[]indexDCOCIsprivate booleanneedToObjectifyStreamprotected ResultDescriptionresultDescriptionlongrowCountprotected int[]streamStorableHeapColIds-
Fields inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lcc
-
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
-
-
Constructor Summary
Constructors Constructor Description DMLWriteResultSet(Activation activation)ConstructorDMLWriteResultSet(Activation activation, ConstantAction constantAction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) intdecodeLockMode(int lockMode)Decode the update lock mode.(package private) java.lang.StringgetIndexNameFromCID(long indexCID)get the index name given the conglomerate id of the index.protected ExecRowgetNextRowCore(NoPutResultSet source)Get next row from the source result set.ResultDescriptiongetResultDescription()Returns the description of the inserted rows.protected ExecRowmakeDeferredSparseRow(ExecRow deferredBaseRow, FormatableBitSet baseRowReadList, LanguageConnectionContext lcc)For deferred update, get a deferred sparse row based on the deferred non-sparse row.longmodifiedRowCount()Returns zero.protected ExecRownormalizeRow(NoPutResultSet sourceResultSet, ExecRow row)Normalize a row as part of the INSERT/UPDATE action of a MERGE statement.private voidobjectifyStreams(ExecRow row)voidrememberConstraint(UUID cid)-
Methods inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, setup, toXML
-
-
-
-
Field Detail
-
constantAction
protected WriteCursorConstantAction constantAction
-
baseRowReadMap
protected int[] baseRowReadMap
-
streamStorableHeapColIds
protected int[] streamStorableHeapColIds
-
heapDCOCI
protected DynamicCompiledOpenConglomInfo heapDCOCI
-
indexDCOCIs
protected DynamicCompiledOpenConglomInfo[] indexDCOCIs
-
needToObjectifyStream
private boolean needToObjectifyStream
-
rowCount
public long rowCount
-
resultDescription
protected ResultDescription resultDescription
-
cachedDestinations
protected DataValueDescriptor[] cachedDestinations
This array contains data value descriptors that can be used (and reused) to hold the normalized column values.
-
-
Constructor Detail
-
DMLWriteResultSet
DMLWriteResultSet(Activation activation) throws StandardException
Constructor- Parameters:
activation- an activation- Throws:
StandardException- on error
-
DMLWriteResultSet
DMLWriteResultSet(Activation activation, ConstantAction constantAction) throws StandardException
- Throws:
StandardException
-
-
Method Detail
-
modifiedRowCount
public final long modifiedRowCount()
Description copied from class:NoRowsResultSetImplReturns zero.- Specified by:
modifiedRowCountin interfaceResultSet- Overrides:
modifiedRowCountin classNoRowsResultSetImpl- Returns:
- The number of rows affect by the statement, so far.
-
getResultDescription
public ResultDescription getResultDescription()
Returns the description of the inserted rows. REVISIT: Do we want this to return NULL instead?- Specified by:
getResultDescriptionin interfaceResultSet- Overrides:
getResultDescriptionin classNoRowsResultSetImpl- Returns:
- the description of the inserted rows
-
getNextRowCore
protected ExecRow getNextRowCore(NoPutResultSet source) throws StandardException
Get next row from the source result set.- Parameters:
source- SourceResultSet Also look at Track#2432/change 12433- Returns:
- The next row in the result set
- Throws:
StandardException- Standard error policy
-
objectifyStreams
private void objectifyStreams(ExecRow row) throws StandardException
- Throws:
StandardException
-
makeDeferredSparseRow
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- the deferred non-sparse rowbaseRowReadList- the columns to include (1-based bit map)lcc- the language connection context- Returns:
- the deferred sparse row
- Throws:
StandardException- Thrown on error
-
decodeLockMode
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.
- Parameters:
lockMode- the compiled encoded lock mode for this query- Returns:
- the lock mode (record or table) to use to open the result set
- See Also:
FromBaseTable.updateTargetLockMode()
-
getIndexNameFromCID
java.lang.String getIndexNameFromCID(long indexCID)
get the index name given the conglomerate id of the index.- Parameters:
indexCID- conglomerate ID of the index.- Returns:
- index name of given index.
-
normalizeRow
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- the result set for which this action is to be performedrow- the row to be normalized- Returns:
- the normalized row
- Throws:
StandardException- Standard error policy
-
rememberConstraint
public void rememberConstraint(UUID cid) throws StandardException
- Throws:
StandardException
-
-