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 Summary
FieldsModifier and TypeFieldDescriptionstatic final OperatorTheBETWEENoperator.static final OperatorTheEXISTSoperator.static final OperatorThe>operator.static final OperatorThe>=operator.static final OperatorTheINoperator.static final OperatorTheIS FALSEoperator.static final OperatorTheIS NOT NULLoperator.static final OperatorTheIS NULLoperator.static final OperatorTheIS TRUEoperator.static final OperatorThe<operator.static final OperatorThe<=operator.static final OperatorTheLIKEoperator.static final OperatorTheNOT EXISTSoperator.static final OperatorTheNOT INoperator.static final OperatorTheNOT LIKEoperator. -
Method Summary
-
Field Details
-
IN
TheINoperator. -
NOT_IN
TheNOT INoperator. -
EQUALS
TheEXISTSoperator. -
NOT_EQUALS
TheNOT EXISTSoperator. -
LIKE
TheLIKEoperator. -
NOT_LIKE
TheNOT LIKEoperator. -
GREATER_THAN
The>operator. -
GREATER_THAN_OR_EQUAL
The>=operator. -
LESS_THAN
The<operator. -
LESS_THAN_OR_EQUAL
The<=operator. -
BETWEEN
TheBETWEENoperator. -
IS_TRUE
TheIS TRUEoperator. -
IS_FALSE
TheIS FALSEoperator. -
IS_NULL
TheIS NULLoperator. -
IS_NOT_NULL
TheIS NOT NULLoperator.
-
-
Method Details
-
format
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.
-