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 OperatorMatches a column that contains the given text anywhere in its value.static final OperatorMatches a column whose value ends with the given text.static final OperatorThe=operator.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 OperatorMatches a column that does not contain the given text, the negation ofCONTAINS.static final OperatorMatches a column whose value does not end with the given text, the negation ofENDS_WITH.static final OperatorThe<>operator.static final OperatorTheNOT INoperator.static final OperatorTheNOT LIKEoperator.static final OperatorMatches a column whose value does not start with the given text, the negation ofSTARTS_WITH.static final OperatorMatches a column whose value starts with the given text. -
Method Summary
-
Field Details
-
IN
TheINoperator. -
NOT_IN
TheNOT INoperator. -
EQUALS
The=operator. -
NOT_EQUALS
The<>operator. -
LIKE
TheLIKEoperator. -
NOT_LIKE
TheNOT LIKEoperator. -
CONTAINS
Matches a column that contains the given text anywhere in its value.The value is literal text rather than a pattern: Storm escapes the characters the database reads as wildcards, adds the wildcards itself and renders
column LIKE ? ESCAPE '!', so50%matches exactly50%on every database. Empty text matches every non-null value. Case sensitivity follows the column's collation, as it does forLIKE. The operator applies to a single column holding text.- Since:
- 1.15
-
NOT_CONTAINS
Matches a column that does not contain the given text, the negation ofCONTAINS.- Since:
- 1.15
-
STARTS_WITH
Matches a column whose value starts with the given text. The value is literal text, as forCONTAINS.- Since:
- 1.15
-
NOT_STARTS_WITH
Matches a column whose value does not start with the given text, the negation ofSTARTS_WITH.- Since:
- 1.15
-
ENDS_WITH
Matches a column whose value ends with the given text. The value is literal text, as forCONTAINS.- Since:
- 1.15
-
NOT_ENDS_WITH
Matches a column whose value does not end with the given text, the negation ofENDS_WITH.- Since:
- 1.15
-
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 column is null but required by the operator, or if the number of placeholders is not supported by the operator.
-