| java.lang.Object org.apache.derby.impl.sql.execute.TemporaryRowHolderResultSet
TemporaryRowHolderResultSet | class TemporaryRowHolderResultSet implements CursorResultSet,NoPutResultSet,Cloneable(Code) | | A result set to scan temporary row holders. Ultimately, this
may be returned to users, hence the extra junk from the ResultSet
interface.
author: jamie |
Constructor Summary | |
public | TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, TemporaryRowHolderImpl holder) | public | TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, boolean isAppendable, long positionIndexConglomId, TemporaryRowHolderImpl holder) |
Method Summary | |
public boolean | checkRowPosition(int isType) Determine if the cursor is before the first row in the result
set. | public void | cleanUp() Tells the system to clean up on an error. | public void | clearCurrentRow() | public Object | clone() Shallow clone this result set. | public void | close() | public void | closeRowSource() closeRowSource tells the RowSource that it will no longer need to
return any rows and it can release any resource it may have.
Subsequent call to any method on the RowSource will result in undefined
behavior. | public void | deleteCurrentRow() | public void | 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 | getAbsoluteRow(int row) Returns the row at the absolute position from the query,
and returns NULL when there is no such position. | final public Activation | getActivation() Return the Activation for this result set. | public ResultSet | getAutoGeneratedKeysResultset() | public Timestamp | getBeginExecutionTimestamp() Get the Timestamp for the beginning of execution. | public ExecRow | getCurrentRow() This result set has its row from the last fetch done. | public String | getCursorName() Returns the name of the cursor, if this is cursor statement of some
type (declare, open, fetch, positioned update, positioned delete,
close).
A String with the name of the cursor, if any. | public Timestamp | getEndExecutionTimestamp() Get the Timestamp for the end of execution. | public double | getEstimatedRowCount() Get the estimated row count from this result set. | public long | getExecuteTime() Get the execution time in milliseconds. | public ExecRow | getFirstRow() Returns the first row from the query, and returns NULL when there
are no rows. | public ExecRow | getLastRow() Returns the last row from the query, and returns NULL when there
are no rows. | public static TemporaryRowHolderResultSet | getNewRSOnCurrentRow(Activation activation, CursorResultSet rs) Whip up a new Temp ResultSet that has a single
row, the current row of this result set. | public ExecRow | getNextRow() Returns the next row from the query, and returns NULL when there
are no more rows. | public ExecRow | getNextRowCore() Get the next row. | public DataValueDescriptor[] | getNextRowFromRowSource() Get the next row as an array of column objects. | public int | getPointOfAttachment() Return 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.)
int Point of attachment (result set number) for thissubquery. | public ExecRow | getPreviousRow() Returns the previous row from the query, and returns NULL when there
are no more previous rows. | public ExecRow | getRelativeRow(int row) Returns the row at the relative position from the current
cursor position, and returns NULL when there is no such position. | public ResultDescription | getResultDescription() Returns a ResultDescription object, which describes the results
of the statement this ResultSet is in. | public RowLocation | getRowLocation() Returns the row location of the current base table row of the cursor.
If this cursor's row is composed of multiple base tables' rows,
i.e. | public int | getRowNumber() Returns the row number of the current row. | public int | getScanIsolationLevel() Return the isolation level of the scan in the result set. | public NoPutResultSet[] | getSubqueryTrackingArray(int numSubqueries) Get the subquery ResultSet tracking array from the top ResultSet. | 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 ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. | public FormatableBitSet | getValidColumns() getValidColumns describes the DataValueDescriptor[] returned by all
calls to the getNextRowFromRowSource() call. | public java.sql.SQLWarning | getWarnings() | public boolean | isClosed() Find out if the ResultSet is closed or not. | public boolean | isForUpdate() | public void | markAsTopResultSet() Mark the ResultSet as the topmost one in the ResultSet tree. | public void | markRowAsDeleted() | public int | modifiedRowCount() | public boolean | needsRowLocation() needsRowLocation returns true iff this the row source expects the
drainer of the row source to call rowLocation after getting a row from
getNextRowFromRowSource. | public boolean | needsToClone() Does the caller of getNextRowFromRowSource() need to clone the row
in order to keep a reference to the row past the
getNextRowFromRowSource() call which returned the row. | public void | open() Tells the system that there will be calls to getNextRow(). | public void | openCore() Open the scan and evaluate qualifiers and the like. | public void | positionScanAtRowLocation(RowLocation rl) | public void | reStartScan(long currentConglomId, long pconglomId) | public void | reopenCore() Reopen the scan. | public boolean | requiresRelocking() | public void | reset(ExecRow[] rowArray) | public int | resultSetNumber() Get the number of this ResultSet, which is guaranteed to be unique
within a statement. | public boolean | returnsRows() Returns TRUE if the statement returns rows (i.e. | public void | rowLocation(RowLocation rl) rowLocation is a callback for the drainer of the row source to return
the rowLocation of the current row, i.e, the row that is being returned
by getNextRowFromRowSource. | public ExecRow | setAfterLastRow() Sets the current position to after the last row and returns NULL
because there is no current row. | public ExecRow | setBeforeFirstRow() Sets the current position to before the first row and returns NULL
because there is no current row. | public void | setCurrentRow(ExecRow row) Set the current row to the row passed in. | public void | setNeedsRowLocation(boolean needsRowLocation) Set whether or not the NPRS need the row location when acting
as a row source. | public void | setTargetResultSet(TargetResultSet trs) Notify a NPRS that it is the source for the specified
TargetResultSet. | public void | updateRow(ExecRow row) |
TemporaryRowHolderResultSet | public TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, boolean isAppendable, long positionIndexConglomId, TemporaryRowHolderImpl holder)(Code) | | Constructor
Parameters: tc - the xact controller Parameters: rowArray - the row array Parameters: resultDescription - value returned by getResultDescription() Parameters: isAppendable - true,if we can insert rows after this result is created Parameters: positionIndexConglomId - conglomId of the index which has order rowsare inserted and their row location |
checkRowPosition | public boolean checkRowPosition(int isType)(Code) | | Determine if the cursor is before the first row in the result
set.
true if before the first row, false otherwise. Returnsfalse when the result set contains no rows. |
clearCurrentRow | public void clearCurrentRow()(Code) | | Clear the current row
|
clone | public Object clone()(Code) | | Shallow clone this result set. Used in trigger reference.
beetle 4373.
|
closeRowSource | public void closeRowSource()(Code) | | closeRowSource tells the RowSource that it will no longer need to
return any rows and it can release any resource it may have.
Subsequent call to any method on the RowSource will result in undefined
behavior. A closed rowSource can be closed again.
|
finish | public void finish() throws StandardException(Code) | | 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.
exception: StandardException - on error |
getAbsoluteRow | public ExecRow getAbsoluteRow(int row) throws StandardException(Code) | | Returns the row at the absolute position from the query,
and returns NULL when there is no such position.
(Negative position means from the end of the result set.)
Moving the cursor to an invalid position leaves the cursor
positioned either before the first row (negative position)
or after the last row (positive position).
NOTE: An exception will be thrown on 0.
Parameters: row - The position. The row at the absolute position, or NULL if no such position. exception: StandardException - Thrown on failure See Also: Row |
getActivation | final public Activation getActivation()(Code) | | Return the Activation for this result set.
activation |
getBeginExecutionTimestamp | public Timestamp getBeginExecutionTimestamp()(Code) | | Get the Timestamp for the beginning of execution.
Timestamp The Timestamp for the beginning of execution. |
getCursorName | public String getCursorName()(Code) | | Returns the name of the cursor, if this is cursor statement of some
type (declare, open, fetch, positioned update, positioned delete,
close).
A String with the name of the cursor, if any. ReturnsNULL if this is not a cursor statement. |
getEndExecutionTimestamp | public Timestamp getEndExecutionTimestamp()(Code) | | Get the Timestamp for the end of execution.
Timestamp The Timestamp for the end of execution. |
getEstimatedRowCount | public double getEstimatedRowCount()(Code) | | Get the estimated row count from this result set.
The estimated row count (as a double) from this result set. |
getExecuteTime | public long getExecuteTime()(Code) | | Get the execution time in milliseconds.
long The execution time in milliseconds. |
getNextRow | public ExecRow getNextRow() throws StandardException(Code) | | Returns the next row from the query, and returns NULL when there
are no more rows.
The next row, or NULL if no more rows. exception: StandardException - Thrown on failure See Also: Row |
getNextRowFromRowSource | public DataValueDescriptor[] getNextRowFromRowSource() throws StandardException(Code) | | Get the next row as an array of column objects. The column objects can
be a JBMS Storable or any
Serializable/Externalizable/Formattable/Streaming type.
A return of null indicates that the complete set of rows has been read.
A null column can be specified by leaving the object null, or indicated
by returning a non-null getValidColumns. On streaming columns, it can
be indicated by returning a non-null get FieldStates.
If RowSource.needToClone() is true then the returned row (the
DataValueDescriptor[]) is guaranteed not to be modified by drainer of
the RowSource (except that the input stream will be read, of course)
and drainer will keep no reference to it before making the subsequent
nextRow call. So it is safe to return the same DataValueDescriptor[]
in subsequent nextRow calls if that is desirable for performance
reasons.
If RowSource.needToClone() is false then the returned row (the
DataValueDescriptor[]) may be be modified by drainer of the RowSource,
and the drainer may keep a reference to it after making the subsequent
nextRow call. In this case the client should severe all references to
the row after returning it from getNextRowFromRowSource().
exception: StandardException - Cloudscape Standard Error Policy |
getPointOfAttachment | public int getPointOfAttachment()(Code) | | Return 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.)
int Point of attachment (result set number) for thissubquery. (-1 if not a subquery - also Sanity violation) |
getPreviousRow | public ExecRow getPreviousRow() throws StandardException(Code) | | Returns the previous row from the query, and returns NULL when there
are no more previous rows.
The previous row, or NULL if no more previous rows. exception: StandardException - Thrown on failure See Also: Row |
getRelativeRow | public ExecRow getRelativeRow(int row) throws StandardException(Code) | | Returns the row at the relative position from the current
cursor position, and returns NULL when there is no such position.
(Negative position means toward the beginning of the result set.)
Moving the cursor to an invalid position leaves the cursor
positioned either before the first row (negative position)
or after the last row (positive position).
NOTE: 0 is valid.
NOTE: An exception is thrown if the cursor is not currently
positioned on a row.
Parameters: row - The position. The row at the relative position, or NULL if no such position. exception: StandardException - Thrown on failure See Also: Row |
getResultDescription | public ResultDescription getResultDescription()(Code) | | Returns a ResultDescription object, which describes the results
of the statement this ResultSet is in. This will *not* be a
description of this particular ResultSet, if this is not the
outermost ResultSet.
A ResultDescription describing the results of thestatement. |
getRowLocation | public RowLocation getRowLocation()(Code) | | Returns the row location of the current base table row of the cursor.
If this cursor's row is composed of multiple base tables' rows,
i.e. due to a join, then a null is returned. For
a temporary row holder, we always return null.
the row location of the current cursor row. |
getRowNumber | public int getRowNumber()(Code) | | Returns the row number of the current row. Row
numbers start from 1 and go to 'n'. Corresponds
to row numbering used to position current row
in the result set (as per JDBC).
the row number, or 0 if not on a row |
getScanIsolationLevel | public int getScanIsolationLevel()(Code) | | Return the isolation level of the scan in the result set.
Only expected to be called for those ResultSets that
contain a scan.
The isolation level of the scan (in TransactionController constants). |
getSubqueryTrackingArray | public NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)(Code) | | Get the subquery ResultSet tracking array from the top ResultSet.
(Used for tracking open subqueries when closing down on an error.)
Parameters: numSubqueries - The size of the array (For allocation on demand.) NoPutResultSet[] Array of NoPutResultSets for subqueries. |
getTimeSpent | public long getTimeSpent(int type)(Code) | | Return the total amount of time spent in this ResultSet
Parameters: type - CURRENT_RESULTSET_ONLY - time spent only in this ResultSetENTIRE_RESULTSET_TREE - time spent in this ResultSet and below. long The total amount of time spent (in milliseconds). |
getValidColumns | public FormatableBitSet getValidColumns()(Code) | | getValidColumns describes the DataValueDescriptor[] returned by all
calls to the getNextRowFromRowSource() call.
If getValidColumns returns null, the number of columns is given by the
DataValueDescriptor.length where DataValueDescriptor[] is returned by the
preceeding getNextRowFromRowSource() call. Column N maps to
DataValueDescriptor[N], where column numbers start at zero.
If getValidColumns return a non null validColumns FormatableBitSet the number of
columns is given by the number of bits set in validColumns. Column N is
not in the partial row if validColumns.get(N) returns false. Column N is
in the partial row if validColumns.get(N) returns true. If column N is
in the partial row then it maps to DataValueDescriptor[M] where M is the
count of calls to validColumns.get(i) that return true where i < N. If
DataValueDescriptor.length is greater than the number of columns
indicated by validColumns the extra entries are ignored.
|
isClosed | public boolean isClosed()(Code) | | Find out if the ResultSet is closed or not.
Will report true for result sets that do not return rows.
true if the ResultSet has been closed. |
isForUpdate | public boolean isForUpdate()(Code) | | Is this ResultSet or it's source result set for update
This method will be overriden in the inherited Classes
if it is true
Whether or not the result set is for update. |
markAsTopResultSet | public void markAsTopResultSet()(Code) | | Mark the ResultSet as the topmost one in the ResultSet tree.
Useful for closing down the ResultSet on an error.
|
modifiedRowCount | public int modifiedRowCount()(Code) | | |
needsRowLocation | public boolean needsRowLocation()(Code) | | needsRowLocation returns true iff this the row source expects the
drainer of the row source to call rowLocation after getting a row from
getNextRowFromRowSource.
true iff this row source expects some row location to bereturned See Also: TemporaryRowHolderResultSet.rowLocation |
needsToClone | public boolean needsToClone()(Code) | | Does the caller of getNextRowFromRowSource() need to clone the row
in order to keep a reference to the row past the
getNextRowFromRowSource() call which returned the row. This call
must always return the same for all rows in a RowSource (ie. the
caller will call this once per scan from a RowSource and assume the
behavior is true for all rows in the RowSource).
|
openCore | public void openCore() throws StandardException(Code) | | Open the scan and evaluate qualifiers and the like.
For us, there are no qualifiers, this is really a
noop.
|
reStartScan | public void reStartScan(long currentConglomId, long pconglomId) throws StandardException(Code) | | postion scan to start from after where we stopped earlier
|
reset | public void reset(ExecRow[] rowArray)(Code) | | Reset the exec row array and reinitialize
Parameters: rowArray - the row array |
resultSetNumber | public int resultSetNumber()(Code) | | Get the number of this ResultSet, which is guaranteed to be unique
within a statement.
|
returnsRows | public boolean returnsRows()(Code) | | Returns TRUE if the statement returns rows (i.e. is a SELECT
or FETCH statement), FALSE if it returns no rows.
TRUE if the statement returns rows, FALSE if not. |
rowLocation | public void rowLocation(RowLocation rl) throws StandardException(Code) | | rowLocation is a callback for the drainer of the row source to return
the rowLocation of the current row, i.e, the row that is being returned
by getNextRowFromRowSource. This interface is for the purpose of
loading a base table with index. In that case, the indices can be
built at the same time the base table is laid down once the row
location of the base row is known. This is an example pseudo code on
how this call is expected to be used:
boolean needsRL = rowSource.needsRowLocation();
DataValueDescriptor[] row;
while((row = rowSource.getNextRowFromRowSource()) != null)
{
RowLocation rl = heapConglomerate.insertRow(row);
if (needsRL)
rowSource.rowLocation(rl);
}
NeedsRowLocation and rowLocation will ONLY be called by a drainer of
the row source which CAN return a row location. Drainer of row source
which cannot return rowLocation will guarentee to not call either
callbacks. Conversely, if NeedsRowLocation is called and it returns
true, then for every row return by getNextRowFromRowSource, a
rowLocation callback must also be issued with the row location of the
row. Implementor of both the source and the drain of the row source
must be aware of this protocol.
The RowLocation object is own by the caller of rowLocation, in other
words, the drainer of the RowSource. This is so that we don't need to
new a row location for every row. If the Row Source wants to keep the
row location, it needs to clone it (RowLocation is a ClonableObject).
exception: StandardException - on error |
setCurrentRow | public void setCurrentRow(ExecRow row)(Code) | | Set the current row to the row passed in.
Parameters: row - the new current row |
setNeedsRowLocation | public void setNeedsRowLocation(boolean needsRowLocation)(Code) | | Set whether or not the NPRS need the row location when acting
as a row source. (The target result set determines this.)
|
setTargetResultSet | public void setTargetResultSet(TargetResultSet trs)(Code) | | Notify a NPRS that it is the source for the specified
TargetResultSet. This is useful when doing bulk insert.
Parameters: trs - The TargetResultSet. |
|
|