Class ConditionSpec

java.lang.Object
org.litebridge.orm.api.select.model.ConditionSpec

public class ConditionSpec extends Object
Specification for a condition in a database query.

This is used in a SQL query WHERE clause, JOIN clause, etc.

A condition consists of a column, an operator, and an optional value. The operator dictates how the column will be compared to the provided value.

  • Constructor Details

    • ConditionSpec

      public ConditionSpec()
  • Method Details

    • getLhs

      public ExpressionSpec getLhs()
      Gets the left-hand side expression of the condition.
      Returns:
      the LHS expression
    • setLhs

      public void setLhs(ExpressionSpec lhs)
      Sets the left-hand side expression of the condition.
      Parameters:
      lhs - the LHS expression to set
    • setLhs

      public void setLhs(Column column)
      Sets the left-hand side expression of the condition to a specific column.
      Parameters:
      column - the column to set as LHS
    • getOperator

      public Operator getOperator()
      Gets the operator used in the condition.
      Returns:
      the operator
    • setOperator

      public void setOperator(Operator operator)
      Sets the operator for the condition.
      Parameters:
      operator - the operator to set
    • getValue

      public @Nullable Object getValue()
      Gets the right-hand side value of the condition.
      Returns:
      the RHS value, or null
    • setValue

      public void setValue(@Nullable Object value)
      Sets the right-hand side value for the condition.
      Parameters:
      value - the RHS value to set
    • toCondition

      public Condition toCondition(SelectExpressionMapper selectExpressionMapper, Collection<Table> selectedTables)
      Converts this specification into a Condition.
      Parameters:
      selectExpressionMapper - the mapper to use for expressions
      selectedTables - the collection of tables included in the query
      Returns:
      the resulting Condition
    • toString

      public String toString()
      Overrides:
      toString in class Object