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

java.lang.Object
  extended by org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
      extended by org.apache.derby.impl.sql.execute.NoPutResultSetImpl
          extended by org.apache.derby.impl.sql.execute.RowResultSet
All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource

 class RowResultSet
extends NoPutResultSetImpl
implements CursorResultSet

Takes a constant row value and returns it as a result set.

This class actually probably never underlies a select statement, but in case it might and because it has the same behavior as the ones that do, we have it implement CursorResultSet and give reasonable answers.


Field Summary
private  ExecRow cachedRow
           
private  boolean canCacheRow
           
private  boolean next
           
private  GeneratedMethod row
           
 int rowsReturned
           
 
Fields inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSet
 
Fields inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray
 
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST
 
Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE
 
Constructor Summary
RowResultSet(Activation activation, ExecRow constantRow, boolean canCacheRow, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
           
RowResultSet(Activation activation, GeneratedMethod row, boolean canCacheRow, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
           
 
Method Summary
 void close()
          Close needs to invalidate any dependent statements, if this is a cursor.
 ExecRow getCurrentRow()
          This is not used in positioned update and delete, so just return a null.
 ExecRow getNextRowCore()
          If open and not returned yet, returns the row after plugging the parameters into the expressions.
 RowLocation getRowLocation()
          This is not operating against a stored table, so it has no row location to report.
 long getTimeSpent(int type)
          Return the total amount of time spent in this ResultSet
 void openCore()
          Sets state to 'open'.
 
Methods inherited from class org.apache.derby.impl.sql.execute.NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsToClone, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, updateRow
 
Methods inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, cleanUp, dumpTimeStats, finish, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPointOfAttachment, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, reopenCore, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.derby.iapi.sql.ResultSet
checkRowPosition, cleanUp, clearCurrentRow, finish, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow
 

Field Detail

rowsReturned

public int rowsReturned

canCacheRow

private boolean canCacheRow

next

private boolean next

row

private GeneratedMethod row

cachedRow

private ExecRow cachedRow
Constructor Detail

RowResultSet

RowResultSet(Activation activation,
             GeneratedMethod row,
             boolean canCacheRow,
             int resultSetNumber,
             double optimizerEstimatedRowCount,
             double optimizerEstimatedCost)

RowResultSet

RowResultSet(Activation activation,
             ExecRow constantRow,
             boolean canCacheRow,
             int resultSetNumber,
             double optimizerEstimatedRowCount,
             double optimizerEstimatedCost)
Method Detail

openCore

public void openCore()
              throws StandardException
Sets state to 'open'.

Specified by:
openCore in interface NoPutResultSet
Throws:
StandardException - thrown if activation closed.

getNextRowCore

public ExecRow getNextRowCore()
                       throws StandardException
If open and not returned yet, returns the row after plugging the parameters into the expressions.

Specified by:
getNextRowCore in interface NoPutResultSet
Specified by:
getNextRowCore in class BasicNoPutResultSetImpl
Returns:
the next row in the result
Throws:
StandardException - thrown on failure.
See Also:
NoPutResultSet.getNextRowCore()

close

public void close()
           throws StandardException
Description copied from class: NoPutResultSetImpl
Close needs to invalidate any dependent statements, if this is a cursor. Must be called by any subclasses that override close().

Specified by:
close in interface ResultSet
Overrides:
close in class NoPutResultSetImpl
Throws:
StandardException - thrown on error
See Also:
ResultSet.close()

getTimeSpent

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

Specified by:
getTimeSpent in interface ResultSet
Parameters:
type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
Returns:
long The total amount of time spent (in milliseconds).

getRowLocation

public RowLocation getRowLocation()
This is not operating against a stored table, so it has no row location to report.

Specified by:
getRowLocation in interface CursorResultSet
Returns:
a null.
See Also:
CursorResultSet

getCurrentRow

public ExecRow getCurrentRow()
This is not used in positioned update and delete, so just return a null.

Specified by:
getCurrentRow in interface CursorResultSet
Returns:
a null.
See Also:
CursorResultSet

Built on Thu 2010-12-23 20:49:13+0000, from revision ???

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