Package st.orm

Interface Operator


public interface Operator
Represents a comparison operator in a SQL query.

Caching contract: Operators may participate in template caching where the operator instance becomes part of the cache key for a compiled SQL shape. Custom operator implementations must therefore implement stable Object.equals(Object) and Object.hashCode() semantics. Two operators must be considered equal (and have the same hash code) if they produce the same SQL shape, so that equivalent templates map to the same cached compilation result.

  • Field Details

    • IN

      static final Operator IN
      The IN operator.
    • NOT_IN

      static final Operator NOT_IN
      The NOT IN operator.
    • EQUALS

      static final Operator EQUALS
      The EXISTS operator.
    • NOT_EQUALS

      static final Operator NOT_EQUALS
      The NOT EXISTS operator.
    • LIKE

      static final Operator LIKE
      The LIKE operator.
    • NOT_LIKE

      static final Operator NOT_LIKE
      The NOT LIKE operator.
    • GREATER_THAN

      static final Operator GREATER_THAN
      The > operator.
    • GREATER_THAN_OR_EQUAL

      static final Operator GREATER_THAN_OR_EQUAL
      The >= operator.
    • LESS_THAN

      static final Operator LESS_THAN
      The < operator.
    • LESS_THAN_OR_EQUAL

      static final Operator LESS_THAN_OR_EQUAL
      The <= operator.
    • BETWEEN

      static final Operator BETWEEN
      The BETWEEN operator.
    • IS_TRUE

      static final Operator IS_TRUE
      The IS TRUE operator.
    • IS_FALSE

      static final Operator IS_FALSE
      The IS FALSE operator.
    • IS_NULL

      static final Operator IS_NULL
      The IS NULL operator.
    • IS_NOT_NULL

      static final Operator IS_NOT_NULL
      The IS NOT NULL operator.
  • Method Details

    • format

      String format(@Nullable String column, String... placeholders)
      Formats the operator with bind variables matching the specified size.
      Parameters:
      column - the column to compare.
      placeholders - the placeholders to use in the template.
      Returns:
      the formatted operator.
      Throws:
      IllegalArgumentException - if the specified size is not supported by the operator.