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.
columns - A list of columns to be included in the SELECT query.
joins - A list of joins that define relationships with other tables.
orderBy - A list of ordering instructions specifying the order of the result set.
where - A list of conditions used to filter the data in the SELECT query.
limit - Optional pagination settings for limiting the number of rows in the result set.

public record Select(Table table, List<Column> columns, List<Join> joins, List<OrderBy> orderBy, List<Condition> where, Optional<Limit> limit) extends Record
SQL SELECT query structure.

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

  • Constructor Details

    • Select

      public Select(Table table, List<Column> columns, List<Join> joins, List<OrderBy> orderBy, List<Condition> where, Optional<Limit> limit)
      Creates an instance of a Select record class.
      Parameters:
      table - the value for the table record component
      columns - the value for the columns record component
      joins - the value for the joins record component
      orderBy - the value for the orderBy record component
      where - the value for the where record component
      limit - the value for the limit 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.
    • table

      public Table table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • columns

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

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

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

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

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