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

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.DeleteResultSet
All Implemented Interfaces:
ResultSet
Direct Known Subclasses:
DeleteCascadeResultSet

 class DeleteResultSet
extends DMLWriteResultSet

Delete 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 insert plan.


Field Summary
private  FormatableBitSet baseRowReadList
           
protected  boolean cascadeDelete
           
(package private)  DeleteConstantAction constants
           
protected  ConglomerateController deferredBaseCC
           
(package private)  ExecRow deferredBaseRow
           
(package private)  ExecRow deferredRLRow
           
(package private)  ExecRow deferredSparseRow
           
private  boolean firstExecute
           
private  RISetChecker fkChecker
           
protected  FKInfo[] fkInfoArray
           
(package private)  int lockMode
           
private  boolean noTriggersOrFks
           
(package private)  int numberOfBaseColumns
           
(package private)  int numIndexes
           
private  int numOpens
           
protected  RowChanger rc
           
protected  ResultDescription resultDescription
           
private  int rlColumnNumber
           
private  ExecRow row
           
protected  TemporaryRowHolderImpl rowHolder
           
(package private)  NoPutResultSet savedSource
           
protected  NoPutResultSet source
           
private  TransactionController tc
           
private  TriggerEventActivator triggerActivator
           
private  TriggerInfo triggerInfo
           
 
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
DeleteResultSet(NoPutResultSet source, Activation activation)
           
DeleteResultSet(NoPutResultSet source, ConstantAction passedInConstantAction, Activation activation)
          REMIND: At present this takes just the conglomerate id of the table.
 
Method Summary
 void cleanUp()
          Tells the system to clean up on an error.
(package private)  boolean collectAffectedRows()
           
(package private)  NoPutResultSet createDependentSource(RowChanger rc)
          create a source for the dependent table Delete Cascade ResultSet class will override this method.
(package private)  void deleteDeferredRows()
           
 void finish()
          Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open().
(package private)  void fireAfterTriggers()
           
(package private)  void fireBeforeTriggers()
           
 ResultDescription getResultDescription()
          Returns the description of the deleted rows.
 void open()
          Needs to be called before the result set will do anything.
(package private)  void runFkChecker(boolean restrictCheckOnly)
           
(package private)  void setup()
          Set up the result set for use.
 
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, 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

constants

DeleteConstantAction constants

resultDescription

protected ResultDescription resultDescription

source

protected NoPutResultSet source

savedSource

NoPutResultSet savedSource

numIndexes

int numIndexes

rc

protected RowChanger rc

row

private ExecRow row

deferredBaseCC

protected ConglomerateController deferredBaseCC

rowHolder

protected TemporaryRowHolderImpl rowHolder

numOpens

private int numOpens

firstExecute

private boolean firstExecute

baseRowReadList

private FormatableBitSet baseRowReadList

rlColumnNumber

private int rlColumnNumber

fkInfoArray

protected FKInfo[] fkInfoArray

triggerInfo

private TriggerInfo triggerInfo

fkChecker

private RISetChecker fkChecker

triggerActivator

private TriggerEventActivator triggerActivator

noTriggersOrFks

private boolean noTriggersOrFks

deferredSparseRow

ExecRow deferredSparseRow

deferredBaseRow

ExecRow deferredBaseRow

lockMode

int lockMode

cascadeDelete

protected boolean cascadeDelete

deferredRLRow

ExecRow deferredRLRow

numberOfBaseColumns

int numberOfBaseColumns
Constructor Detail

DeleteResultSet

DeleteResultSet(NoPutResultSet source,
                Activation activation)
          throws StandardException
Throws:
StandardException

DeleteResultSet

DeleteResultSet(NoPutResultSet source,
                ConstantAction passedInConstantAction,
                Activation activation)
          throws StandardException
REMIND: At present this takes just the conglomerate id of the table. We can expect this to expand to include passing information about triggers, constraints, and any additional conglomerates on the underlying table for access methods.

Throws:
StandardException - Thrown on error
Method Detail

getResultDescription

public ResultDescription getResultDescription()
Returns the description of the deleted 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 - thrown on error

collectAffectedRows

boolean collectAffectedRows()
                      throws StandardException
Throws:
StandardException

fireBeforeTriggers

void fireBeforeTriggers()
                  throws StandardException
Throws:
StandardException

fireAfterTriggers

void fireAfterTriggers()
                 throws StandardException
Throws:
StandardException

deleteDeferredRows

void deleteDeferredRows()
                  throws StandardException
Throws:
StandardException

runFkChecker

void runFkChecker(boolean restrictCheckOnly)
            throws StandardException
Throws:
StandardException

createDependentSource

NoPutResultSet createDependentSource(RowChanger rc)
                               throws StandardException
create a source for the dependent table

Delete Cascade ResultSet class will override this method.

Throws:
StandardException - Thrown on error

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

finish

public void finish()
            throws StandardException
Description copied from interface: ResultSet
Tells the system that there will be no more access to any database information via this result set; in particular, no more calls to open(). Will close the result set if it is not already closed.

Specified by:
finish in interface ResultSet
Overrides:
finish in class NoRowsResultSetImpl
Throws:
StandardException - on error

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.