java.lang.Cloneable, CursorResultSet, NoPutResultSet, ResultSet, RowLocationRetRowSource, RowSourceclass TemporaryRowHolderResultSet extends java.lang.Object implements CursorResultSet, NoPutResultSet, java.lang.Cloneable
| Modifier and Type | Field | Description |
|---|---|---|
private RowLocation |
baseRowLocation |
|
private ExecRow |
currentRow |
|
private boolean |
currRowFromMem |
|
private boolean |
finished |
|
(package private) ConglomerateController |
heapCC |
|
private TemporaryRowHolderImpl |
holder |
|
(package private) DataValueDescriptor[] |
indexRow |
|
(package private) ScanController |
indexsc |
|
private boolean |
isAppendable |
|
private boolean |
isOpen |
|
private boolean |
isVirtualMemHeap |
|
private int |
numRowsOut |
|
private long |
positionIndexConglomId |
|
private ResultDescription |
resultDescription |
|
private ExecRow[] |
rowArray |
|
private ScanController |
scan |
|
private TransactionController |
tc |
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE, TEMPORARY_RESULT_SET_NUMBERCURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST| Constructor | Description |
|---|---|
TemporaryRowHolderResultSet(TransactionController tc,
ExecRow[] rowArray,
ResultDescription resultDescription,
boolean isVirtualMemHeap,
boolean isAppendable,
long positionIndexConglomId,
TemporaryRowHolderImpl holder) |
Constructor
|
TemporaryRowHolderResultSet(TransactionController tc,
ExecRow[] rowArray,
ResultDescription resultDescription,
boolean isVirtualMemHeap,
TemporaryRowHolderImpl holder) |
Constructor
|
| Modifier and Type | Method | Description |
|---|---|---|
void |
addWarning(java.sql.SQLWarning w) |
Add a warning to this result set.
|
boolean |
checkRowPosition(int isType) |
Determine if the cursor is before the first row in the result
set.
|
void |
cleanUp() |
Tells the system to clean up on an error.
|
void |
clearCurrentRow() |
Clear the current row
|
java.lang.Object |
clone() |
Shallow clone this result set.
|
void |
close() |
Clean up
|
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.
|
void |
deleteCurrentRow() |
|
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().
|
ExecRow |
getAbsoluteRow(int row) |
Returns the row at the absolute position from the query,
and returns NULL when there is no such position.
|
Activation |
getActivation() |
Return the
Activation for this result set. |
ResultSet |
getAutoGeneratedKeysResultset() |
ResultSet for rows inserted into the table (contains auto-generated keys columns only)
|
java.sql.Timestamp |
getBeginExecutionTimestamp() |
Get the Timestamp for the beginning of execution.
|
ExecRow |
getCurrentRow() |
This result set has its row from the last fetch done.
|
java.lang.String |
getCursorName() |
Returns the name of the cursor, if this is cursor statement of some
type (declare, open, fetch, positioned update, positioned delete,
close).
|
java.sql.Timestamp |
getEndExecutionTimestamp() |
Get the Timestamp for the end of execution.
|
double |
getEstimatedRowCount() |
Get the estimated row count from this result set.
|
long |
getExecuteTime() |
Get the execution time in milliseconds.
|
ExecRow |
getFirstRow() |
Returns the first row from the query, and returns NULL when there
are no rows.
|
ExecRow |
getLastRow() |
Returns the last row from the query, and returns NULL when there
are no rows.
|
static TemporaryRowHolderResultSet |
getNewRSOnCurrentRow(TriggerDescriptor triggerd,
Activation activation,
CursorResultSet rs,
int[] colsReadFromTable) |
Whip up a new Temp ResultSet that has a single
row.
|
private ExecRow |
getNextAppendedRow() |
|
ExecRow |
getNextRow() |
Returns the next row from the query, and returns NULL when there
are no more rows.
|
ExecRow |
getNextRowCore() |
Get the next row.
|
DataValueDescriptor[] |
getNextRowFromRowSource() |
Get the next row as an array of column objects.
|
int |
getPointOfAttachment() |
Return the point of attachment for this subquery.
|
ExecRow |
getPreviousRow() |
Returns the previous row from the query, and returns NULL when there
are no more previous rows.
|
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.
|
ResultDescription |
getResultDescription() |
Returns a ResultDescription object, which describes the results
of the statement this ResultSet is in.
|
RowLocation |
getRowLocation() |
Returns the row location of the current base table row of the cursor.
|
int |
getRowNumber() |
Returns the row number of the current row.
|
int |
getScanIsolationLevel() |
Return the isolation level of the scan in the result set.
|
NoPutResultSet[] |
getSubqueryTrackingArray(int numSubqueries) |
Get the subquery ResultSet tracking array from the top ResultSet.
|
long |
getTimeSpent(int type) |
Return the total amount of time spent in this ResultSet
|
FormatableBitSet |
getValidColumns() |
getValidColumns describes the DataValueDescriptor[] returned by all
calls to the getNextRowFromRowSource() call.
|
java.sql.SQLWarning |
getWarnings() |
Return the set of warnings generated during the execution of
this result set.
|
boolean |
isClosed() |
Find out if the ResultSet is closed or not.
|
boolean |
isForUpdate() |
Is this ResultSet or it's source result set for update
This method will be overriden in the inherited Classes
if it is true
|
private static int[] |
justTheRequiredColumnsPositions(int[] columnsArrary) |
|
void |
markAsTopResultSet() |
Mark the ResultSet as the topmost one in the ResultSet tree.
|
void |
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.
|
long |
modifiedRowCount() |
Returns the number of rows affected by the statement.
|
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.
|
boolean |
needsRowLocationForDeferredCheckConstraints() |
|
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.
|
void |
offendingRowLocation(RowLocation rl,
long containdId) |
|
void |
open() |
Tells the system that there will be calls to getNextRow().
|
void |
openCore() |
Open the scan and evaluate qualifiers and the like.
|
void |
positionScanAtRowLocation(RowLocation rl) |
Positions the cursor in the specified rowLocation.
|
void |
reopenCore() |
Reopen the scan.
|
boolean |
requiresRelocking() |
Do we need to relock the row when going to the heap.
|
void |
reset(ExecRow[] rowArray) |
Reset the exec row array and reinitialize
|
void |
reStartScan(long currentConglomId,
long pconglomId) |
postion scan to start from after where we stopped earlier
|
int |
resultSetNumber() |
Get the number of this ResultSet, which is guaranteed to be unique
within a statement.
|
boolean |
returnsRows() |
Returns TRUE if the statement returns rows (i.e. is a SELECT
or FETCH statement), FALSE if it returns no rows.
|
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.
|
ExecRow |
setAfterLastRow() |
Sets the current position to after the last row and returns NULL
because there is no current row.
|
ExecRow |
setBeforeFirstRow() |
Sets the current position to before the first row and returns NULL
because there is no current row.
|
void |
setCurrentRow(ExecRow row) |
Set the current row to the row passed in.
|
void |
setHasDeferrableChecks() |
Set that we are acting on behalf of an insert result set that has
deferrable check constraints
|
void |
setNeedsRowLocation(boolean needsRowLocation) |
Set whether or not the NPRS need the row location when acting
as a row source.
|
void |
setTargetResultSet(TargetResultSet trs) |
Notify a NPRS that it is the source for the specified
TargetResultSet.
|
private void |
setupPositionBasedScan(long position) |
|
private static int[] |
shrinkArray(int[] columnsArrary) |
|
private static int[] |
supersetofAllColumns(int[] columnsArray1,
int[] columnsArray2) |
|
org.w3c.dom.Element |
toXML(org.w3c.dom.Element parentNode,
java.lang.String tag) |
Produce an xml image of this ResultSet and its descendant ResultSets.
|
void |
updateRow(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.
|
private ExecRow[] rowArray
private int numRowsOut
private ScanController scan
private TransactionController tc
private boolean isOpen
private boolean finished
private ExecRow currentRow
private ResultDescription resultDescription
private boolean isAppendable
private long positionIndexConglomId
private boolean isVirtualMemHeap
private boolean currRowFromMem
private TemporaryRowHolderImpl holder
ConglomerateController heapCC
private RowLocation baseRowLocation
DataValueDescriptor[] indexRow
ScanController indexsc
public TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, TemporaryRowHolderImpl holder)
tc - the xact controllerrowArray - the row arrayresultDescription - value returned by getResultDescription()public TemporaryRowHolderResultSet(TransactionController tc, ExecRow[] rowArray, ResultDescription resultDescription, boolean isVirtualMemHeap, boolean isAppendable, long positionIndexConglomId, TemporaryRowHolderImpl holder)
tc - the xact controllerrowArray - the row arrayresultDescription - value returned by getResultDescription()isAppendable - true,if we can insert rows after this result is createdpositionIndexConglomId - conglomId of the index which has order rows
are inserted and their row locationpublic void reset(ExecRow[] rowArray)
rowArray - the row arraypublic void reStartScan(long currentConglomId,
long pconglomId)
throws StandardException
StandardExceptionprivate static int[] supersetofAllColumns(int[] columnsArray1,
int[] columnsArray2)
private static int[] shrinkArray(int[] columnsArrary)
private static int[] justTheRequiredColumnsPositions(int[] columnsArrary)
public static TemporaryRowHolderResultSet getNewRSOnCurrentRow(TriggerDescriptor triggerd, Activation activation, CursorResultSet rs, int[] colsReadFromTable) throws StandardException
triggerd - We are building Temp resultset for this triggeractivation - the activationrs - the result setcolsReadFromTable - The passed resultset is composed of
these columns. We will create a temp resultset which
will have either all these columns or only a subset of
these columns. It all depends on what columns are needed
by the trigger. If this param is null, then that means that
all the columns from the trigger table have been read into
the passed resultset.StandardException - on errorpublic void markAsTopResultSet()
markAsTopResultSet in interface NoPutResultSetpublic void openCore()
throws StandardException
openCore in interface NoPutResultSetStandardException - thrown if cursor finished.public void reopenCore()
throws StandardException
reopenCore in interface NoPutResultSetStandardException - on errorpublic ExecRow getNextRowCore() throws StandardException
getNextRowCore in interface NoPutResultSetStandardException - on errorpublic void deleteCurrentRow()
throws StandardException
StandardExceptionprivate void setupPositionBasedScan(long position)
throws StandardException
StandardExceptionprivate ExecRow getNextAppendedRow() throws StandardException
StandardExceptionpublic int getPointOfAttachment()
getPointOfAttachment in interface NoPutResultSetpublic int getScanIsolationLevel()
getScanIsolationLevel in interface NoPutResultSetpublic void setTargetResultSet(TargetResultSet trs)
setTargetResultSet in interface NoPutResultSettrs - The TargetResultSet.public void setNeedsRowLocation(boolean needsRowLocation)
setNeedsRowLocation in interface NoPutResultSetpublic double getEstimatedRowCount()
getEstimatedRowCount in interface NoPutResultSetpublic int resultSetNumber()
resultSetNumber in interface NoPutResultSetpublic void setCurrentRow(ExecRow row)
setCurrentRow in interface NoPutResultSetrow - the new current rowpublic void clearCurrentRow()
clearCurrentRow in interface ResultSetpublic ExecRow getCurrentRow() throws StandardException
getCurrentRow in interface CursorResultSetStandardException - thrown on failure.CursorResultSetpublic RowLocation getRowLocation()
getRowLocation in interface CursorResultSetpublic void close()
throws StandardException
close in interface ResultSetStandardException - thrown on errorpublic boolean returnsRows()
returnsRows in interface ResultSetpublic long modifiedRowCount()
ResultSetmodifiedRowCount in interface ResultSetpublic ResultDescription getResultDescription()
getResultDescription in interface ResultSetpublic void open()
throws StandardException
open in interface ResultSetStandardException - Thrown on failurepublic ExecRow getAbsoluteRow(int row) throws StandardException
getAbsoluteRow in interface ResultSetrow - The position.StandardException - Thrown on failureRowpublic ExecRow getRelativeRow(int row) throws StandardException
getRelativeRow in interface ResultSetrow - The position.StandardException - Thrown on failureRowpublic ExecRow setBeforeFirstRow() throws StandardException
setBeforeFirstRow in interface ResultSetStandardException - Thrown on failureRowpublic ExecRow getFirstRow() throws StandardException
getFirstRow in interface ResultSetStandardException - Thrown on failureRowpublic ExecRow getNextRow() throws StandardException
getNextRow in interface ResultSetStandardException - Thrown on failureRowpublic ExecRow getPreviousRow() throws StandardException
getPreviousRow in interface ResultSetStandardException - Thrown on failureRowpublic ExecRow getLastRow() throws StandardException
getLastRow in interface ResultSetStandardException - Thrown on failureRowpublic ExecRow setAfterLastRow() throws StandardException
setAfterLastRow in interface ResultSetStandardException - Thrown on failureRowpublic boolean checkRowPosition(int isType)
checkRowPosition in interface ResultSetpublic int getRowNumber()
getRowNumber in interface ResultSetpublic void cleanUp()
throws StandardException
cleanUp in interface ResultSetStandardException - Thrown on error.public boolean isClosed()
public void finish()
throws StandardException
finish in interface ResultSetStandardException - on errorpublic long getExecuteTime()
getExecuteTime in interface ResultSetpublic ResultSet getAutoGeneratedKeysResultset()
ResultSetgetAutoGeneratedKeysResultset in interface ResultSetResultSet.getAutoGeneratedKeysResultset()public java.sql.Timestamp getBeginExecutionTimestamp()
getBeginExecutionTimestamp in interface ResultSetpublic java.sql.Timestamp getEndExecutionTimestamp()
getEndExecutionTimestamp in interface ResultSetpublic long getTimeSpent(int type)
getTimeSpent in interface ResultSettype - CURRENT_RESULTSET_ONLY - time spent only in this ResultSet
ENTIRE_RESULTSET_TREE - time spent in this ResultSet and below.public NoPutResultSet[] getSubqueryTrackingArray(int numSubqueries)
getSubqueryTrackingArray in interface ResultSetnumSubqueries - The size of the array (For allocation on demand.)public java.lang.String getCursorName()
getCursorName in interface ResultSetpublic boolean requiresRelocking()
NoPutResultSetrequiresRelocking in interface NoPutResultSetNoPutResultSet.requiresRelocking()public DataValueDescriptor[] getNextRowFromRowSource() throws StandardException
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().
getNextRowFromRowSource in interface RowSourceStandardException - Standard Derby Error Policypublic boolean needsToClone()
needsToClone in interface RowSourcepublic FormatableBitSet getValidColumns()
getValidColumns in interface RowSourcepublic void closeRowSource()
closeRowSource in interface RowSourcepublic boolean needsRowLocation()
needsRowLocation in interface RowLocationRetRowSourcerowLocation(org.apache.derby.iapi.types.RowLocation)public void setHasDeferrableChecks()
NoPutResultSetsetHasDeferrableChecks in interface NoPutResultSetpublic boolean needsRowLocationForDeferredCheckConstraints()
needsRowLocationForDeferredCheckConstraints in interface RowLocationRetRowSourcepublic void rowLocation(RowLocation rl) throws StandardException
boolean needsRL = rowSource.needsRowLocation();
DataValueDescriptor[] row;
while((row = rowSource.getNextRowFromRowSource()) != null)
{
RowLocation rl = heapConglomerate.insertRow(row);
if (needsRL)
rowSource.rowLocation(rl);
}
rowLocation in interface RowLocationRetRowSourceStandardException - on errorpublic void offendingRowLocation(RowLocation rl, long containdId) throws StandardException
offendingRowLocation in interface RowLocationRetRowSourceStandardExceptionpublic void positionScanAtRowLocation(RowLocation rl) throws StandardException
NoPutResultSetpositionScanAtRowLocation in interface NoPutResultSetrl - row location of the current cursor rowStandardException - thrown on failure to
get location from storage engineThis method is result sets used for scroll insensitive updatable
result sets for other result set it is a no-op.public boolean isForUpdate()
isForUpdate in interface NoPutResultSetpublic java.lang.Object clone()
clone in class java.lang.Objectpublic void addWarning(java.sql.SQLWarning w)
ResultSetaddWarning in interface ResultSetw - the warning to addpublic java.sql.SQLWarning getWarnings()
ResultSetgetWarnings in interface ResultSetpublic void updateRow(ExecRow row, RowChanger rowChanger) throws StandardException
NoPutResultSetupdateRow in interface NoPutResultSetrow - 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.StandardException - thrown on failure.This method is result sets used for scroll insensitive updatable
result sets for other result set it is a no-op.public void markRowAsDeleted()
throws StandardException
NoPutResultSetmarkRowAsDeleted in interface NoPutResultSetStandardException - thrown on failure.This method is result sets used for scroll insensitive updatable
result sets for other result set it is a no-op.public final Activation getActivation()
Activation for this result set.getActivation in interface ResultSetpublic org.w3c.dom.Element toXML(org.w3c.dom.Element parentNode,
java.lang.String tag)
throws java.lang.Exception
ResultSetProduce an xml image of this ResultSet and its descendant ResultSets. Appends an element to the parentNode and returns the appended element.
Apache Derby V10.14 Internals - Copyright © 2004,2018 The Apache Software Foundation. All Rights Reserved.