public class ConnectionAwareResultIterator<T> extends Object implements ResultIterator<T>
ResultIterator
wrapper that handles closing a connection. Also
internally counts processed rows, mostly for the benefit of subclasses.
Subclasses are used in iterators that are returned to the end users and are
not implicitly managed by Cayenne.Modifier and Type | Field and Description |
---|---|
protected int |
rowCounter |
Constructor and Description |
---|
ConnectionAwareResultIterator(ResultIterator<T> delegate,
Connection connection) |
Modifier and Type | Method and Description |
---|---|
List<T> |
allRows()
Returns all yet unread rows from ResultSet without closing it.
|
void |
close()
Closes ResultIterator and associated ResultSet.
|
protected void |
doClose() |
boolean |
hasNextRow()
Returns true if there is at least one more record that can be read from
the iterator.
|
Iterator<T> |
iterator() |
T |
nextRow()
Returns the next result row that is, depending on the query, may be a
scalar value, a DataRow, or an Object[] array containing a mix of scalars
and DataRows.
|
void |
skipRow()
Goes past current row.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
public ConnectionAwareResultIterator(ResultIterator<T> delegate, Connection connection)
public void close()
ResultIterator
close
in interface AutoCloseable
close
in interface ResultIterator<T>
protected void doClose()
public List<T> allRows()
ResultIterator
allRows
in interface ResultIterator<T>
public boolean hasNextRow()
ResultIterator
hasNextRow
in interface ResultIterator<T>
public T nextRow()
ResultIterator
nextRow
in interface ResultIterator<T>
public void skipRow()
ResultIterator
skipRow
in interface ResultIterator<T>
Copyright © 2001–2019 Apache Cayenne. All rights reserved.