Class WhereNode

java.lang.Object
org.litebridge.orm.engine.ast.WhereNode
All Implemented Interfaces:
QueryNode

public final class WhereNode extends Object implements QueryNode
Represents a WHERE clause condition in the query AST.
  • Constructor Details

    • WhereNode

      public WhereNode(@Nullable QueryNode previous, QueryNode condition)
      Constructs a new WhereNode instance.
      Parameters:
      previous - the previous node in the chain
      condition - the last embedded condition node for this node
  • Method Details

    • 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
    • condition

      public QueryNode condition()
      Returns the conditions associated with the WHERE clause.

      This is represented as a chained link of query nodes; the last node in the chain is returned.

      Returns:
      the last condition node
    • equals

      public boolean equals(@Nullable Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • withCondition

      public WhereNode withCondition(QueryNode condition)
      Sets the conditions for this WHERE clause, by replacing the current condition.
      Parameters:
      condition - the new condition node
      Returns:
      this node, for method chaining