Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

org.apache.derby.impl.sql.execute
Class DeleteVTIResultSet  view DeleteVTIResultSet download DeleteVTIResultSet.java

java.lang.Object
  extended byorg.apache.derby.impl.sql.execute.NoRowsResultSetImpl
      extended byorg.apache.derby.impl.sql.execute.DMLWriteResultSet
          extended byorg.apache.derby.impl.sql.execute.DMLVTIResultSet
              extended byorg.apache.derby.impl.sql.execute.DeleteVTIResultSet
All Implemented Interfaces:
org.apache.derby.iapi.sql.ResultSet

public class DeleteVTIResultSet
extends DMLVTIResultSet

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
protected  org.apache.derby.iapi.sql.Activation activation
           
protected  int[] baseRowReadMap
           
protected  long beginExecutionTime
           
protected  long beginTime
           
protected  WriteCursorConstantAction constantAction
           
 UpdatableVTIConstantAction constants
           
protected  org.apache.derby.iapi.sql.execute.ExecRow deferredSparseRow
           
protected  long endExecutionTime
           
protected  long endTime
           
protected  boolean firstExecute
           
protected  org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo heapDCOCI
           
protected  java.lang.String indent
           
protected  org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo[] indexDCOCIs
           
 org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc
           
 org.apache.derby.iapi.sql.ResultDescription resultDescription
           
 org.apache.derby.iapi.sql.execute.ExecRow row
           
 int rowCount
           
private  TemporaryRowHolderImpl rowHolder
           
private  java.sql.ResultSet rs
           
 org.apache.derby.iapi.sql.execute.NoPutResultSet savedSource
           
protected  int sourceDepth
           
protected  org.apache.derby.iapi.sql.execute.NoPutResultSet sourceResultSet
           
protected  int[] streamStorableHeapColIds
           
protected  java.lang.String subIndent
           
protected  org.apache.derby.iapi.sql.execute.NoPutResultSet[] subqueryTrackingArray
           
 org.apache.derby.iapi.store.access.TransactionController tc
           
 
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
 
Constructor Summary
DeleteVTIResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet source, org.apache.derby.iapi.sql.Activation activation)
           
 
Method Summary
 boolean checkRowPosition(int isType)
          Determine if the cursor is before the first row in the result set.
 void cleanUp()
          Tells the system to clean up on an error.
 void close()
          No rows to return, does nothing
 boolean doesCommit()
          Does this ResultSet cause a commit or rollback.
static void evaluateACheckConstraint(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM, java.lang.String checkName, long heapConglom, org.apache.derby.iapi.sql.Activation activation)
          Run a check constraint against the current row.
static void evaluateCheckConstraints(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM, org.apache.derby.iapi.sql.Activation activation)
          Run check constraints against the current row.
 void finish()
          doesn't need to do anything, as no calls are made that need to be restricted once the result set is 'finished'.
 org.apache.derby.iapi.sql.execute.ExecRow getAbsoluteRow(int row)
          Returns the row at the absolute position from the query, and returns NULL when there is no such position.
 org.apache.derby.iapi.sql.ResultSet getAutoGeneratedKeysResultset()
          ResultSet for rows inserted into the table (contains auto-generated keys columns only)
 java.sql.Timestamp getBeginExecutionTimestamp()
          Get the Timestamp for the beginning of execution.
protected  long getCurrentTimeMillis()
          Return the current time in milliseconds, if DEBUG and RunTimeStats is on, else return 0.
 java.lang.String getCursorName()
          Return the cursor name, null in this case.
 java.sql.Timestamp getEndExecutionTimestamp()
          Get the Timestamp for the end of execution.
 long getExecuteTime()
          Get the execution time in milliseconds.
 org.apache.derby.iapi.sql.execute.ExecRow getFirstRow()
          Returns the first row from the query, and returns NULL when there are no rows.
(package private)  java.lang.String getIndexNameFromCID(long indexCID)
          get the index name given the conglomerate id of the index.
 org.apache.derby.iapi.sql.execute.ExecRow getLastRow()
          Returns the last row from the query, and returns NULL when there are no rows.
 org.apache.derby.iapi.sql.execute.ExecRow getNextRow()
          No rows to return, so throw an exception.
