org.apache.derby.impl.sql.execute
Class UpdateResultSet

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
      extended by org.apache.derby.impl.sql.execute.DMLWriteResultSet
          extended by org.apache.derby.impl.sql.execute.UpdateResultSet
All Implemented Interfaces:
ResultSet

 class UpdateResultSet
extends DMLWriteResultSet

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
private  FormatableBitSet baseRowReadList
           
(package private)  boolean beforeUpdateCopyRequired
           
private  GeneratedMethod checkGM
           
(package private)  UpdateConstantAction constants
           
(package private)  boolean deferred
           
protected  ConglomerateController deferredBaseCC
           
private  ExecRow deferredBaseRow
           
private  ExecRow deferredSparseRow
           
private  ExecRow deferredTempRow
           
protected  ConglomerateController[] deferredUniqueCC
           
protected  long[] deferredUniqueCIDs
           
protected  boolean[] deferredUniqueCreated
           
protected  ScanController[] deferredUniqueScans
           
private  TemporaryRowHolderImpl deletedRowHolder
           
private  FKInfo[] fkInfoArray
           
private  GeneratedMethod generationClauses
           
private  long heapConglom
           
private  TemporaryRowHolderImpl insertedRowHolder
           
(package private)  int lockMode
           
private  ExecRow newBaseRow
           
private  int numberOfBaseColumns
           
private  int numOpens
           
private  ExecRow oldDeletedRow
           
private  ResultDescription resultDescription
           
private  int resultWidth
           
private  RISetChecker riChecker
           
private  ExecRow row
           
private  RowChanger rowChanger
           
(package private)  NoPutResultSet savedSource
           
private  NoPutResultSet source
           
private  TransactionController tc
           
private  TriggerEventActivator triggerActivator
           
private  TriggerInfo triggerInfo
           
private  ResultDescription triggerResultDescription
           
private  boolean updatingForeignKey
           
private  boolean updatingReferencedKey
           
 
Fields inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
baseRowReadMap, constantAction, heapDCOCI, indexDCOCIs, 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
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation)
           
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, ConstantAction passedInConstantAction, ResultDescription passedInRsd)
           
UpdateResultSet(NoPutResultSet source, GeneratedMethod generationClauses, GeneratedMethod checkGM, Activation activation, int constantActionItem, int rsdItem)
           
 
Method Summary
private  FormatableBitSet checkStreamCols()
           
 void cleanUp()
          Tells the system to clean up on an error.
 boolean collectAffectedRows()
           
(package private)  void fireAfterTriggers()
           
(package private)  void fireBeforeTriggers()
           
static boolean foundRow(ExecRow checkRow, int[] colsToCheck, TemporaryRowHolderImpl rowHolder)
           
 ResultDescription getResultDescription()
          Returns the description of the updated rows.
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.
(package private)  void rowChangerFinish()
           
(package private)  void runChecker(boolean restrictCheckOnly)
           
private  void saveLastCusorKey(TableScanResultSet tableScan, ExecRow aRow)
           
(package private)  void setup()
          Set up the result set for use.
(package private)  void updateDeferredRows()
           
 
Methods inherited from class org.apache.derby.impl.sql.execute.DMLWriteResultSet
decodeLockMode, getIndexNameFromCID, getNextRowCore, makeDeferredSparseRow, modifiedRowCount
 
Methods inherited from class org.apache.derby.impl.sql.execute.NoRowsResultSetImpl
checkRowPosition, clearCurrentRow, close, doesCommit, evaluateACheckConstraint, evaluateCheckConstraints, evaluateGenerationClauses, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCurrentTimeMillis, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getQueryPlanText, getRelativeRow, getRowNumber, getSubqueryTrackingArray, getTimeSpent, getWarnings, isClosed, returnsRows, setAfterLastRow, setBeforeFirstRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

tc

private TransactionController tc

newBaseRow

private ExecRow newBaseRow

row

private ExecRow row

deferredSparseRow

private ExecRow deferredSparseRow

constants

UpdateConstantAction constants

resultDescription

private ResultDescription resultDescription

source

private NoPutResultSet source

savedSource

NoPutResultSet savedSource

rowChanger

private RowChanger rowChanger

deferredBaseCC

protected ConglomerateController deferredBaseCC

deferredUniqueCIDs

protected long[] deferredUniqueCIDs

deferredUniqueCreated

protected boolean[] deferredUniqueCreated

deferredUniqueCC

protected ConglomerateController[] deferredUniqueCC

