Class ProjectRestrictResultSet
java.lang.Object
org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
org.apache.derby.impl.sql.execute.ProjectRestrictResultSet
- All Implemented Interfaces:
CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSource
Takes a table and a table filter and returns
the table's rows satisfying the filter as a result set.
-
Nested Class Summary
Nested classes/interfaces inherited from class BasicNoPutResultSetImpl
BasicNoPutResultSetImpl.FieldComparator -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate boolean[]Holds columns present more than once in the result set and which may be represented by a stream, since such columns need to be cloned.booleanprivate ExecRowprivate GeneratedMethodlongprivate int[]private ExecRowlongboolean(package private) Enumeration<Object> private booleanprivate boolean(package private) final NoPutResultSetprivate final UUIDprivate final booleanFields 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
ConstructorsConstructorDescriptionProjectRestrictResultSet(NoPutResultSet s, Activation a, GeneratedMethod r, GeneratedMethod p, int resultSetNumber, GeneratedMethod cr, int mapRefItem, int cloneMapItem, boolean reuseResult, boolean doesProjection, boolean validatingCheckConstraint, UUID validatingBaseTableUUID, double optimizerEstimatedRowCount, double optimizerEstimatedCost) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()If the result set has been opened, close the open scan.doBaseRowProjection(ExecRow sourceRow) Do the projection against the sourceRow.private ExecRowdoProjection(ExecRow sourceRow) Do the projection against the source row.voidfinish()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().int[]Get projection mapping array.Gets last row returned.Return the requested values computed from the next row (if any) for which the restriction evaluates to true.Gets information from its source.longgetTimeSpent(int type) Return the total amount of time spent in this ResultSetbooleanIs this ResultSet or it's source result set for updatevoidMarks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.voidopenCore()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...voidupdateRow(ExecRow row, RowChanger rowChanger) Updates the resultSet's current row with it's new values after an update has been issued either using positioned update or JDBC's udpateRow method.Methods inherited from class NoPutResultSetImpl
clearCurrentRow, clearOrderableCache, closeRowSource, getCursorName, getNextRowFromRowSource, getResultDescription, getValidColumns, needsRowLocation, needsRowLocationForDeferredCheckConstraints, needsToClone, offendingRowLocation, positionScanAtRowLocation, printQualifiers, resultSetNumber, rowLocation, setCurrentRow, setHasDeferrableChecks, setNeedsRowLocation, setTargetResultSet, skipRow, skipScan, unpackHashValueMethods inherited from class BasicNoPutResultSetImpl
addWarning, attachStatementContext, checkCancellationFlag, checkRowPosition, childrenToXML, cleanUp, dumpTimeStats, 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, isXplainOnlyMode, markAsTopResultSet, modifiedRowCount, open, recordConstructorTime, requiresRelocking, returnsRows, setAfterLastRow, setBeforeFirstRow, setCompactRow, setCompatRow, toXML, toXMLMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface ResultSet
addWarning, checkRowPosition, cleanUp, clearCurrentRow, getAbsoluteRow, getActivation, getAutoGeneratedKeysResultset, getBeginExecutionTimestamp, getCursorName, getEndExecutionTimestamp, getExecuteTime, getFirstRow, getLastRow, getNextRow, getPreviousRow, getRelativeRow, getResultDescription, getRowNumber, getSubqueryTrackingArray, getWarnings, isClosed, modifiedRowCount, open, returnsRows, setAfterLastRow, setBeforeFirstRow, toXML
-
Field Details
-
restrictionTime
public long restrictionTime -
projectionTime
public long projectionTime -
source
-
constantRestriction
-
restriction
-
doesProjection
public boolean doesProjection -
projection
-
projectMapping
private int[] projectMapping -
cloneMap
private boolean[] cloneMapHolds columns present more than once in the result set and which may be represented by a stream, since such columns need to be cloned. -
runTimeStatsOn
private boolean runTimeStatsOn -
mappedResultRow
-
reuseResult
public boolean reuseResult -
shortCircuitOpen
private boolean shortCircuitOpen -
projRow
-
validatingCheckConstraint
private final boolean validatingCheckConstraint -
validatingBaseTableUUID
-
rowLocations
Enumeration<Object> rowLocations
-
-
Constructor Details
-
ProjectRestrictResultSet
ProjectRestrictResultSet(NoPutResultSet s, Activation a, GeneratedMethod r, GeneratedMethod p, int resultSetNumber, GeneratedMethod cr, int mapRefItem, int cloneMapItem, boolean reuseResult, boolean doesProjection, boolean validatingCheckConstraint, UUID validatingBaseTableUUID, double optimizerEstimatedRowCount, double optimizerEstimatedCost) throws StandardException - Throws:
StandardException
-
-
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...- Specified by:
openCorein interfaceNoPutResultSet- 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 values computed from the next row (if any) for which the restriction evaluates to true.restriction and projection parameters are evaluated for each row.
- Specified by:
getNextRowCorein interfaceNoPutResultSet- Specified by:
getNextRowCorein classBasicNoPutResultSetImpl- Returns:
- the next row in the result
- Throws:
StandardException- thrown on failure.StandardException- ResultSetNotOpen thrown if not yet open.- See Also:
-
getTimeSpent
public long getTimeSpent(int type) Return the total amount of time spent in this ResultSet- Specified by:
getTimeSpentin interfaceResultSet- 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).
-
close
If the result set has been opened, close the open scan.- Specified by:
closein interfaceResultSet- Overrides:
closein classNoPutResultSetImpl- Throws:
StandardException- thrown on error
-
finish
Description copied from interface:ResultSetTells 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:
finishin interfaceResultSet- Overrides:
finishin classBasicNoPutResultSetImpl- Throws:
StandardException- on error
-
getRowLocation
Gets information from its source. We might want to have this take a CursorResultSet in its constructor some day, instead of doing a cast here?- Specified by:
getRowLocationin interfaceCursorResultSet- Returns:
- the row location of the current cursor row.
- Throws:
StandardException- thrown on failure.- See Also:
-
getCurrentRow
Gets last row returned.- Specified by:
getCurrentRowin interfaceCursorResultSet- Returns:
- the last row returned.
- Throws:
StandardException- thrown on failure.- See Also:
-
doProjection
Do the projection against the source row. Use reflection where necessary, otherwise get the source column into our result row.- Parameters:
sourceRow- The source row.- Returns:
- The result of the projection
- Throws:
StandardException- thrown on failure.
-
doBaseRowProjection
Do the projection against the sourceRow. If the source of the result set is of type ProjectRestrictResultSet, the projection by that result set will also be performed.- Parameters:
sourceRow- row to be projected- Returns:
- The result of the projection
- Throws:
StandardException- thrown on failure.
-
getBaseProjectMapping
public int[] getBaseProjectMapping()Get projection mapping array. The array consist of indexes which maps the column in a row array to another position in the row array. If the value is projected out of the row, the value is negative.- Returns:
- projection mapping array.
-
isForUpdate
public boolean isForUpdate()Is this ResultSet or it's source result set for update- Specified by:
isForUpdatein interfaceNoPutResultSet- Overrides:
isForUpdatein classNoPutResultSetImpl- Returns:
- Whether or not the result set is for update.
-
updateRow
Description copied from interface:NoPutResultSetUpdates the resultSet's current row with it's new values after an update has been issued either using positioned update or JDBC's udpateRow method.- Specified by:
updateRowin interfaceNoPutResultSet- Overrides:
updateRowin classNoPutResultSetImpl- Parameters:
row- new values for the currentRowrowChanger- holds information about row: what columns of it is to be used for updating, and what underlying base table column each such column corresponds to.- Throws:
StandardException- thrown on failure.- See Also:
-
markRowAsDeleted
Description copied from interface:NoPutResultSetMarks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.- Specified by:
markRowAsDeletedin interfaceNoPutResultSet- Overrides:
markRowAsDeletedin classNoPutResultSetImpl- Throws:
StandardException- thrown on failure.- See Also:
-