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

pack-priv Class UnionResultSet

extends NoPutResultSetImpl
implements CursorResultSet
Class Inheritance
All Implemented Interfaces
org.apache.derby.iapi.sql.execute.CursorResultSet, org.apache.derby.iapi.sql.ResultSet
Imports
org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.sql.execute.CursorResultSet, .ExecRow, .NoPutResultSet, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.Activation, .ResultDescription, org.apache.derby.iapi.types.RowLocation

Takes two result sets and returns their union (all). (Any duplicate elimination is performed above this ResultSet.)

Field Summary

Modifier and TypeField and Description
public int
public int
public int
public NoPutResultSet
private int
public NoPutResultSet
private int
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
checkNullColsclonedExecRowcncLenresultSetNumbertargetResultSet

Constructor Summary

AccessConstructor and Description
public
UnionResultSet(NoPutResultSet source1, NoPutResultSet source2, Activation activation, int resultSetNumber, 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 currently open source.

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:

the current row.
getCurrentRow
()

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

A union has a single underlying row at a time, although from one of several sources.

public ExecRow
getNextRowCore()

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

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

If there are rows still on the first source, return the next one; otherwise, switch to the second source and return a row from there.

public ResultDescription
public RowLocation

Returns:

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

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

A union has a single underlying row at a time, although from one of several sources.

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 void
Inherited from org.apache.derby.impl.sql.execute.NoPutResultSetImpl:
clearCurrentRowclearOrderableCachecloseRowSourcegetCursorNamegetNextRowFromRowSourcegetValidColumnsisForUpdatemarkRowAsDeletedneedsRowLocationneedsRowLocationForDeferredCheckConstraintsneedsToCloneoffendingRowLocationpositionScanAtRowLocationprintQualifiersresultSetNumberrowLocationsetCurrentRowsetHasDeferrableCheckssetNeedsRowLocationsetTargetResultSetskipRowskipScanunpackHashValueupdateRow

Field Detail

rowsReturnedback to summary
public int rowsReturned
rowsSeenLeftback to summary
public int rowsSeenLeft
rowsSeenRightback to summary
public int rowsSeenRight
source1back to summary
public NoPutResultSet source1
source1FinalRowCountback to summary
private int source1FinalRowCount
source2back to summary
public NoPutResultSet source2
whichSourceback to summary
private int whichSource

Constructor Detail

UnionResultSetback to summary
public UnionResultSet(NoPutResultSet source1, NoPutResultSet source2, Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)

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 currently open source.

Exceptions
StandardException:
thrown on error
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() throws StandardException

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

A union has a single underlying row at a time, although from one of several sources.

Returns:ExecRow

the current row.

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.

If there are rows still on the first source, return the next one; otherwise, switch to the second source and return a row from there.

Returns:ExecRow

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

the next row in the result

Exceptions
StandardException:
thrown on failure
getResultDescriptionback to summary
public ResultDescription getResultDescription()

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

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

Returns the description of the first source. Assumes the compiler ensured both sources had the same description.

Returns:ResultDescription

Doc from org.apache.derby.iapi.sql.ResultSet.getResultDescription.

A ResultDescription describing the results of the statement.

getRowLocationback to summary
public RowLocation getRowLocation() throws StandardException

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

A union has a single underlying row at a time, although from one of several sources.

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).

openCoreback to summary
public void openCore() throws StandardException

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

open the first source.

Exceptions
StandardException:
thrown on failure