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

pack-priv abstract Class JoinResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Known Direct Subclasses
org.apache.derby.impl.sql.execute.MergeJoinResultSet, org.apache.derby.impl.sql.execute.NestedLoopJoinResultSet
Imports
org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, org.apache.derby.iapi.sql.Activation, .ResultSet, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.loader.GeneratedMethod, org.apache.derby.iapi.types.RowLocation

Takes 2 NoPutResultSets and a join filter and returns the join's rows satisfying the filter as a result set.

Field Summary

Modifier and TypeField and Description
protected boolean
protected int
public NoPutResultSet
protected ExecRow
protected ExecRow
public boolean
public boolean
protected GeneratedMethod
public long
protected int
public NoPutResultSet
protected ExecRow
public int
public int
public int
pack-priv String
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
pack-priv
JoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
clearScanState()

Clear any private state that changes during scans.

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.

protected void
closeRight()

close the rightResultSet

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 ExecRow

Returns:

a null value.
getCurrentRow
()

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

A join is combining rows from two sources, so it should never be used in a positioned update or delete.

public RowLocation

Returns:

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

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

A join is combining rows from two sources, so it has no single row location to return; just return a null.

public void
protected void
openRight()

open the rightResultSet.

public void
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetNextRowFromRowSourcegetResultDescriptiongetValidColumnsisForUpdatemarkRowAsDeletedneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValueupdateRow

Field Detail

isRightOpenback to summary
protected boolean isRightOpen
leftNumColsback to summary
protected int leftNumCols
leftResultSetback to summary
public NoPutResultSet leftResultSet
leftRowback to summary
protected ExecRow leftRow
mergedRowback to summary
protected ExecRow mergedRow
notExistsRightSideback to summary
public boolean notExistsRightSide
oneRowRightSideback to summary
public boolean oneRowRightSide
restrictionback to summary
protected GeneratedMethod restriction
restrictionTimeback to summary
public long restrictionTime
rightNumColsback to summary
protected int rightNumCols
rightResultSetback to summary
public NoPutResultSet rightResultSet
rightRowback to summary
protected ExecRow rightRow
rowsReturnedback to summary
public int rowsReturned
rowsSeenLeftback to summary
public int rowsSeenLeft
rowsSeenRightback to summary
public int rowsSeenRight
userSuppliedOptimizerOverridesback to summary
pack-priv String userSuppliedOptimizerOverrides

Constructor Detail

JoinResultSetback to summary
pack-priv JoinResultSet(NoPutResultSet leftResultSet, int leftNumCols, NoPutResultSet rightResultSet, int rightNumCols, Activation activation, GeneratedMethod restriction, int resultSetNumber, boolean oneRowRightSide, boolean notExistsRightSide, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String userSuppliedOptimizerOverrides)

Method Detail

clearScanStateback to summary
pack-priv void clearScanState()

Clear any private state that changes during scans. This includes things like the last row seen, etc. THis does not include immutable things that are typically set up in the constructor.

This method is called on open()/close() and reopen()

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.

Warning

does not track close time, since it is expected to be called directly by its subclasses, and we don't want to skew the times

Exceptions
StandardException:
thrown on error
closeRightback to summary
protected void closeRight() throws StandardException

close the rightResultSet

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
getCurrentRowback to summary
public ExecRow getCurrentRow()

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

A join is combining rows from two sources, so it should never be used in a positioned update or delete.

Returns:ExecRow

a null value.

See Also
CursorResultSet
getRowLocationback to summary
public RowLocation getRowLocation()

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

A join is combining rows from two sources, so it has no single row location to return; just return a null.

Returns:RowLocation

the row location of the current cursor row.

See Also
CursorResultSet
openCoreback to summary
public void openCore() throws StandardException

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

open a scan on the join. For a join, this means: o Open the left ResultSet o Do a getNextRow() on the left ResultSet to establish a position and get "parameter values" for the right ResultSet.

Note

It is possible for the getNextRow() to return null, in which case there is no need to open the RightResultSet. We must remember this condition. o If the getNextRow() on the left ResultSet succeeded, then open() the right ResultSet. scan parameters are evaluated at each open, so there is probably some way of altering their values...

Exceptions
StandardException:
Thrown on error
openRightback to summary
protected void openRight() throws StandardException

open the rightResultSet. If already open, just reopen.

Exceptions
StandardException:
Thrown on error
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 a join.

Exceptions
StandardException:
thrown if cursor finished.