Record Class Select

java.lang.Object
java.lang.Record
org.litebridgedb.db.spi.query.Select
Record Components:
table - The main table from which data is being selected.
expressions - A list of expressions (e.g. columns or functions) to be included in the SELECT query.
joins - A list of joins that define relationships with other tables.
where - A list of conditions used to filter the data in the SELECT query.
groupBy - A list of expressions used to group the result set.
having - A list of conditions used to filter the grouped data in the SELECT query.
orderBy - A list of ordering instructions specifying the order of the result set.
limit - Optional pagination settings for limiting the number of rows in the result set.
All Implemented Interfaces:
Operation

public record Select(Table table, List<SelectExpression> expressions, List<Join> joins, List<Condition> where, List<SelectExpression> groupBy, List<Condition> having, List<OrderBy> orderBy, Optional<Limit> limit) extends Record implements Operation
SQL SELECT query structure.

This record encapsulates the components of a SELECT query, including the target table, a list of expressions to retrieve, joins for combining data from other tables, conditions for filtering data, ordering instructions, and optional pagination settings.

  • Constructor Details

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

      public Table table()
      Returns the value of the table record component.
      Specified by:
      table in interface Operation
      Returns:
      the value of the table record component
    • expressions

      public List<SelectExpression> expressions()
      Returns the value of the expressions record component.
      Returns:
      the value of the expressions record component
    • joins

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

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

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

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

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

      public Optional<Limit> limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component