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);
      }
      
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • 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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

    • Method Detail

      • getResults

        @NotNull() abstract List<R> getResults()

        Extracts the results of a ResultSet from a previously executed query.

        This method does not execute a query itself, call execute to execute a query and generate a ResultSet or next with an existing ResultSet to re-execute the query with the offset increased to the next page's offset.

      • 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.