deferredUniqueScans

protected ScanController[] deferredUniqueScans

deletedRowHolder

private TemporaryRowHolderImpl deletedRowHolder

insertedRowHolder

private TemporaryRowHolderImpl insertedRowHolder

riChecker

private RISetChecker riChecker

triggerInfo

private TriggerInfo triggerInfo

triggerActivator

private TriggerEventActivator triggerActivator

updatingReferencedKey

private boolean updatingReferencedKey

updatingForeignKey

private boolean updatingForeignKey

numOpens

private int numOpens

heapConglom

private long heapConglom

fkInfoArray

private FKInfo[] fkInfoArray

baseRowReadList

private FormatableBitSet baseRowReadList

generationClauses

private GeneratedMethod generationClauses

checkGM

private GeneratedMethod checkGM

resultWidth

private int resultWidth

numberOfBaseColumns

private int numberOfBaseColumns

deferredTempRow

private ExecRow deferredTempRow

deferredBaseRow

private ExecRow deferredBaseRow

oldDeletedRow

private ExecRow oldDeletedRow

triggerResultDescription

private ResultDescription triggerResultDescription

lockMode

int lockMode

deferred

boolean deferred

beforeUpdateCopyRequired

boolean beforeUpdateCopyRequired
Constructor Detail

UpdateResultSet

UpdateResultSet(NoPutResultSet source,
                GeneratedMethod generationClauses,
                GeneratedMethod checkGM,
                Activation activation)
          throws StandardException
Parameters:
source - update rows come from source
generationClauses - Generated method for computed generation clauses
checkGM - Generated method for enforcing check constraints
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 source
generationClauses - Generated method for computed generation clauses
checkGM - Generated method for enforcing check constraints
activation - Activation
constantActionItem - id of the update constant action saved objec
rsdItem - 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 source
generationClauses - Generated method for computed generation clauses
checkGM - Generated method for enforcing check constraints
Throws:
StandardException - thrown on error
Method Detail

getResultDescription

public ResultDescription getResultDescription()
Returns the description of the updated rows. REVISIT: Do we want this to return NULL instead?

Specified by:
getResultDescription in interface ResultSet
Overrides:
getResultDescription in class NoRowsResultSetImpl
Returns:
A ResultDescription describing the results of the statement.

open

public void open()
          throws StandardException
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

void setup()
     throws StandardException
Description copied from class: NoRowsResultSetImpl
Set up the result set for use. Should always be called from open().

Overrides:
setup in class NoRowsResultSetImpl
Throws:
StandardException - Standard Derby error policy

checkStreamCols

private FormatableBitSet checkStreamCols()

objectifyStream

private void objectifyStream(ExecRow tempRow,
                             FormatableBitSet streamCols)
                      throws StandardException
Throws:
StandardException

collectAffectedRows

public boolean collectAffectedRows()
                            throws StandardException
Throws:
StandardException

notifyForUpdateCursor

private void notifyForUpdateCursor(DataValueDescriptor[] row,
                                   DataValueDescriptor[] newBaseRow,
                                   RowLocation rl,
                                   TableScanResultSet tableScan)
                            throws StandardException
Throws:
StandardException

saveLastCusorKey

private void saveLastCusorKey(TableScanResultSet tableScan,
                              ExecRow aRow)
                       throws StandardException
Throws:
StandardException

fireBeforeTriggers

void fireBeforeTriggers()
                  throws StandardException
Throws:
StandardException

fireAfterTriggers

void fireAfterTriggers()
                 throws StandardException
Throws:
StandardException

updateDeferredRows

void updateDeferredRows()
                  throws StandardException
Throws:
StandardException

runChecker

void runChecker(boolean restrictCheckOnly)
          throws StandardException
Throws:
StandardException

foundRow

public static boolean foundRow(ExecRow checkRow,
                               int[] colsToCheck,
                               TemporaryRowHolderImpl rowHolder)
                        throws StandardException
Throws:
StandardException

cleanUp

public void cleanUp()
             throws StandardException
Description copied from interface: ResultSet
Tells the system to clean up on an error.

Throws:
StandardException - Thrown on error
See Also:
ResultSet.cleanUp()

rowChangerFinish

void rowChangerFinish()
                throws StandardException
Throws:
StandardException

Built on Thu 2012-03-29 21:53:33+0000, from revision ???

Apache Derby V10.6 Internals - Copyright © 2004,2007 The Apache Software Foundation. All Rights Reserved.