Class UpdateResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
org.apache.derby.impl.sql.execute.DMLWriteResultSet
org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet
org.apache.derby.impl.sql.execute.UpdateResultSet
- All Implemented Interfaces:
ResultSet
Update the rows from the specified
base table. This will cause constraints to be checked
and triggers to be executed based on the c's and t's
compiled into the update plan.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate FormatableBitSet(package private) booleanprivate GeneratedMethod(package private) UpdateConstantAction(package private) booleanprotected ConglomerateControllerprivate ExecRowprivate BackingStoreHashtableprivate ExecRowprivate ExecRowprotected ConglomerateController[]protected long[]protected boolean[]protected ScanController[]private TemporaryRowHolderImplprivate FKInfo[]private GeneratedMethodprivate longprivate TemporaryRowHolderImpl(package private) intprivate ExecRowprivate intprivate intprivate ExecRowprivate intprivate RISetCheckerprivate ExecRowprivate RowChanger(package private) NoPutResultSetprivate TransactionControllerprivate TriggerEventActivatorprivate TriggerInfoprivate ResultDescriptionprivate booleanprivate booleanFields inherited from class DMLWriteGeneratedColumnsResultSet
aiCache, autoGeneratedKeysColumnIndexes, autoGeneratedKeysResultSet, autoGeneratedKeysRowsHolder, autoincrementGenerated, identitySequenceUUIDString, identityVal, setIdentity, sourceResultSetFields inherited from class DMLWriteResultSet
baseRowReadMap, cachedDestinations, constantAction, heapDCOCI, indexDCOCIs, resultDescription, rowCount, streamStorableHeapColIdsFields inherited from class NoRowsResultSetImpl
activation, beginExecutionTime, beginTime, endExecutionTime, endTime, lccFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionUpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation) UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, int constantActionItem, int rsdItem) UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, ConstantAction passedInConstantAction, ResultDescription passedInRsd) -
Method Summary
Modifier and TypeMethodDescriptionprivate FormatableBitSetvoidcleanUp()Tells the system to clean up on an error.voidclose()Tells the system that there will be no more calls to getNextRow() (until the next open() call), so it can free up the resources associated with the ResultSet.booleanprivate booleanRun check constraints against the current row.(package private) void(package private) voidstatic booleanfoundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder) protected ExecRowgetNextRowCore(NoPutResultSet source) Get next row from the source result set.getSetAutoincrementValue(int columnPosition, long increment) getSetAutoincrementValue will get the autoincrement value of the columnPosition specified for the target table.protected voidinitializeAIcache(RowLocation[] rla) private voidnotifyForUpdateCursor(DataValueDescriptor[] row, DataValueDescriptor[] newBaseRow, RowLocation rl, TableScanResultSet tableScan) private voidobjectifyStream(ExecRow tempRow, FormatableBitSet streamCols) voidopen()Needs to be called before the result set will do anything.private ExecRowprocessMergeRow(NoPutResultSet sourceRS, ExecRow row) Special handling if this is an UPDATE action of a MERGE statement.voidrememberConstraint(UUID cid) (package private) void(package private) voidrunChecker(boolean restrictCheckOnly) (package private) voidsetup()Set up the result set for use.(package private) voidMethods inherited from class DMLWriteGeneratedColumnsResultSet
firstExecuteSpecialHandlingAutoGen, getAutoGeneratedKeysResultset, getCompactRow, saveAIcacheInformation, verifyAutoGeneratedRScolumnsListMethods inherited from class DMLWriteResultSet
decodeLockMode, getIndexNameFromCID, getResultDescription, makeDeferredSparseRow, modifiedRowCount, normalizeRowMethods inherited from class NoRowsResultSetImpl
addWarning, checkRowPosition, clearCurrentRow, close, doesCommit, evaluateGenerationClauses, finish, getAbsoluteRow, getActivation, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
tc
-
newBaseRow
-
row
-
deferredSparseRow
-
constants
UpdateConstantAction constants -
savedSource
NoPutResultSet savedSource -
rowChanger
-
deferredBaseCC
-
deferredUniqueCIDs
protected long[] deferredUniqueCIDs -
deferredUniqueCreated
protected boolean[] deferredUniqueCreated -
deferredUniqueCC
-
deferredUniqueScans
-
deletedRowHolder
-
insertedRowHolder
-
riChecker
-
triggerInfo
-
triggerActivator
-
updatingReferencedKey
private boolean updatingReferencedKey -
updatingForeignKey
private boolean updatingForeignKey -
numOpens
private int numOpens -
heapConglom
private long heapConglom -
fkInfoArray
-
baseRowReadList
-
generationClauses
-
checkGM
-
resultWidth
private int resultWidth -
numberOfBaseColumns
private int numberOfBaseColumns -
deferredTempRow
-
deferredBaseRow
-
oldDeletedRow
-
triggerResultDescription
-
lockMode
int lockMode -
deferred
boolean deferred -
beforeUpdateCopyRequired
boolean beforeUpdateCopyRequired -
violatingCheckConstraints
-
deferredChecks
-
-
Constructor Details
-
UpdateResultSet
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation) throws StandardException - Parameters:
source- update rows come from sourcegenerationClauses- Generated method for computed generation clausescheckGM- Generated method for enforcing check constraintsactivation- The activation- Throws:
StandardException- thrown on error
-
UpdateResultSet
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, int constantActionItem, int rsdItem) throws StandardException - Parameters:
source- update rows come from sourcegenerationClauses- Generated method for computed generation clausescheckGM- Generated method for enforcing check constraintsactivation- ActivationconstantActionItem- id of the update constant action saved objectrsdItem- id of the Result Description saved object- Throws:
StandardException- thrown on error
-
UpdateResultSet
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, ConstantAction passedInConstantAction, ResultDescription passedInRsd) throws StandardException - Parameters:
source- update rows come from sourcegenerationClauses- Generated method for computed generation clausescheckGM- Generated method for enforcing check constraintsactivation-passedInConstantAction-passedInRsd-- Throws:
StandardException- thrown on error
-
-
Method Details
-
open
Description copied from interface:ResultSetNeeds to be called before the result set will do anything. Need to call before getNextRow(), or for a result set that doesn't return rows, this is the call that will cause all the work to be done.- Throws:
StandardException- Standard Derby error policy
-
setup
Description copied from class:NoRowsResultSetImplSet up the result set for use. Should always be called fromopen().- Overrides:
setupin classNoRowsResultSetImpl- Throws:
StandardException- Standard Derby error policy
-
checkStreamCols
-
objectifyStream
- Throws:
StandardException
-
evaluateCheckConstraints
Run check constraints against the current row. Raise an error if a check constraint is violated, unless all the offending checks are deferred, in which case a false value will be returned. A NULL value will be interpreted as success (not violation).- Throws:
StandardException- thrown on error
-
collectAffectedRows
- Throws:
StandardException
-
getNextRowCore
Description copied from class:DMLWriteResultSetGet next row from the source result set.- Overrides:
getNextRowCorein classDMLWriteResultSet- Parameters:
source- SourceResultSet Also look at Track#2432/change 12433- Returns:
- The next row in the result set
- Throws:
StandardException- Standard error policy
-
processMergeRow
Special handling if this is an UPDATE action of a MERGE statement.
- Throws:
StandardException
-
notifyForUpdateCursor
private void notifyForUpdateCursor(DataValueDescriptor[] row, DataValueDescriptor[] newBaseRow, RowLocation rl, TableScanResultSet tableScan) throws StandardException - Throws:
StandardException
-
fireBeforeTriggers
- Throws:
StandardException
-
fireAfterTriggers
- Throws:
StandardException
-
updateDeferredRows
- Throws:
StandardException
-
runChecker
- Throws:
StandardException
-
foundRow
public static boolean foundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder) throws StandardException - Throws:
StandardException
-
cleanUp
Description copied from interface:ResultSetTells the system to clean up on an error.- Throws:
StandardException- Thrown on error- See Also:
-
close
Description copied from interface:ResultSetTells the system that there will be no more calls to getNextRow() (until the next open() call), so it can free up the resources associated with the ResultSet.- Throws:
StandardException- Thrown on error.
-
rowChangerFinish
- Throws:
StandardException
-
rememberConstraint
- Overrides:
rememberConstraintin classDMLWriteResultSet- Throws:
StandardException
-
getSetAutoincrementValue
public NumberDataValue getSetAutoincrementValue(int columnPosition, long increment) throws StandardException getSetAutoincrementValue will get the autoincrement value of the columnPosition specified for the target table. If increment is non-zero we will also update the autoincrement value.- Overrides:
getSetAutoincrementValuein classDMLWriteGeneratedColumnsResultSet- Parameters:
columnPosition- position of the column in the table (1-based)increment- amount of increment.- Throws:
StandardException- if anything goes wrong.
-
initializeAIcache
- Throws:
StandardException
-