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.
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.litebridge.db.spi.query.SelectTarget
SelectTarget.Void -
Constructor Summary
ConstructorsConstructorDescriptionSelect(SelectTarget from, List<? extends SelectExpression> expressions) 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) Creates an instance of aSelectrecord class. -
Method Summary
Modifier and TypeMethodDescriptionfinal booleanIndicates whether some other object is "equal to" this one.List<? extends SelectExpression> Returns the value of theexpressionsrecord component.from()Returns the value of thefromrecord component.@Nullable List<SelectExpression> groupBy()Returns the value of thegroupByrecord component.final inthashCode()Returns a hash code value for this object.@Nullable ConditionGrouphaving()Returns the value of thehavingrecord component.joins()Returns the value of thejoinsrecord component.@Nullable Limitlimit()Returns the value of thelimitrecord component.orderBy()Returns the value of theorderByrecord component.table()Get the target table for the operation.final StringtoString()Returns a string representation of this record class.@Nullable ConditionGroupwhere()Returns the value of thewhererecord component.
-
Constructor Details
-
Select
-
Select
public 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) Creates an instance of aSelectrecord class.- Parameters:
from- the value for thefromrecord 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
-
table
Description copied from interface:OperationGet the target table for the operation. -
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). -
from
Returns the value of thefromrecord component.- Returns:
- the value of the
fromrecord 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
-