Modifier and Type | Field and Description |
---|---|
private boolean |
closed
Track closed state of the
results . |
private static java.util.logging.Logger |
LOG
Logger
|
private Persistence |
persistence
Persistence object which provided the underlying ScrollableResults
|
private Persistence.Context |
persistenceContext
The
Persistence context. |
private org.hibernate.ScrollableResults |
results
Scrollable result set; primary keys or
Persistable s |
Constructor and Description |
---|
ScrollingResults(Persistence persistence,
org.hibernate.ScrollableResults 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.
|
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.io.Serializable |
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()
Move cursor to the previous result row.
|
void |
reset()
Reset the cursor to its natural starting position, before the first
result row.
|
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 row number currently under the cursor.
|
private static final java.util.logging.Logger LOG
private final org.hibernate.ScrollableResults results
Persistable
sprivate 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
.ScrollingResults(Persistence persistence, org.hibernate.ScrollableResults results) throws PersistenceException
persistence
- The associated persistence service object.results
- Scrollable result set generated by the query.PersistenceException
public 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.io.Serializable 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 Results
row
- Zero-based index of the row to be set as the current row.true
if there is a row at the specified row
number; else false
.public boolean scroll(int rows)
public void reset()
public void sessionClosing()
sessionClosing
in interface Results