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

pack-priv Class UpdateResultSet

extends DMLWriteGeneratedColumnsResultSet
Class Inheritance
Imports
java.util.ArrayList, .Arrays, .List, .Properties, .Vector, org.apache.derby.catalog.UUID, org.apache.derby.iapi.db.TriggerExecutionContext, org.apache.derby.shared.common.error.StandardException, org.apache.derby.shared.common.reference.SQLState, org.apache.derby.iapi.services.io.FormatableBitSet, .StreamStorable, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation, .ResultDescription, .ResultSet, org.apache.derby.iapi.sql.execute.ConstantAction, .CursorResultSet, .ExecRow, .NoPutResultSet, .RowChanger, org.apache.derby.iapi.store.access.BackingStoreHashtable, .ConglomerateController, .ScanController, .TransactionController, org.apache.derby.iapi.types.BooleanDataValue, .DataValueDescriptor, .NumberDataValue, .RowLocation, .SQLBoolean, .SQLRef, org.apache.derby.impl.sql.execute.DeferredConstraintsMemory.CheckInfo, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.dictionary.ColumnDescriptor, .ColumnDescriptorList, .TableDescriptor

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

Modifier and TypeField and Description
private FormatableBitSet
pack-priv boolean
private GeneratedMethod
pack-priv UpdateConstantAction
pack-priv 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
pack-priv int
private ExecRow
private int
private int
private ExecRow
private int
private RISetChecker
private ExecRow
private RowChanger
pack-priv NoPutResultSet
private TransactionController
private TriggerEventActivator
private TriggerInfo
private ResultDescription
private boolean
private boolean
private List<UUID>
Inherited from org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet:
aiCacheautoGeneratedKeysColumnIndexesautoGeneratedKeysResultSetautoGeneratedKeysRowsHolderautoincrementGeneratedidentitySequenceUUIDStringidentityValsetIdentitysourceResultSet

Constructor Summary

AccessConstructor and Description
pack-priv
UpdateResultSet(NoPutResultSet
update rows come from source
source
,
GeneratedMethod
Generated method for computed generation clauses
generationClauses
,
GeneratedMethod
Generated method for enforcing check constraints
checkGM
,
Activation
The activation
activation
)

pack-priv
UpdateResultSet(NoPutResultSet
update rows come from source
source
,
GeneratedMethod
Generated method for computed generation clauses
generationClauses
,
GeneratedMethod
Generated method for enforcing check constraints
checkGM
,
Activation
Activation
activation
,
int
id of the update constant action saved object
constantActionItem
,
int
id of the Result Description saved object
rsdItem
)

pack-priv
UpdateResultSet(NoPutResultSet
update rows come from source
source
,
GeneratedMethod
Generated method for computed generation clauses
generationClauses
,
GeneratedMethod
Generated method for enforcing check constraints
checkGM
,
Activation activation, ConstantAction passedInConstantAction, ResultDescription passedInRsd)

Method Summary

Modifier and TypeMethod and Description
private FormatableBitSet
public void
cleanUp()

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

Tells the system to clean up on an error.

public void
close()

Implements org.apache.derby.iapi.sql.ResultSet.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.

public boolean
private boolean
evaluateCheckConstraints()

Run check constraints against the current row.

pack-priv void
pack-priv void
public static boolean
foundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder)

protected ExecRow
getNextRowCore(NoPutResultSet
SourceResultSet Also look at Track#2432/change 12433
source
)

Overrides org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore.

Get next row from the source result set.

public NumberDataValue
getSetAutoincrementValue(int
position of the column in the table (1-based)
columnPosition
,
long
amount of increment.
increment
)

Overrides org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet.getSetAutoincrementValue.

getSetAutoincrementValue will get the autoincrement value of the columnPosition specified for the target table.

protected void
private void
private void
public void
open()

Implements org.apache.derby.iapi.sql.ResultSet.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.

public void
pack-priv void
pack-priv void
runChecker(boolean restrictCheckOnly)

pack-priv void
setup()

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

Set up the result set for use.

pack-priv void
Inherited from org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet:
firstExecuteSpecialHandlingAutoGengetAutoGeneratedKeysResultsetgetCompactRowsaveAIcacheInformationverifyAutoGeneratedRScolumnsList

Field Detail

baseRowReadListback to summary
private FormatableBitSet baseRowReadList
beforeUpdateCopyRequiredback to summary
pack-priv boolean beforeUpdateCopyRequired
checkGMback to summary
private GeneratedMethod checkGM
constantsback to summary
pack-priv UpdateConstantAction constants
deferredback to summary
pack-priv boolean deferred
deferredBaseCCback to summary
protected ConglomerateController deferredBaseCC
deferredBaseRowback to summary
private ExecRow deferredBaseRow
deferredChecksback to summary
private BackingStoreHashtable deferredChecks
deferredSparseRowback to summary
private ExecRow deferredSparseRow
deferredTempRowback to summary
private ExecRow deferredTempRow
deferredUniqueCCback to summary
protected ConglomerateController[] deferredUniqueCC
deferredUniqueCIDsback to summary
protected long[] deferredUniqueCIDs
deferredUniqueCreatedback to summary
protected boolean[] deferredUniqueCreated
deferredUniqueScansback to summary
protected ScanController[] deferredUniqueScans
deletedRowHolderback to summary
private TemporaryRowHolderImpl deletedRowHolder
fkInfoArrayback to summary
private FKInfo[] fkInfoArray
generationClausesback to summary
private GeneratedMethod generationClauses
heapConglomback to summary
private long heapConglom
insertedRowHolderback to summary
private TemporaryRowHolderImpl insertedRowHolder
lockModeback to summary
pack-priv int lockMode
newBaseRowback to summary
private ExecRow newBaseRow
numberOfBaseColumnsback to summary
private int numberOfBaseColumns
numOpensback to summary
private int numOpens
oldDeletedRowback to summary
private ExecRow oldDeletedRow
resultWidthback to summary
private int resultWidth
riCheckerback to summary
private RISetChecker riChecker
rowback to summary
private ExecRow row
rowChangerback to summary
private RowChanger rowChanger
savedSourceback to summary
pack-priv NoPutResultSet savedSource
tcback to summary
private TransactionController tc
triggerActivatorback to summary
private TriggerEventActivator triggerActivator
triggerInfoback to summary
private TriggerInfo triggerInfo
triggerResultDescriptionback to summary
private ResultDescription triggerResultDescription
updatingForeignKeyback to summary
private boolean updatingForeignKey
updatingReferencedKeyback to summary
private boolean updatingReferencedKey
violatingCheckConstraintsback to summary
private List<UUID> violatingCheckConstraints