protected  org.apache.derby.iapi.sql.execute.ExecRow getNextRowCore(org.apache.derby.iapi.sql.execute.NoPutResultSet source)
          Get next row from the source result set.
 org.apache.derby.iapi.sql.execute.ExecRow getPreviousRow()
          Returns the previous row from the query, and returns NULL when there are no more previous rows.
 java.lang.String getQueryPlanText(int depth)
          RESOLVE - This method will go away once it is overloaded in all subclasses.
 org.apache.derby.iapi.sql.execute.ExecRow getRelativeRow(int row)
          Returns the row at the relative position from the current cursor position, and returns NULL when there is no such position.
 org.apache.derby.iapi.sql.ResultDescription getResultDescription()
          Returns the description of the inserted rows.
 int getRowNumber()
          Returns the row number of the current row.
 org.apache.derby.iapi.sql.execute.NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
          Get the subquery ResultSet tracking array from the top ResultSet.
 long getTimeSpent(int type)
          Return the total amount of time spent in this ResultSet
 java.sql.SQLWarning getWarnings()
          Return the set of warnings generated during the execution of this result set.
 boolean isClosed()
          Just report that it is always closed.
protected  org.apache.derby.iapi.sql.execute.ExecRow makeDeferredSparseRow(org.apache.derby.iapi.sql.execute.ExecRow deferredBaseRow, org.apache.derby.iapi.services.io.FormatableBitSet baseRowReadList, org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc)
          For deferred update, get a deferred sparse row based on the deferred non-sparse row.
 int modifiedRowCount()
          Returns zero.
 void open()
          Needs to be called before the result set will do anything.
protected  void openCore()
           
 boolean returnsRows()
          Returns FALSE
 org.apache.derby.iapi.sql.execute.ExecRow setAfterLastRow()
          Sets the current position to after the last row and returns NULL because there is no current row.
 org.apache.derby.iapi.sql.execute.ExecRow setBeforeFirstRow()
          Sets the current position to before the first row and returns NULL because there is no current row.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rs

private java.sql.ResultSet rs

rowHolder

private TemporaryRowHolderImpl rowHolder

sourceResultSet

protected org.apache.derby.iapi.sql.execute.NoPutResultSet sourceResultSet

savedSource

public org.apache.derby.iapi.sql.execute.NoPutResultSet savedSource

constants

public UpdatableVTIConstantAction constants

tc

public org.apache.derby.iapi.store.access.TransactionController tc

lcc

public org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc

resultDescription

public org.apache.derby.iapi.sql.ResultDescription resultDescription

firstExecute

protected boolean firstExecute

row

public org.apache.derby.iapi.sql.execute.ExecRow row

constantAction

protected WriteCursorConstantAction constantAction

baseRowReadMap

protected int[] baseRowReadMap

streamStorableHeapColIds

protected int[] streamStorableHeapColIds

deferredSparseRow

protected org.apache.derby.iapi.sql.execute.ExecRow deferredSparseRow

heapDCOCI

protected org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo heapDCOCI

indexDCOCIs

protected org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo[] indexDCOCIs

rowCount

public int rowCount

activation

protected final org.apache.derby.iapi.sql.Activation activation

subqueryTrackingArray

protected org.apache.derby.iapi.sql.execute.NoPutResultSet[] subqueryTrackingArray

indent

protected java.lang.String indent

subIndent

protected java.lang.String subIndent

sourceDepth

protected int sourceDepth

beginTime

protected long beginTime

endTime

protected long endTime

beginExecutionTime

protected long beginExecutionTime

endExecutionTime

protected long endExecutionTime
Constructor Detail

DeleteVTIResultSet

public DeleteVTIResultSet(org.apache.derby.iapi.sql.execute.NoPutResultSet source,
                          org.apache.derby.iapi.sql.Activation activation)
                   throws org.apache.derby.iapi.error.StandardException
Method Detail

openCore

protected void openCore()
                 throws org.apache.derby.iapi.error.StandardException
Specified by:
openCore in class DMLVTIResultSet

getResultDescription

public org.apache.derby.iapi.sql.ResultDescription getResultDescription()
Returns the description of the inserted rows. REVISIT: Do we want this to return NULL instead?

Specified by:
getResultDescription in interface org.apache.derby.iapi.sql.ResultSet
Overrides:
getResultDescription in class NoRowsResultSetImpl

open

public void open()
          throws org.apache.derby.iapi.error.StandardException
Description copied from interface: org.apache.derby.iapi.sql.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.


cleanUp

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


finish

public void finish()
            throws org.apache.derby.iapi.error.StandardException
Description copied from class: NoRowsResultSetImpl
doesn't need to do anything, as no calls are made that need to be restricted once the result set is 'finished'.

