Interface QueryResult

All Known Implementing Classes:
QueryResult.Entities, QueryResult.Rows

public sealed interface QueryResult permits QueryResult.Entities, QueryResult.Rows
The outcome of running a query: the records, the window they came from, and enough context to say what they represent.

total is null when no count ran. There is deliberately no sentinel: a caller that must distinguish "no rows counted" from "counted zero" can only do so if the uncounted case is absent rather than encoded as a number that looks like an answer.

  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static final record 
    Entity results, for a query selecting whole records.
    static final record 
    Tabular results, for a query selecting individual columns.
  • Method Summary

    Modifier and Type
    Method
    Description
    Declared parameter values as they were actually applied, after defaults resolved.
    How much of the matching data these records represent.
    The window size actually applied, after any engine cap.
    The window offset actually applied.
    List<?>
    The returned records.
    Query-scope aggregates by name, evaluated over the filtered set without the window.
    Counted rows, or null when no count ran.
  • Method Details

    • records

      List<?> records()
      The returned records.
    • limit

      Integer limit()
      The window size actually applied, after any engine cap.
    • offset

      Integer offset()
      The window offset actually applied.
    • total

      Long total()
      Counted rows, or null when no count ran.
    • completeness

      Completeness completeness()
      How much of the matching data these records represent.
    • appliedParameters

      Map<String,Object> appliedParameters()
      Declared parameter values as they were actually applied, after defaults resolved.
    • summary

      Map<String,Object> summary()
      Query-scope aggregates by name, evaluated over the filtered set without the window.

      Empty when the query declares none, which is the signal that no total covering more than the returned rows is available.