java.lang.Object
java.lang.Record
org.litebridge.orm.engine.ast.SetNode
- Record Components:
previous- the previous node in the chaincolumn- the column to updateexpressionSpec- the expression to use instead of the columnvalue- 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 Summary
ConstructorsConstructorDescriptionSetNode(@Nullable QueryNode previous, @Nullable String column, @Nullable ExpressionSpec expressionSpec, @Nullable Object value, @Nullable MathOperator mathOperator) Creates an instance of aSetNoderecord class.Creates a newSetNodeinstance targeting a column by name.SetNode(@Nullable QueryNode previous, ExpressionSpec expressionSpec, @Nullable Object value) Creates a newSetNodeinstance targeting a column by expression specification. -
Method Summary
Modifier and TypeMethodDescription@Nullable Stringcolumn()Returns the value of thecolumnrecord component.booleanIndicates whether some other object is "equal to" this one.@Nullable ExpressionSpecReturns the value of theexpressionSpecrecord component.inthashCode()Returns a hash code value for this object.@Nullable MathOperatorReturns the value of themathOperatorrecord component.@Nullable QueryNodeprevious()Returns the value of thepreviousrecord component.final StringtoString()Returns a string representation of this record class.@Nullable Objectvalue()Returns the value of thevaluerecord component.
-
Constructor Details
-
SetNode
Creates a newSetNodeinstance targeting a column by name.- Parameters:
previous- the previous node in the query node chaincolumn- the column name to setvalue- the value to set
-
SetNode
Creates a newSetNodeinstance targeting a column by expression specification.- Parameters:
previous- the previous node in the query node chainexpressionSpec- the expression specificationvalue- 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 aSetNoderecord class.- Parameters:
previous- the value for thepreviousrecord componentcolumn- the value for thecolumnrecord componentexpressionSpec- the value for theexpressionSpecrecord componentvalue- the value for thevaluerecord componentmathOperator- the value for themathOperatorrecord component
-
-
Method Details
-
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. -
previous
Returns the value of thepreviousrecord component. -
column
Returns the value of thecolumnrecord component.- Returns:
- the value of the
columnrecord component
-
expressionSpec
Returns the value of theexpressionSpecrecord component.- Returns:
- the value of the
expressionSpecrecord component
-
value
Returns the value of thevaluerecord component.- Returns:
- the value of the
valuerecord component
-
mathOperator
Returns the value of themathOperatorrecord component.- Returns:
- the value of the
mathOperatorrecord component
-