Specified by:
finish in interface org.apache.derby.iapi.sql.ResultSet
Overrides:
finish in class NoRowsResultSetImpl

modifiedRowCount

public final int modifiedRowCount()
Description copied from class: NoRowsResultSetImpl
Returns zero.

Specified by:
modifiedRowCount in interface org.apache.derby.iapi.sql.ResultSet
Overrides:
modifiedRowCount in class NoRowsResultSetImpl

getNextRowCore

protected org.apache.derby.iapi.sql.execute.ExecRow getNextRowCore(org.apache.derby.iapi.sql.execute.NoPutResultSet source)
                                                            throws org.apache.derby.iapi.error.StandardException
Get next row from the source result set.


makeDeferredSparseRow

protected org.apache.derby.iapi.sql.execute.ExecRow makeDeferredSparseRow(org.apache.derby.iapi.sql.execute.ExecRow deferredBaseRow,
                                                                          org.apache.derby.iapi.services.io.FormatableBitSet baseRowReadList,
                                                                          org.apache.derby.iapi.sql.conn.LanguageConnectionContext lcc)
                                                                   throws org.apache.derby.iapi.error.StandardException
For deferred update, get a deferred sparse row based on the deferred non-sparse row. Share the underlying columns. If there is no column bit map, make them the same row.


getIndexNameFromCID

java.lang.String getIndexNameFromCID(long indexCID)
get the index name given the conglomerate id of the index.


returnsRows

public final boolean returnsRows()
Returns FALSE

Specified by:
returnsRows in interface org.apache.derby.iapi.sql.ResultSet

getAbsoluteRow

public org.apache.derby.iapi.sql.execute.ExecRow getAbsoluteRow(int row)
                                                         throws org.apache.derby.iapi.error.StandardException
Returns the row at the absolute position from the query, and returns NULL when there is no such position. (Negative position means from the end of the result set.) Moving the cursor to an invalid position leaves the cursor positioned either before the first row (negative position) or after the last row (positive position). NOTE: An exception will be thrown on 0.

Specified by:
getAbsoluteRow in interface org.apache.derby.iapi.sql.ResultSet

getRelativeRow

public org.apache.derby.iapi.sql.execute.ExecRow getRelativeRow(int row)
                                                         throws org.apache.derby.iapi.error.StandardException
Returns the row at the relative position from the current cursor position, and returns NULL when there is no such position. (Negative position means toward the beginning of the result set.) Moving the cursor to an invalid position leaves the cursor positioned either before the first row (negative position) or after the last row (positive position). NOTE: 0 is valid. NOTE: An exception is thrown if the cursor is not currently positioned on a row.

Specified by:
getRelativeRow in interface org.apache.derby.iapi.sql.ResultSet

setBeforeFirstRow

public org.apache.derby.iapi.sql.execute.ExecRow setBeforeFirstRow()
                                                            throws org.apache.derby.iapi.error.StandardException
Sets the current position to before the first row and returns NULL because there is no current row.

Specified by:
setBeforeFirstRow in interface org.apache.derby.iapi.sql.ResultSet

getFirstRow

public org.apache.derby.iapi.sql.execute.ExecRow getFirstRow()
                                                      throws org.apache.derby.iapi.error.StandardException
Returns the first row from the query, and returns NULL when there are no rows.

Specified by:
getFirstRow in interface org.apache.derby.iapi.sql.ResultSet

getNextRow

public org.apache.derby.iapi.sql.execute.ExecRow getNextRow()
                                                     throws org.apache.derby.iapi.error.StandardException
No rows to return, so throw an exception.

Specified by:
getNextRow in interface org.apache.derby.iapi.sql.ResultSet

getPreviousRow

public org.apache.derby.iapi.sql.execute.ExecRow getPreviousRow()
                                                         throws org.apache.derby.iapi.error.StandardException
Returns the previous row from the query, and returns NULL when there are no more previous rows.

Specified by:
getPreviousRow in interface org.apache.derby.iapi.sql.ResultSet

getLastRow

public org.apache.derby.iapi.sql.execute.ExecRow getLastRow()
                                                     throws org.apache.derby.iapi.error.StandardException
Returns the last row from the query, and returns NULL when there are no rows.

Specified by:
getLastRow in interface org.apache.derby.iapi.sql.ResultSet

setAfterLastRow

public org.apache.derby.iapi.sql.execute.ExecRow setAfterLastRow()
                                                          throws org.apache.derby.iapi.error.StandardException
