Package io.inversion

Class Results<M extends Map<String,Object>>

java.lang.Object
io.inversion.Results<M>
All Implemented Interfaces:
Iterable<M>

public class Results<M extends Map<String,Object>> extends Object implements Iterable<M>
Results are returned by a Db and transformed by Actions into Response content.

Dbs are not responsible for mapping from column names to json names so a Results rows and terms will use column names until they are potentially transformed by an Action.

  • Field Details

    • LAST_QUERY

      public static String LAST_QUERY
    • next

      protected final List<Term> next
      The RQL terms that will get the next page of results the DB things there are more results.

      Dbs are not responsible for mapping from column names to json names so these terms will have column names when initially returned from the Db.

      Actions should map the keys to the corresponding json name property names before returning to the caller.

    • query

      protected Query query
      the query that produced these results.
    • rows

      protected List<M extends Map<String,Object>> rows
      The data the query produced.

      Dbs are not responsible for mapping from column names to json names so these maps will have column names keys when initially returned from the Db.

      Actions should map them to the corresponding json property names before returning to the caller.

    • foundRows

      protected int foundRows
      The total number of rows (if known) in the Db that match the query, not the number of rows returned in this Results.

      For paginated listings, foundRows generally be greater than rows.size()

    • debugQuery

      protected String debugQuery
    • testQuery

      protected String testQuery
  • Constructor Details

    • Results

      public Results(Query query)
    • Results

      public Results(Query query, int foundRows, List<M> rows)
  • Method Details

    • getQuery

      public Query getQuery()
    • withQuery

      public Results withQuery(Query query)
    • iterator

      public Iterator<M> iterator()
      Specified by:
      iterator in interface Iterable<M extends Map<String,Object>>
    • size

      public int size()
    • getRow

      public M getRow(int index)
    • setRow

      public Results setRow(int index, M row)
    • getRows

      public List<M> getRows()
    • withRows

      public Results withRows(List rows)
    • withRow

      public Results withRow(M row)
    • getNext

      public List<Term> getNext()
    • withNext

      public Results withNext(Term next)
    • withNext

      public Results withNext(List<Term> next)
    • getFoundRows

      public int getFoundRows()
    • withFoundRows

      public Results withFoundRows(int foundRows)
    • isDryRun

      public boolean isDryRun()
    • getDebugQuery

      public String getDebugQuery()
    • withDebugQuery

      public Results withDebugQuery(String debugQuery)
    • getTestQuery

      public String getTestQuery()
    • withTestQuery

      public Results withTestQuery(String testQuery)