Package org.nuxeo.ecm.core.api
Interface IterableQueryResult
-
- All Superinterfaces:
AutoCloseable
,Closeable
,Iterable<Map<String,Serializable>>
- All Known Implementing Classes:
CMISQLtoNXQL.NXQLtoCMISIterableQueryResult
,DBSSession.DBSQueryResult
,EsIterableQueryResultImpl
,EsResultSetImpl
,ResultSetQueryResult
public interface IterableQueryResult extends Iterable<Map<String,Serializable>>, Closeable
An iterable query result based on a cursor.The
close()
method 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.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
close()
Closes the query result and releases the underlying resources held by the cursor.boolean
isLife()
Deprecated.since 8.1 (misspelled), usemustBeClosed()
insteadboolean
mustBeClosed()
Indicates if the query result must be closed (because it holds resources).long
pos()
Gets the current position in the iterator.long
size()
Gets the total size of the query result.void
skipTo(long pos)
Skips to a given position in the iterator.-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-
-
-
Method Detail
-
close
void close()
Closes the query result and releases the underlying resources held by the cursor.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.
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
isLife
@Deprecated boolean isLife()
Deprecated.since 8.1 (misspelled), usemustBeClosed()
insteadIndicates if the query result has not been closed
-
mustBeClosed
boolean mustBeClosed()
Indicates if the query result must be closed (because it holds resources).- Returns:
true
if the query result must be closed,false
otherwise- Since:
- 8.1
-
size
long size()
Gets the total size of the query result.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.- Returns:
- the size, or
-1
for an unknown size
-
pos
long pos()
Gets the current position in the iterator.Positions start at
0
.- Returns:
- the position
-
skipTo
void skipTo(long pos)
Skips to a given position in the iterator.Positions start at
0
.
-
-