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 that contains the given text anywhere in its value, ignoring case.static final OperatorMatches a column whose value ends with the given text.static final OperatorMatches a column whose value ends with the given text, ignoring case, asCONTAINS_IGNORE_CASEmatches it anywhere.static final OperatorThe=operator.static final OperatorMatches a column whose value equals the given text, ignoring case.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 that does not contain the given text, ignoring case, the negation ofCONTAINS_IGNORE_CASE.static final OperatorMatches a column whose value does not end with the given text, the negation ofENDS_WITH.static final OperatorMatches a column whose value does not end with the given text, ignoring case, the negation ofENDS_WITH_IGNORE_CASE.static final OperatorThe<>operator.static final OperatorMatches a column whose value does not equal the given text, ignoring case, the negation ofEQUALS_IGNORE_CASE.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 does not start with the given text, ignoring case, the negation ofSTARTS_WITH_IGNORE_CASE.static final OperatorMatches a column whose value starts with the given text.static final OperatorMatches a column whose value starts with the given text, ignoring case, asCONTAINS_IGNORE_CASEmatches it anywhere. -
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
-
EQUALS_IGNORE_CASE
Matches a column whose value equals the given text, ignoring case.The column and the value are both lowered by the database,
LOWER(column) = LOWER(?), so the comparison ignores case on every database, whatever the column's collation. It ignores case and nothing else: accents are compared as they are, and a database lowers the letters it knows, which on SQLite without ICU are the ASCII letters. A plain index on the column does not serve the lowered comparison; index the lowered expression where it must be served by one, and useEQUALSon a column whose collation ignores case already. The operator applies to a single column holding text.- Since:
- 1.15
-
NOT_EQUALS_IGNORE_CASE
Matches a column whose value does not equal the given text, ignoring case, the negation ofEQUALS_IGNORE_CASE.- Since:
- 1.15
-
CONTAINS_IGNORE_CASE
Matches a column that contains the given text anywhere in its value, ignoring case.The value is literal text, as for
CONTAINS, and the column and the pattern are both lowered by the database:LOWER(column) LIKE LOWER(?) ESCAPE '!'. The comparison ignores case on every database, whatever the column's collation, and nothing else, asEQUALS_IGNORE_CASEdescribes.- Since:
- 1.15
-
NOT_CONTAINS_IGNORE_CASE
Matches a column that does not contain the given text, ignoring case, the negation ofCONTAINS_IGNORE_CASE.- Since:
- 1.15
-
STARTS_WITH_IGNORE_CASE
Matches a column whose value starts with the given text, ignoring case, asCONTAINS_IGNORE_CASEmatches it anywhere.- Since:
- 1.15
-
NOT_STARTS_WITH_IGNORE_CASE
Matches a column whose value does not start with the given text, ignoring case, the negation ofSTARTS_WITH_IGNORE_CASE.- Since:
- 1.15
-
ENDS_WITH_IGNORE_CASE
Matches a column whose value ends with the given text, ignoring case, asCONTAINS_IGNORE_CASEmatches it anywhere.- Since:
- 1.15
-
NOT_ENDS_WITH_IGNORE_CASE
Matches a column whose value does not end with the given text, ignoring case, the negation ofENDS_WITH_IGNORE_CASE.- 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.
-