Record Class Select

java.lang.Object
java.lang.Record
org.litebridge.db.spi.query.Select
Record Components:
from - The aliased table/subquery 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 - The condition group used to filter the data in the SELECT query.
groupBy - A list of expressions used to group the result set.
having - The condition group 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, SelectTarget

public record Select(SelectTarget from, List<? extends SelectExpression> expressions, @Nullable List<Join> joins, @Nullable ConditionGroup where, @Nullable List<SelectExpression> groupBy, @Nullable ConditionGroup having, @Nullable List<OrderBy> orderBy, @Nullable Limit limit) extends Record implements Operation, SelectTarget
Logical representation of a SQL SELECT statement.

It is used by DatabaseProvider implementations to generate SQL SELECT statement strings.

  • Constructor Details

  • Method Details

    • table

      public SelectTarget table()
      Description copied from interface: Operation
      Get the target table for the operation.
      Specified by:
      table in interface Operation
      Returns:
      the target table of the operation
    • 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 SelectTarget from()
      Returns the value of the from record component.
      Returns:
      the value of the from record component
    • expressions

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

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

      public @Nullable ConditionGroup where()
      Returns the value of the where record component.
      Returns:
      the value of the where record component
    • groupBy

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

      public @Nullable ConditionGroup having()
      Returns the value of the having record component.
      Returns:
      the value of the having record component
    • orderBy

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

      public @Nullable Limit limit()
      Returns the value of the limit record component.
      Returns:
      the value of the limit record component