Class OnceResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.OnceResultSet
- All Implemented Interfaces:
NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
Takes an expression subquery's result set and verifies that only
a single scalar value is being returned.
NOTE: A row with a single column containing null will be returned from
getNextRow() if the underlying subquery ResultSet is empty.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intstatic final intprivate GeneratedMethodstatic final intintprivate ExecRowprivate StatementContextintstatic final intFields inherited from class NoPutResultSetImpl
checkNullCols, clonedExecRow, cncLen, resultSetNumber, targetResultSetFields inherited from class BasicNoPutResultSetImpl
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArrayFields inherited from interface NoPutResultSet
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBERFields inherited from interface ResultSet
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST -
Constructor Summary
ConstructorsConstructorDescriptionOnceResultSet(NoPutResultSet s, Activation a, GeneratedMethod emptyRowFun, int cardinalityCheck, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If the result set has been opened, close the open scan.Return the requested value computed from the next row.intReturn the point of attachment for this subquery.longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetvoidopenCore()open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...voidreopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...Methods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, isForUpdate, markRowAsDeleted, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValue, updateRowMethods inherited from class BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, finish, finishAndRTS, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCompactRow, getCurrentTimeMillis, getElapsedMillis, getEndExecutionTimestamp, getEstimatedRowCount, getExecuteTime, getExecutionFactory, getFirstRow, getLanguageConnectionContext, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getRowNumber, getScanIsolationLevel, getSubqueryTrackingArray, getTransactionController, getWarnings, isClosed, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXML
-
Field Details
-
DO_CARDINALITY_CHECK
public static final int DO_CARDINALITY_CHECK- See Also:
-
NO_CARDINALITY_CHECK
public static final int NO_CARDINALITY_CHECK- See Also:
-
UNIQUE_CARDINALITY_CHECK
public static final int UNIQUE_CARDINALITY_CHECK- See Also:
-
rowWithNulls
-
statementContext
-
source
-
emptyRowFun
-
cardinalityCheck
private int cardinalityCheck -
subqueryNumber
public int subqueryNumber -
pointOfAttachment
public int pointOfAttachment
-
-
Constructor Details
-
OnceResultSet
public OnceResultSet(NoPutResultSet s, Activation a, GeneratedMethod emptyRowFun, int cardinalityCheck, int resultSetNumber, int subqueryNumber, int pointOfAttachment, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
-
-
Method Details
-
openCore
open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Throws:
StandardException- thrown if cursor finished.
-
reopenCore
reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...- Specified by:
reopenCorein interfaceNoPutResultSet- Overrides:
reopenCorein classBasicNoPutResultSetImpl- Throws:
StandardException- thrown if cursor finished.- See Also:
-
getNextRowCore
Return the requested value computed from the next row.- Specified by:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein classBasicNoPutResultSetImpl- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure. StandardException ScalarSubqueryCardinalityViolation Thrown if scalar subquery returns more than 1 row.- See Also:
-
close
If the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classNoPutResultSetImpl- Throws:
StandardException- thrown on error
-
getPointOfAttachment
public int getPointOfAttachment()Description copied from interface:NoPutResultSetReturn the point of attachment for this subquery. (Only meaningful for Any and Once ResultSets, which can and will only be at the top of a ResultSet for a subquery.)- Specified by:
getPointOfAttachmentin interfaceNoPutResultSet- Overrides:
getPointOfAttachmentin classBasicNoPutResultSetImpl- Returns:
- int Point of attachment (result set number) for this subquery. (-1 if not a subquery - also Sanity violation)
- See Also:
-
getTimeSpent
public long getTimeSpent(int type) Return the total amount of time spent in this 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).
-