|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl
org.apache.derby.impl.sql.execute.NoPutResultSetImpl
abstract class NoPutResultSetImpl
Abstract ResultSet with built in Activation support for operations that return rows but do not allow the caller to put data on output pipes. This implementation of ResultSet is meant to be overridden by subtypes in the execution engine. Its primary users will be DML operations that do not put data on output pipes, but simply return it due to being result sets themselves.
This abstract class does not define the entire ResultSet interface, but leaves the 'get' half of the interface for subtypes to implement. It is package-visible only, with its methods being public for exposure by its subtypes.
Field Summary | |
---|---|
protected int[] |
checkNullCols
|
protected ExecRow |
clonedExecRow
|
protected int |
cncLen
|
private boolean |
needsRowLocation
|
int |
resultSetNumber
|
protected TargetResultSet |
targetResultSet
|
Fields inherited from class org.apache.derby.impl.sql.execute.BasicNoPutResultSetImpl |
---|
activation, beginTime, closeTime, compactRow, constructorTime, currentRow, endExecutionTime, finished, isOpen, isTopResultSet, nextTime, numOpens, openTime, optimizerEstimatedCost, optimizerEstimatedRowCount, resultDescription, rowsFiltered, rowsSeen, startExecutionTime, subqueryTrackingArray |
Fields inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
---|
ABSOLUTE, FIRST, LAST, NEXT, PREVIOUS, RELATIVE |
Fields inherited from interface org.apache.derby.iapi.sql.ResultSet |
---|
CURRENT_RESULTSET_ONLY, ENTIRE_RESULTSET_TREE, ISAFTERLAST, ISBEFOREFIRST, ISFIRST, ISLAST |
Constructor Summary | |
---|---|
NoPutResultSetImpl(Activation activation,
int resultSetNumber,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost)
Constructor |
Method Summary | |
---|---|
void |
clearCurrentRow()
Clear the current row |
protected void |
clearOrderableCache(Qualifier[][] qualifiers)
Clear the Orderable cache for each qualifier. |
void |
close()
Close needs to invalidate any dependent statements, if this is a cursor. |
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. |
java.lang.String |
getCursorName()
Return my cursor name for JDBC. |
DataValueDescriptor[] |
getNextRowFromRowSource()
Get the next row as an array of column objects. |
ResultDescription |
getResultDescription()
Returns the description of the table's rows |
FormatableBitSet |
getValidColumns()
getValidColumns describes the DataValueDescriptor[] returned by all calls to the getNextRowFromRowSource() call. |
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 |
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. |
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 |
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 |
positionScanAtRowLocation(RowLocation rl)
Positions the cursor in the specified rowLocation. |
static java.lang.String |
printQualifiers(Qualifier[][] qualifiers)
Return a 2-d array of Qualifiers as a String |
int |
resultSetNumber()
Get the number of this ResultSet, which is guaranteed to be unique within a statement. |
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. |
void |
setCurrentRow(ExecRow row)
Set the current row to the row passed in. |
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. |
protected boolean |
skipRow(ExecRow row)
Return true if we should skip the scan due to nulls in the row when the start or stop positioners on the columns containing null do not implement ordered null semantics. |
protected boolean |
skipScan(ExecIndexRow startPosition,
ExecIndexRow stopPosition)
Return true if we should skip the scan due to nulls in the start or stop position when the predicate on the column(s) in question do not implement ordered null semantics. beetle 4464, we also compact the areNullsOrdered flags into checkNullCols here. |
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. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.apache.derby.iapi.sql.execute.NoPutResultSet |
---|
openCore |
Methods inherited from interface org.apache.derby.iapi.sql.ResultSet |
---|
getTimeSpent |
Field Detail |
---|
public final int resultSetNumber
private boolean needsRowLocation
protected ExecRow clonedExecRow
protected TargetResultSet targetResultSet
protected int[] checkNullCols
protected int cncLen
Constructor Detail |
---|
NoPutResultSetImpl(Activation activation, int resultSetNumber, double optimizerEstimatedRowCount, double optimizerEstimatedCost)
activation
- The activationresultSetNumber
- The resultSetNumberoptimizerEstimatedRowCount
- The optimizer's estimated number
of rows.optimizerEstimatedCost
- The optimizer's estimated costMethod Detail |
---|
public ResultDescription getResultDescription()
getResultDescription
in interface ResultSet
getResultDescription
in class BasicNoPutResultSetImpl
public java.lang.String getCursorName()
public int resultSetNumber()
NoPutResultSet
resultSetNumber
in interface NoPutResultSet
resultSetNumber
in class BasicNoPutResultSetImpl
NoPutResultSet.resultSetNumber()
public void close() throws StandardException
StandardException
- on errorpublic void setTargetResultSet(TargetResultSet trs)
NoPutResultSet
trs
- The TargetResultSet.NoPutResultSet.setTargetResultSet(org.apache.derby.iapi.sql.execute.TargetResultSet)
public void setNeedsRowLocation(boolean needsRowLocation)
NoPutResultSet
NoPutResultSet.setNeedsRowLocation(boolean)
public FormatableBitSet getValidColumns()
RowSource
RowSource.getValidColumns()
public DataValueDescriptor[] getNextRowFromRowSource() throws StandardException
RowSource
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().
StandardException
- on errorRowSource.getNextRowFromRowSource()
public boolean needsToClone()
RowSource
RowSource.needsToClone()
public void closeRowSource()
RowSource
RowSource.closeRowSource()
public boolean needsRowLocation()
RowLocationRetRowSource
RowLocationRetRowSource.needsRowLocation()
public void rowLocation(RowLocation rl) throws StandardException
RowLocationRetRowSource
boolean needsRL = rowSource.needsRowLocation(); DataValueDescriptor[] row; while((row = rowSource.getNextRowFromRowSource()) != null) { RowLocation rl = heapConglomerate.insertRow(row); if (needsRL) rowSource.rowLocation(rl); }
StandardException
- on errorRowLocationRetRowSource.rowLocation(org.apache.derby.iapi.types.RowLocation)
protected void clearOrderableCache(Qualifier[][] qualifiers) throws StandardException
qualifiers
- The Qualifiers to clear
StandardException
public final void setCurrentRow(ExecRow row)
row
- the new current rowpublic void clearCurrentRow()
public boolean isForUpdate()
isForUpdate
in interface NoPutResultSet
isForUpdate
in class BasicNoPutResultSetImpl
protected boolean skipScan(ExecIndexRow startPosition, ExecIndexRow stopPosition) throws StandardException
startPosition
- An index row for the start positionstopPosition
- An index row for the stop position
StandardException
protected boolean skipRow(ExecRow row) throws StandardException
row
- An index row
StandardException
public static java.lang.String printQualifiers(Qualifier[][] qualifiers)
public void updateRow(ExecRow row, RowChanger rowChanger) throws StandardException
NoPutResultSet
row
- 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
NoPutResultSet
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 positionScanAtRowLocation(RowLocation rl) throws StandardException
NoPutResultSet
rl
- row location of the current cursor row
StandardException
- 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.
|
Built on Thu 2012-03-29 21:53:33+0000, from revision ??? | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |