| Modifier and Type | Field and Description |
|---|---|
private boolean |
closed
Track closed state of the
results. |
private boolean |
hasResults
Flag to check if the result set is empty
|
private boolean |
isAfterLast
Flag to check if the cursor is after last row
|
private static CentralLogger |
LOG
Logger
|
private Persistence |
persistence
Persistence object which provided the underlying ScrollableResults
|
private Persistence.Context |
persistenceContext
The
Persistence context. |
private ScrollableResults<java.lang.Object> |
results
Scrollable result set; primary keys or
Records |
private int |
rowNumber
Cache the row number
|
| Constructor and Description |
|---|
ForwardResults(Persistence persistence,
ScrollableResults<java.lang.Object> results)
Construct an instance of this object from a scrollable result set
provided by query execution.
|
| Modifier and Type | Method and Description |
|---|---|
void |
cleanup()
Close the wrapped
ScrollableResults object. |
boolean |
first()
Move cursor to the first result row only if the cursor is behind it.
|
java.lang.Object[] |
get()
Get the array of objects at the current result row.
|
java.lang.Object |
get(int column)
Get the object at the current result row, at the specified column.
|
java.lang.Long |
getID(int column)
Get the primary key ID at the current result row, at the specified
column.
|
int |
getRowNumber()
Get the row number currently under the cursor.
|
boolean |
isFirst()
Is the cursor on the first row in the result set?
|
boolean |
isLast()
Is the cursor on the last row in the result set?
|
boolean |
last()
Move cursor to the last result row.
|
boolean |
next()
Move cursor to the next result row.
|
boolean |
previous()
Should move cursor to the previous result row, but it cannot be done in FORWARD_ONLY mode.
|
void |
reset()
Should reset the cursor to its natural starting position, before the first
result row, but it cannot be done in FORWARD_ONLY mode.
|
boolean |
scroll(int rows)
Scroll the cursor ahead by the specified number of rows.
|
void |
sessionClosing()
Invoked when the current Hibernate session is about to close.
|
boolean |
setRowNumber(int row)
Set the cursor at the row number.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddRow, deleteRow, get, getNumberOfLoadedRows, isAutoFetch, isResultSetCachedprivate static final CentralLogger LOG
private final ScrollableResults<java.lang.Object> results
Recordsprivate final Persistence persistence
private final Persistence.Context persistenceContext
Persistence context. Only used at cleanup time when the getter is not accessible
any more.private boolean closed
results.private boolean hasResults
private boolean isAfterLast
private int rowNumber
ForwardResults(Persistence persistence, ScrollableResults<java.lang.Object> results) throws PersistenceException
persistence - The associated persistence service object.results - Scrollable result set generated by the query.PersistenceExceptionpublic boolean first()
public boolean last()
public boolean next()
public boolean previous()
public boolean isFirst()
public boolean isLast()
public java.lang.Object[] get()
public java.lang.Object get(int column)
public java.lang.Long getID(int column)
public int getRowNumber()
getRowNumber in interface Results-1
if the cursor is not currently on a result.public boolean setRowNumber(int row)
setRowNumber in interface Resultsrow - Zero-based index of the row to be set as the current row.true if the row number is after the current position and before last;
else false.public boolean scroll(int rows)
public void reset()
public void sessionClosing()
sessionClosing in interface Results