public class ResultSetQueryResult extends Object implements IterableQueryResult, Iterator<Map<String,Serializable>>
ResultSet
.Modifier and Type | Class and Description |
---|---|
static class |
ResultSetQueryResult.ClosedIteratorException |
Constructor and Description |
---|
ResultSetQueryResult(QueryMaker queryMaker,
String query,
QueryFilter queryFilter,
Session.PathResolver pathResolver,
JDBCMapper mapper,
Object... params) |
Modifier and Type | Method and Description |
---|---|
protected void |
checkNotClosed() |
void |
close()
Closes the query result and releases the underlying resources held by the cursor.
|
protected static void |
closePreparedStatement(PreparedStatement ps) |
protected Map<String,Serializable> |
fetchCurrent() |
protected Map<String,Serializable> |
fetchNext() |
boolean |
hasNext() |
boolean |
isLife()
Indicates if the query result has not been closed
|
Iterator<Map<String,Serializable>> |
iterator() |
boolean |
mustBeClosed()
Indicates if the query result must be closed (because it holds resources).
|
Map<String,Serializable> |
next() |
long |
pos()
Gets the current position in the iterator.
|
void |
remove() |
long |
size()
Gets the total size of the query result.
|
void |
skipTo(long pos)
Skips to a given position in the iterator.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
forEach, spliterator
forEachRemaining
public ResultSetQueryResult(QueryMaker queryMaker, String query, QueryFilter queryFilter, Session.PathResolver pathResolver, JDBCMapper mapper, Object... params) throws SQLException
SQLException
protected static void closePreparedStatement(PreparedStatement ps) throws SQLException
SQLException
public void close()
IterableQueryResult
This MUST be called when the query result is no more needed, otherwise underlying resources will be leaked. There is no auto-closing at the end of the iteration.
close
in interface Closeable
close
in interface AutoCloseable
close
in interface IterableQueryResult
public boolean isLife()
IterableQueryResult
isLife
in interface IterableQueryResult
public boolean mustBeClosed()
IterableQueryResult
mustBeClosed
in interface IterableQueryResult
true
if the query result must be closed, false
otherwiseprotected void checkNotClosed()
public long size()
IterableQueryResult
Note that this may be costly, and that some backends may not be able to do this operation, in which case
-1
will be returned.
size
in interface IterableQueryResult
-1
for an unknown sizepublic long pos()
IterableQueryResult
Positions start at 0
.
pos
in interface IterableQueryResult
public void skipTo(long pos)
IterableQueryResult
Positions start at 0
.
skipTo
in interface IterableQueryResult
public Iterator<Map<String,Serializable>> iterator()
iterator
in interface Iterable<Map<String,Serializable>>
protected Map<String,Serializable> fetchNext() throws SQLException
SQLException
protected Map<String,Serializable> fetchCurrent() throws SQLException
SQLException
public boolean hasNext()
hasNext
in interface Iterator<Map<String,Serializable>>
public Map<String,Serializable> next()
next
in interface Iterator<Map<String,Serializable>>
Copyright © 2016 Nuxeo SA. All rights reserved.