java.lang.Object
java.lang.Record
org.litebridge.orm.engine.ast.SelectNode
- Record Components:
table- name of the table to select fromdtoClass- class of the DTO to select fromcontextDtoClass- The parent/context DTO class for determining the correctdtoClasstable mapping (for shared DTOs mapped to multiple distinct tables)fromQueryNode- the query node representing the subquery in the FROM clausecolumns- names of the columns to selectexpressions- the expressions to selectresultTypes- the target result types, if overridden
- All Implemented Interfaces:
QueryNode
public record SelectNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, @Nullable QueryNode fromQueryNode, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes)
extends Record
implements QueryNode
Represents a SELECT clause in the query AST.
This is a root node.
-
Constructor Summary
ConstructorsConstructorDescriptionSelectNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, @Nullable QueryNode fromQueryNode, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) Creates an instance of aSelectNoderecord class.SelectNode(Class<?> dtoClass, @Nullable Class<?> contextDtoClass, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) SelectNode(String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) SelectNode(String table, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) SelectNode(@Nullable QueryNode fromQueryNode, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringalias()Returns the value of thealiasrecord component.String @Nullable []columns()Returns the value of thecolumnsrecord component.@Nullable Class<?> Returns the value of thecontextDtoClassrecord component.@Nullable Class<?> dtoClass()Returns the value of thedtoClassrecord component.booleanIndicates whether some other object is "equal to" this one.ExpressionSpec @Nullable []Returns the value of theexpressionsrecord component.@Nullable QueryNodeReturns the value of thefromQueryNoderecord component.inthashCode()Returns a hash code value for this object.booleanChecks whether this node represents selecting all columns/fields.@Nullable QueryNodeprevious()Returns the previous node in the chain, ornullif this is the root node.Class<?> @Nullable []Returns the value of theresultTypesrecord component.@Nullable Stringtable()Returns the value of thetablerecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
SelectNode
public SelectNode(String table, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) -
SelectNode
-
SelectNode
public SelectNode(@Nullable QueryNode fromQueryNode, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) -
SelectNode
public SelectNode(String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) -
SelectNode
public SelectNode(@Nullable String table, @Nullable Class<?> dtoClass, @Nullable Class<?> contextDtoClass, @Nullable QueryNode fromQueryNode, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes) Creates an instance of aSelectNoderecord class.- Parameters:
table- the value for thetablerecord componentdtoClass- the value for thedtoClassrecord componentcontextDtoClass- the value for thecontextDtoClassrecord componentfromQueryNode- the value for thefromQueryNoderecord componentalias- the value for thealiasrecord componentcolumns- the value for thecolumnsrecord componentexpressions- the value for theexpressionsrecord componentresultTypes- the value for theresultTypesrecord component
-
-
Method Details
-
isSelectAll
public boolean isSelectAll()Checks whether this node represents selecting all columns/fields.- Returns:
trueif all columns/fields are selected;falseotherwise
-
previous
Description copied from interface:QueryNodeReturns the previous node in the chain, ornullif this is the root node. -
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). -
hashCode
public int hashCode()Returns a hash code value for this object. The value is derived from the hash code of each of the record components. -
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. -
table
Returns the value of thetablerecord component.- Returns:
- the value of the
tablerecord component
-
dtoClass
Returns the value of thedtoClassrecord component.- Returns:
- the value of the
dtoClassrecord component
-
contextDtoClass
Returns the value of thecontextDtoClassrecord component.- Returns:
- the value of the
contextDtoClassrecord component
-
fromQueryNode
Returns the value of thefromQueryNoderecord component.- Returns:
- the value of the
fromQueryNoderecord component
-
alias
Returns the value of thealiasrecord component.- Returns:
- the value of the
aliasrecord component
-
columns
Returns the value of thecolumnsrecord component.- Returns:
- the value of the
columnsrecord component
-
expressions
Returns the value of theexpressionsrecord component.- Returns:
- the value of the
expressionsrecord component
-
resultTypes
Returns the value of theresultTypesrecord component.- Returns:
- the value of the
resultTypesrecord component
-