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) boolean
private GeneratedMethod
(package private) UpdateConstantAction
(package private) boolean
protected ConglomerateController
private ExecRow
private BackingStoreHashtable
private ExecRow
private ExecRow
protected ConglomerateController[]
protected long[]
protected boolean[]
protected ScanController[]
private TemporaryRowHolderImpl
private FKInfo[]
private GeneratedMethod
private long
private TemporaryRowHolderImpl
(package private) int
private ExecRow
private int
private int
private ExecRow
private int
private RISetChecker
private ExecRow
private RowChanger
(package private) NoPutResultSet
private TransactionController
private TriggerEventActivator
private TriggerInfo
private ResultDescription
private boolean
private boolean
Fields inherited from class org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet
aiCache, autoGeneratedKeysColumnIndexes, autoGeneratedKeysResultSet, autoGeneratedKeysRowsHolder, autoincrementGenerated, identitySequenceUUIDString, identityVal, setIdentity, sourceResultSet
Fields inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
baseRowReadMap, cachedDestinations, constantAction, heapDCOCI, indexDCOCIs, resultDescription, rowCount, 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
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 FormatableBitSet
void
cleanUp()
Tells the system to clean up on an error.void
close()
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.boolean
private boolean
Run check constraints against the current row.(package private) void
(package private) void
static boolean
foundRow
(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder) protected ExecRow
getNextRowCore
(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 void
initializeAIcache
(RowLocation[] rla) private void
notifyForUpdateCursor
(DataValueDescriptor[] row, DataValueDescriptor[] newBaseRow, RowLocation rl, TableScanResultSet tableScan) private void
objectifyStream
(ExecRow tempRow, FormatableBitSet streamCols) void
open()
Needs to be called before the result set will do anything.private ExecRow
processMergeRow
(NoPutResultSet sourceRS, ExecRow row) Special handling if this is an UPDATE action of a MERGE statement.void
rememberConstraint
(UUID cid) (package private) void
(package private) void
runChecker
(boolean restrictCheckOnly) (package private) void
setup()
Set up the result set for use.(package private) void
Methods inherited from class org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet
firstExecuteSpecialHandlingAutoGen, getAutoGeneratedKeysResultset, getCompactRow, saveAIcacheInformation, verifyAutoGeneratedRScolumnsList
Methods inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
decodeLockMode, getIndexNameFromCID, getResultDescription, makeDeferredSparseRow, modifiedRowCount, normalizeRow
Methods inherited from class org.apache.derby.impl.sql.execute.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:ResultSet
Needs 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:NoRowsResultSetImpl
Set up the result set for use. Should always be called fromopen()
.- Overrides:
setup
in 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:DMLWriteResultSet
Get next row from the source result set.- Overrides:
getNextRowCore
in 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:ResultSet
Tells the system to clean up on an error.- Throws:
StandardException
- Thrown on error- See Also:
-
close
Description copied from interface:ResultSet
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.- Throws:
StandardException
- Thrown on error.
-
rowChangerFinish
- Throws:
StandardException
-
rememberConstraint
- Overrides:
rememberConstraint
in 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:
getSetAutoincrementValue
in 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
-