Record Class SetNode

java.lang.Object
java.lang.Record
org.litebridge.orm.engine.ast.SetNode
Record Components:
previous - the previous node in the chain
column - the column to update
expressionSpec - the expression to use instead of the column
value - the value to set (or use in the math operation, if specified)
mathOperator - optional math operator to use when setting the value
All Implemented Interfaces:
QueryNode

public record SetNode(@Nullable QueryNode previous, @Nullable String column, @Nullable ExpressionSpec expressionSpec, @Nullable Object value, @Nullable MathOperator mathOperator) extends Record implements QueryNode
Represents a SET clause in an UPDATE statement in the query AST.
  • Constructor Details

    • SetNode

      public SetNode(@Nullable QueryNode previous, String column, @Nullable Object value)
      Creates a new SetNode instance targeting a column by name.
      Parameters:
      previous - the previous node in the query node chain
      column - the column name to set
      value - the value to set
    • SetNode

      public SetNode(@Nullable QueryNode previous, ExpressionSpec expressionSpec, @Nullable Object value)
      Creates a new SetNode instance targeting a column by expression specification.
      Parameters:
      previous - the previous node in the query node chain
      expressionSpec - the expression specification
      value - the value to set
    • SetNode

      public SetNode(@Nullable QueryNode previous, @Nullable String column, @Nullable ExpressionSpec expressionSpec, @Nullable Object value, @Nullable MathOperator mathOperator)
      Creates an instance of a SetNode record class.
      Parameters:
      previous - the value for the previous record component
      column - the value for the column record component
      expressionSpec - the value for the expressionSpec record component
      value - the value for the value record component
      mathOperator - the value for the mathOperator record component
  • Method Details

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

      public @Nullable QueryNode previous()
      Returns the value of the previous record component.
      Specified by:
      previous in interface QueryNode
      Returns:
      the value of the previous record component
    • column

      public @Nullable String column()
      Returns the value of the column record component.
      Returns:
      the value of the column record component
    • expressionSpec

      public @Nullable ExpressionSpec expressionSpec()
      Returns the value of the expressionSpec record component.
      Returns:
      the value of the expressionSpec record component
    • value

      public @Nullable Object value()
      Returns the value of the value record component.
      Returns:
      the value of the value record component
    • mathOperator

      public @Nullable MathOperator mathOperator()
      Returns the value of the mathOperator record component.
      Returns:
      the value of the mathOperator record component