Top Description Fields Constructors Methods
org.apache.derby.impl.sql.execute

pack-priv Class ProjectRestrictResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Imports
java.util.Enumeration, org.apache.derby.catalog.UUID, org.apache.derby.catalog.types.ReferencedColumnsDescriptorImpl, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.sql.Activation, org.apache.derby.iapi.sql.conn.StatementContext, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, .RowChanger, org.apache.derby.iapi.types.DataValueDescriptor, .RowLocation, .SQLRef, org.apache.derby.shared.common.sanity.SanityManager

Takes a table and a table filter and returns the table's rows satisfying the filter as a result set.

Field Summary

Modifier and TypeField and Description
private boolean[]
cloneMap

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.

public GeneratedMethod
public boolean
private ExecRow
private GeneratedMethod
public long
private int[]
private ExecRow
public GeneratedMethod
public long
public boolean
pack-priv Enumeration<Object>
private boolean
private boolean
pack-priv final NoPutResultSet
private final UUID
private final boolean
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
pack-priv
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)

Method Summary

Modifier and TypeMethod and Description
public void
close()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

public ExecRow

Returns:

The result of the projection
doBaseRowProjection
(ExecRow
row to be projected
sourceRow
)

Do the projection against the sourceRow.

private ExecRow

Returns:

The result of the projection
doProjection
(ExecRow
The source row.
sourceRow
)

Do the projection against the source row.

public void
finish()

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finish.

Implements org.apache.derby.iapi.sql.ResultSet.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().

public int[]

Returns:

projection mapping array.
getBaseProjectMapping
()

Get projection mapping array.

public ExecRow

Returns:

the last row returned.
getCurrentRow
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Gets last row returned.

public ExecRow

Returns:

the next row in the result
getNextRowCore
()

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.getNextRowCore.

Return the requested values computed from the next row (if any) for which the restriction evaluates to true.

public RowLocation

Returns:

the row location of the current cursor row.
getRowLocation
()

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getRowLocation.

Gets information from its source.

public long

Returns:

long The total amount of time spent (in milliseconds).
getTimeSpent
(int
CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.
type
)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

public boolean

Returns:

Whether or not the result set is for update.
isForUpdate
()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.isForUpdate.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.isForUpdate.

Is this ResultSet or it's source result set for update

public void
markRowAsDeleted()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.markRowAsDeleted.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.

public void
public void
public void
updateRow(ExecRow
new values for the currentRow
row
,
RowChanger
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.
rowChanger
)

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.updateRow.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

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.

Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetNextRowFromRowSourcegetResultDescriptiongetValidColumnsneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValue

Field Detail

cloneMapback to summary
private boolean[] cloneMap

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.

constantRestrictionback to summary
public GeneratedMethod constantRestriction
doesProjectionback to summary
public boolean doesProjection
mappedResultRowback to summary
private ExecRow mappedResultRow
projectionback to summary
private GeneratedMethod projection
projectionTimeback to summary
public long projectionTime
projectMappingback to summary
private int[] projectMapping
projRowback to summary
private ExecRow projRow
restrictionback to summary
public GeneratedMethod restriction
restrictionTimeback to summary
public long restrictionTime
reuseResultback to summary
public boolean reuseResult
rowLocationsback to summary
pack-priv Enumeration<Object> rowLocations
runTimeStatsOnback to summary
private boolean runTimeStatsOn
shortCircuitOpenback to summary
private boolean shortCircuitOpen
sourceback to summary
pack-priv final NoPutResultSet source
validatingBaseTableUUIDback to summary
private final UUID validatingBaseTableUUID
validatingCheckConstraintback to summary
private final boolean validatingCheckConstraint

Constructor Detail

ProjectRestrictResultSetback to summary
pack-priv 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

Method Detail

closeback to summary
public void close() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.close.

Implements org.apache.derby.iapi.sql.ResultSet.close.

If the result set has been opened, close the open scan.

Exceptions
StandardException:
thrown on error
doBaseRowProjectionback to summary
public ExecRow doBaseRowProjection(ExecRow sourceRow) throws StandardException

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:ExecRow

row to be projected

Returns:ExecRow

The result of the projection

Exceptions
StandardException:
thrown on failure.
doProjectionback to summary
private ExecRow doProjection(ExecRow sourceRow) throws StandardException

Do the projection against the source row. Use reflection where necessary, otherwise get the source column into our result row.

Parameters
sourceRow:ExecRow

The source row.

Returns:ExecRow

The result of the projection

Exceptions
StandardException:
thrown on failure.
finishback to summary
public void finish() throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.finish.

Implements org.apache.derby.iapi.sql.ResultSet.finish.

Doc from org.apache.derby.iapi.sql.ResultSet.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(). Will close the result set if it is not already closed.

Exceptions
StandardException:
on error
getBaseProjectMappingback to summary
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:int[]

projection mapping array.

getCurrentRowback to summary
public ExecRow getCurrentRow() throws StandardException

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.getCurrentRow.

Gets last row returned.

Returns:ExecRow

the last row returned.

Exceptions
StandardException:
thrown on failure.
See Also
CursorResultSet
getNextRowCoreback to summary
public ExecRow getNextRowCore() throws StandardException

Implements abstract org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.getNextRowCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.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.

Returns:ExecRow

the next row in the result

Exceptions
StandardException:
  • thrown on failure.
  • ResultSetNotOpen thrown if not yet open.
getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

Implements org.apache.derby.iapi.sql.execute.CursorResultSet.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?

Returns:RowLocation

the row location of the current cursor row.

Exceptions
StandardException:
thrown on failure.
See Also
CursorResultSet
getTimeSpentback to summary
public long getTimeSpent(int type)

Implements org.apache.derby.iapi.sql.ResultSet.getTimeSpent.

Return the total amount of time spent in this ResultSet

Parameters
type:int

CURRENT_RESULTSET_ONLY - time spent only in this ResultSet ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.

Returns:long

long The total amount of time spent (in milliseconds).

isForUpdateback to summary
public boolean isForUpdate()

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.isForUpdate.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.isForUpdate.

Is this ResultSet or it's source result set for update

Returns:boolean

Whether or not the result set is for update.

markRowAsDeletedback to summary
public void markRowAsDeleted() throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.markRowAsDeleted.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.markRowAsDeleted.

Marks the resultSet's currentRow as deleted after a delete has been issued by either by using positioned delete or JDBC's deleteRow method.

Exceptions
StandardException:
thrown on failure.
See Also
NoPutResultSet#markRowAsDeleted
openCoreback to summary
public void openCore() throws StandardException

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.openCore.

open a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown if cursor finished.
reopenCoreback to summary
public void reopenCore() throws StandardException

Overrides org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl.reopenCore.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.reopenCore.

reopen a scan on the table. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
thrown if cursor finished.
updateRowback to summary
public void updateRow(ExecRow row, RowChanger rowChanger) throws StandardException

Overrides org.apache.derby.impl.sql.execute.NoPutResultSetImpl.updateRow.

Implements org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

Doc from org.apache.derby.iapi.sql.execute.NoPutResultSet.updateRow.

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.

Parameters
row:ExecRow

new values for the currentRow

rowChanger:RowChanger

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.

Exceptions
StandardException:
thrown on failure.
See Also
NoPutResultSet#updateRow