Record Class QuerySpec

java.lang.Object
java.lang.Record
com.onec.query.QuerySpec
Record Components:
from - the root entity class (catalog/document/register)
select - projected columns / ref-navigations / aggregates
where - AND-combined filter predicates
groupBy - grouping paths
orderBy - ordering terms
totals - 1C ИТОГИ hierarchy paths (carried in the AST; tree folding is a follow-up)
limit - optional row cap
offset - optional row offset

public record QuerySpec(Class<?> from, List<Select> select, List<Predicate> where, List<Path> groupBy, List<Order> orderBy, List<Path> totals, Integer limit, Integer offset) extends Record
The declarative AST for a query over any catalog, document, or register — the single source of truth that the fluent builder produces and that the engine compiles to SQL. Being a plain value, the same query is expressible without the fluent API (and, later, as JSON for UI/agents or parsed from a 1C-style text syntax).
  • Constructor Details

    • QuerySpec

      public QuerySpec(Class<?> from, List<Select> select, List<Predicate> where, List<Path> groupBy, List<Order> orderBy, List<Path> totals, Integer limit, Integer offset)
      Creates an instance of a QuerySpec record class.
      Parameters:
      from - the value for the from record component
      select - the value for the select record component
      where - the value for the where record component
      groupBy - the value for the groupBy record component
      orderBy - the value for the orderBy record component
      totals - the value for the totals record component
      limit - the value for the limit record component
      offset - the value for the offset record component
  • Method Details

    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with Objects::equals(Object,Object).
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • from

      public Class<?> from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • select

      public List<Select> select()
      Returns the value of the select record component.
      Returns:
      the value of the select record component
    • where

      public List<Predicate> where()
      Returns the value of the where record component.
      Returns:
      the value of the where record component
    • groupBy

      public List<Path> groupBy()
      Returns the value of the groupBy record component.
      Returns:
      the value of the groupBy record component
    • orderBy

      public List<Order> orderBy()
      Returns the value of the orderBy record component.
      Returns:
      the value of the orderBy record component
    • totals

      public List<Path> totals()
      Returns the value of the totals record component.
      Returns:
      the value of the totals record component
    • limit

      public Integer limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component
    • offset

      public Integer offset()
      Returns the value of the offset record component.
      Returns:
      the value of the offset record component