Sets the current position to after the last row and returns NULL because there is no current row.

Specified by:
setAfterLastRow in interface org.apache.derby.iapi.sql.ResultSet

checkRowPosition

public boolean checkRowPosition(int isType)
Determine if the cursor is before the first row in the result set.

Specified by:
checkRowPosition in interface org.apache.derby.iapi.sql.ResultSet

getRowNumber

public int getRowNumber()
Returns the row number of the current row. Row numbers start from 1 and go to 'n'. Corresponds to row numbering used to position current row in the result set (as per JDBC).

Specified by:
getRowNumber in interface org.apache.derby.iapi.sql.ResultSet

close

public void close()
           throws org.apache.derby.iapi.error.StandardException
No rows to return, does nothing

Specified by:
close in interface org.apache.derby.iapi.sql.ResultSet

isClosed

public boolean isClosed()
Just report that it is always closed. RESOLVE: if we don't report that we are closed, then we will wind up with a dependency problem when we send an invalidateFor on our own Statement. It will call lcc.verifyNoOpenResultSets(), which is really supposed to be verify that there are no read only result sets that are open.

Specified by:
isClosed in interface org.apache.derby.iapi.sql.ResultSet

getExecuteTime

public long getExecuteTime()
Get the execution time in milliseconds.

Specified by:
getExecuteTime in interface org.apache.derby.iapi.sql.ResultSet

getBeginExecutionTimestamp

public java.sql.Timestamp getBeginExecutionTimestamp()
Get the Timestamp for the beginning of execution.

Specified by:
getBeginExecutionTimestamp in interface org.apache.derby.iapi.sql.ResultSet

getEndExecutionTimestamp

public java.sql.Timestamp getEndExecutionTimestamp()
Get the Timestamp for the end of execution.

Specified by:
getEndExecutionTimestamp in interface org.apache.derby.iapi.sql.ResultSet

getQueryPlanText

public java.lang.String getQueryPlanText(int depth)
RESOLVE - This method will go away once it is overloaded in all subclasses. Return the query plan as a String.


getTimeSpent

public long getTimeSpent(int type)
Return the total amount of time spent in this ResultSet

Specified by:
getTimeSpent in interface org.apache.derby.iapi.sql.ResultSet

getSubqueryTrackingArray

public final org.apache.derby.iapi.sql.execute.NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
Description copied from interface: org.apache.derby.iapi.sql.ResultSet
Get the subquery ResultSet tracking array from the top ResultSet. (Used for tracking open subqueries when closing down on an error.)

Specified by:
getSubqueryTrackingArray in interface org.apache.derby.iapi.sql.ResultSet

getAutoGeneratedKeysResultset

public org.apache.derby.iapi.sql.ResultSet getAutoGeneratedKeysResultset()
Description copied from interface: org.apache.derby.iapi.sql.ResultSet
ResultSet for rows inserted into the table (contains auto-generated keys columns only)

Specified by:
getAutoGeneratedKeysResultset in interface org.apache.derby.iapi.sql.ResultSet

getCursorName

public java.lang.String getCursorName()
Return the cursor name, null in this case.

Specified by:
getCursorName in interface org.apache.derby.iapi.sql.ResultSet

getCurrentTimeMillis

protected final long getCurrentTimeMillis()
Return the current time in milliseconds, if DEBUG and RunTimeStats is on, else return 0. (Only pay price of system call if need to.)


evaluateACheckConstraint

public static void evaluateACheckConstraint(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM,
                                            java.lang.String checkName,
                                            long heapConglom,
                                            org.apache.derby.iapi.sql.Activation activation)
                                     throws org.apache.derby.iapi.error.StandardException
Run a check constraint against the current row. Raise an error if the check constraint is violated.


evaluateCheckConstraints

public static void evaluateCheckConstraints(org.apache.derby.iapi.services.loader.GeneratedMethod checkGM,
                                            org.apache.derby.iapi.sql.Activation activation)
                                     throws org.apache.derby.iapi.error.StandardException
Run check constraints against the current row. Raise an error if a check constraint is violated.


doesCommit

public boolean doesCommit()
Does this ResultSet cause a commit or rollback.


getWarnings

public java.sql.SQLWarning getWarnings()
Description copied from interface: org.apache.derby.iapi.sql.ResultSet
Return the set of warnings generated during the execution of this result set. The warnings are cleared once this call returns.

Specified by:
getWarnings in interface org.apache.derby.iapi.sql.ResultSet