Class LiteralExpression

java.lang.Object
org.litebridge.db.spi.expression.LiteralExpression
All Implemented Interfaces:
SelectExpression

public class LiteralExpression extends Object implements SelectExpression
An encapsulated literal value in a query expression.
  • Constructor Details

    • LiteralExpression

      public LiteralExpression(@Nullable Object value)
      Constructs a new LiteralExpression with the given value.
      Parameters:
      value - the literal value to be represented
  • Method Details

    • value

      public @Nullable Object value()
      Retrieves the value of this literal expression.
      Returns:
      the literal value encapsulated by this expression
    • toSql

      public String toSql(Operation operation, ClauseType clause, @Nullable DelegateExpression parent)
      Description copied from interface: SelectExpression
      Creates a SQL representation of the expression, providing the immediate nesting/parent expression.
      Specified by:
      toSql in interface SelectExpression
      Parameters:
      operation - the operation that is being executed
      clause - The current clause type being evaluated
      parent - The parent expression/nesting expression, or null if this is a top-level expression
      Returns:
      the SQL representation of the expression
    • toBindValueSql

      public String toBindValueSql(Operation operation)
      Generates a SQL fragment with a placeholder for a bind value.
      Parameters:
      operation - the database operation context
      Returns:
      the SQL fragment with bind placeholders
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

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

      public String toString()
      Overrides:
      toString in class Object