Interface PagedQuery.ResultSet
-
- All Implemented Interfaces:
public interface PagedQuery.ResultSet<R>
A result set containing the results of calling execute.
Use this class to access the results of a query and to re-execute the query to retrieve following pages of results by using hasNext and next.
Example usage:
- Kotlin:
val resultSet = query.execute() processResultsWithApplicationLogic(resultSet.results) while (resultSet.hasNext()) { val results = resultSet.next() processResultsWithApplicationLogic(results) }
- Java:
PagedQuery.ResultSet<Integer> resultSet = query.execute(); processResultsWithApplicationLogic(resultSet.getResults()); while (resultSet.hasNext()) { List<Integer> results = resultSet.next(); processResultsWithApplicationLogic(results); }
-
-
Method Summary
Modifier and Type Method Description abstract List<R>
getResults()
Extracts the results of a ResultSet from a previously executed query. abstract boolean
hasNext()
Returns true
if the ResultSet can retrieve more results by re-executing the query with the offset increased to the next's page's offset.abstract List<R>
next()
Executes the query linked to the ResultSet to retrieve the next page of results by re-executing the query. -
-
Method Detail
-
getResults
@NotNull() abstract List<R> getResults()
-
hasNext
abstract boolean hasNext()
Returns
true
if the ResultSet can retrieve more results by re-executing the query with the offset increased to the next's page's offset.Modifying the PagedQuery linked to the ResultSet does not affect ResultSet's behaviour when calling this method.
-
next
@Suspendable()@NotNull() abstract List<R> next()
Executes the query linked to the ResultSet to retrieve the next page of results by re-executing the query.
The offset of the executed query increments each time next is called, increasing by the value of the query's limit.
Modifying the PagedQuery linked to the ResultSet does not affect ResultSet's behaviour when calling this method.
-
-
-
-