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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.Returns the value of theexpressionsrecord component.groupBy()Returns the value of thegroupByrecord component.final inthashCode()Returns a hash code value for this object.having()Returns the value of thehavingrecord component.joins()Returns the value of thejoinsrecord component.limit()Returns the value of thelimitrecord component.orderBy()Returns the value of theorderByrecord component.table()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.where()Returns the value of thewhererecord component.
-
Constructor Details
-
Select
public Select(Table table, List<SelectExpression> expressions, List<Join> joins, List<Condition> where, List<SelectExpression> groupBy, List<Condition> having, List<OrderBy> orderBy, Optional<Limit> limit) Creates an instance of aSelectrecord class.- Parameters:
table- the value for thetablerecord componentexpressions- the value for theexpressionsrecord componentjoins- the value for thejoinsrecord componentwhere- the value for thewhererecord componentgroupBy- the value for thegroupByrecord componenthaving- the value for thehavingrecord componentorderBy- the value for theorderByrecord componentlimit- the value for thelimitrecord component
-
-
Method Details
-
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. -
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. -
equals
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 withObjects::equals(Object,Object). -
table
Returns the value of thetablerecord component. -
expressions
Returns the value of theexpressionsrecord component.- Returns:
- the value of the
expressionsrecord component
-
joins
Returns the value of thejoinsrecord component.- Returns:
- the value of the
joinsrecord component
-
where
Returns the value of thewhererecord component.- Returns:
- the value of the
whererecord component
-
groupBy
Returns the value of thegroupByrecord component.- Returns:
- the value of the
groupByrecord component
-
having
Returns the value of thehavingrecord component.- Returns:
- the value of the
havingrecord component
-
orderBy
Returns the value of theorderByrecord component.- Returns:
- the value of the
orderByrecord component
-
limit
Returns the value of thelimitrecord component.- Returns:
- the value of the
limitrecord component
-