Record Class SelectNode

java.lang.Object
java.lang.Record
org.litebridge.orm.engine.ast.SelectNode
Record Components:
table - name of the table to select from
dtoClass - class of the DTO to select from
contextDtoClass - The parent/context DTO class for determining the correct dtoClass table mapping (for shared DTOs mapped to multiple distinct tables)
fromQueryNode - the query node representing the subquery in the FROM clause
columns - names of the columns to select
expressions - the expressions to select
resultTypes - 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 Details

    • SelectNode

      public SelectNode(String table, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes)
    • SelectNode

      public SelectNode(Class<?> dtoClass, @Nullable Class<?> contextDtoClass, @Nullable String alias, String @Nullable [] columns, ExpressionSpec @Nullable [] expressions, Class<?> @Nullable [] resultTypes)
    • 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 a SelectNode record class.
      Parameters:
      table - the value for the table record component
      dtoClass - the value for the dtoClass record component
      contextDtoClass - the value for the contextDtoClass record component
      fromQueryNode - the value for the fromQueryNode record component
      alias - the value for the alias record component
      columns - the value for the columns record component
      expressions - the value for the expressions record component
      resultTypes - the value for the resultTypes record component
  • Method Details

    • isSelectAll

      public boolean isSelectAll()
      Checks whether this node represents selecting all columns/fields.
      Returns:
      true if all columns/fields are selected; false otherwise
    • previous

      public @Nullable QueryNode previous()
      Description copied from interface: QueryNode
      Returns the previous node in the chain, or null if this is the root node.
      Specified by:
      previous in interface QueryNode
      Returns:
      the previous node
    • equals

      public 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.
    • 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.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • 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
    • table

      public @Nullable String table()
      Returns the value of the table record component.
      Returns:
      the value of the table record component
    • dtoClass

      public @Nullable Class<?> dtoClass()
      Returns the value of the dtoClass record component.
      Returns:
      the value of the dtoClass record component
    • contextDtoClass

      public @Nullable Class<?> contextDtoClass()
      Returns the value of the contextDtoClass record component.
      Returns:
      the value of the contextDtoClass record component
    • fromQueryNode

      public @Nullable QueryNode fromQueryNode()
      Returns the value of the fromQueryNode record component.
      Returns:
      the value of the fromQueryNode record component
    • alias

      public @Nullable String alias()
      Returns the value of the alias record component.
      Returns:
      the value of the alias record component
    • columns

      public String @Nullable [] columns()
      Returns the value of the columns record component.
      Returns:
      the value of the columns record component
    • expressions

      public ExpressionSpec @Nullable [] expressions()
      Returns the value of the expressions record component.
      Returns:
      the value of the expressions record component
    • resultTypes

      public Class<?> @Nullable [] resultTypes()
      Returns the value of the resultTypes record component.
      Returns:
      the value of the resultTypes record component