public class DataResultIterator<I extends BasicData> extends Object implements ResultIterator<I>
DataQuery
as an iterator. This type
of iterator is only used for batchable items like reporter and raw data.
It is expected that the query uses the stateless Hibernate session available
from DbControl.getStatelessSession()
. If not,
the returned objects are automatically disconnected from the Hibernate session
to avoid memory problems and bypassing permission checks.DataQuery.iterate(DbControl)
Modifier and Type | Field and Description |
---|---|
private ScrollIterator<I> |
data
The internal iterator of BasicData objects.
|
private Class<I> |
dataClass
The class of the data objects returned by the query (and this object).
|
private Item |
itemType
The type of items returned by the query.
|
private SessionControl |
sc
The SessionControl
|
private Session |
session
The Hibernate Session that was used in the query, null if a stateless
session is used.
|
private long |
totalCount
The total number of items.
|
Constructor and Description |
---|
DataResultIterator(ScrollIterator<I> data,
SessionControl sc,
Session session,
Class<I> dataClass,
long totalCount) |
Modifier and Type | Method and Description |
---|---|
void |
close()
From the ResultIterator interface
---------------------------------
|
Item |
getItemType()
Get the type of items contained in this list.
|
long |
getTotalCount()
From the QueryResult interface
---------------------------------
|
boolean |
hasNext() |
boolean |
isClosed()
Check if the iterator has been closed.
|
I |
next() |
void |
remove()
Not supported.
|
private final ScrollIterator<I extends BasicData> data
private final Session session
private final SessionControl sc
private final long totalCount
private final Class<I extends BasicData> dataClass
private final Item itemType
DataResultIterator(ScrollIterator<I> data, SessionControl sc, Session session, Class<I> dataClass, long totalCount)
public long getTotalCount()
getTotalCount
in interface QueryResult
Query.setReturnTotalCount(boolean)
public void close()
close
in interface ResultIterator<I extends BasicData>
public boolean isClosed()
ResultIterator
isClosed
in interface ResultIterator<I extends BasicData>
public void remove()
remove
in interface Iterator<I extends BasicData>
UnsupportedOperationException
- Always