|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.basedb.core.DataResultIterator<I>
public class DataResultIterator<I extends BasicData>
Return the results of a 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)| Field Summary | |
|---|---|
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 Summary | |
|---|---|
DataResultIterator(ScrollIterator<I> data,
SessionControl sc,
Session session,
Class<I> dataClass,
long totalCount)
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
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
| Constructor Detail |
|---|
DataResultIterator(ScrollIterator<I> data,
SessionControl sc,
Session session,
Class<I> dataClass,
long totalCount)
| Method Detail |
|---|
public long getTotalCount()
getTotalCount in interface QueryResultQuery.setReturnTotalCount(boolean)public void close()
close in interface ResultIterator<I extends BasicData>public boolean isClosed()
ResultIterator
isClosed in interface ResultIterator<I extends BasicData>public boolean hasNext()
hasNext in interface Iterator<I extends BasicData>public I next()
next in interface Iterator<I extends BasicData>public void remove()
remove in interface Iterator<I extends BasicData>UnsupportedOperationException - Alwayspublic Item getItemType()
Item object or null if not known
|
3.1.1: 2012-03-29 | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||