Constructor Detail

UpdateResultSetback to summary
pack-priv UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation) throws StandardException
Parameters
source:NoPutResultSet

update rows come from source

generationClauses:GeneratedMethod

Generated method for computed generation clauses

checkGM:GeneratedMethod

Generated method for enforcing check constraints

activation:Activation

The activation

Exceptions
StandardException:
thrown on error
UpdateResultSetback to summary
pack-priv UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, int constantActionItem, int rsdItem) throws StandardException
Parameters
source:NoPutResultSet

update rows come from source

generationClauses:GeneratedMethod

Generated method for computed generation clauses

checkGM:GeneratedMethod

Generated method for enforcing check constraints

activation:Activation

Activation

constantActionItem:int

id of the update constant action saved object

rsdItem:int

id of the Result Description saved object

Exceptions
StandardException:
thrown on error
UpdateResultSetback to summary
pack-priv UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, ConstantAction passedInConstantAction, ResultDescription passedInRsd) throws StandardException
Parameters
source:NoPutResultSet

update rows come from source

generationClauses:GeneratedMethod

Generated method for computed generation clauses

checkGM:GeneratedMethod

Generated method for enforcing check constraints

Exceptions
StandardException:
thrown on error

Method Detail

checkStreamColsback to summary
private FormatableBitSet checkStreamCols()
cleanUpback to summary
public void cleanUp() throws StandardException

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

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

Tells the system to clean up on an error.

Annotations
@Override
Exceptions
StandardException:
Thrown on error
See Also
ResultSet#cleanUp
closeback to summary
public void close() throws StandardException

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

Doc from org.apache.derby.iapi.sql.ResultSet.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.

Annotations
@Override
Exceptions
StandardException:
Thrown on error.
collectAffectedRowsback to summary
public boolean collectAffectedRows() throws StandardException
evaluateCheckConstraintsback to summary
private boolean evaluateCheckConstraints() throws StandardException

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).

Exceptions
StandardException:
thrown on error
fireAfterTriggersback to summary
pack-priv void fireAfterTriggers() throws StandardException
fireBeforeTriggersback to summary
pack-priv void fireBeforeTriggers() throws StandardException
foundRowback to summary
public static boolean foundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder) throws StandardException
getNextRowCoreback to summary
protected ExecRow getNextRowCore(NoPutResultSet source) throws StandardException

Overrides org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore.

Doc from org.apache.derby.impl.sql.execute.DMLWriteResultSet.getNextRowCore.

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

Annotations
@Override
Exceptions
StandardException:
Standard error policy
getSetAutoincrementValueback to summary
public NumberDataValue getSetAutoincrementValue(int columnPosition, long increment) throws StandardException

Overrides org.apache.derby.impl.sql.execute.DMLWriteGeneratedColumnsResultSet.getSetAutoincrementValue.

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.

Parameters
columnPosition:int

position of the column in the table (1-based)

increment:long

amount of increment.

Exceptions
StandardException:
if anything goes wrong.
initializeAIcacheback to summary
protected void initializeAIcache(RowLocation[] rla) throws StandardException
notifyForUpdateCursorback to summary
private void notifyForUpdateCursor(DataValueDescriptor[] row, DataValueDescriptor[] newBaseRow, RowLocation rl, TableScanResultSet tableScan) throws StandardException
objectifyStreamback to summary
private void objectifyStream(ExecRow tempRow, FormatableBitSet streamCols) throws StandardException
openback to summary
public void open() throws StandardException

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

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

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.

Annotations
@Override
Exceptions
StandardException:
Standard Derby error policy
processMergeRowback to summary
private ExecRow processMergeRow(NoPutResultSet sourceRS, ExecRow row) throws StandardException

Special handling if this is an UPDATE action of a MERGE statement.

rememberConstraintback to summary
public void rememberConstraint(UUID cid) throws StandardException

Overrides org.apache.derby.impl.sql.execute.DMLWriteResultSet.rememberConstraint.

Annotations
@Override
rowChangerFinishback to summary
pack-priv void rowChangerFinish() throws StandardException
runCheckerback to summary
pack-priv void runChecker(boolean restrictCheckOnly) throws StandardException
setupback to summary
pack-priv void setup() throws StandardException

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

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

Set up the result set for use. Should always be called from open().

Annotations
@Override
Exceptions
StandardException:
Standard Derby error policy
updateDeferredRowsback to summary
pack-priv void updateDeferredRows() throws StandardException