Class OldN1qlQueryCreator
java.lang.Object
org.springframework.data.repository.query.parser.AbstractQueryCreator<N1QLExpression,N1QLExpression>
org.springframework.data.couchbase.repository.query.OldN1qlQueryCreator
- All Implemented Interfaces:
PartTreeN1qlQueryCreator
- Direct Known Subclasses:
N1qlCountQueryCreator
public class OldN1qlQueryCreator
extends AbstractQueryCreator<N1QLExpression,N1QLExpression>
implements PartTreeN1qlQueryCreator
This
The following are not supported and will throw an
Query Creator is responsible for parsing a PartTree (representing a method
name) into the WHERE clause of a N1QL query.
In the following, "field" represents the path in JSON deduced from the part of the method name. "a" and "b" represent
the values of next consumed method parameters. "array" represent a JsonArray constructed from the next method
parameter value (if a collection or array, contained values are used to fill the array, otherwise it's a single item
array).
Here are the Part.Type supported (field:
- BETWEEN: field BETWEEN a AND b
- IS_NOT_NULL: field IS NOT NULL
- IS_NULL: field IS NULL
- NEGATING_SIMPLE_PROPERTY: - field != a
- SIMPLE_PROPERTY: - field = a
- LESS_THAN: field < a
- LESS_THAN_EQUAL: field <= a
- GREATER_THAN_EQUAL: field >= a
- GREATER_THAN: field > a
- BEFORE: field < a
- AFTER: field > a
- NOT_LIKE: field NOT LIKE "a" - a should be a String containing % and _ (matching n and 1 characters)
- LIKE: field LIKE "a" - a should be a String containing % and _ (matching n and 1 characters)
- STARTING_WITH: field LIKE "a%" - a should be a String prefix
- ENDING_WITH: field LIKE "%a" - a should be a String suffix
- NOT_CONTAINING: field NOT LIKE "%a%" - a should be a String
- CONTAINING: field LIKE "%a%" - a should be a String
- NOT_IN: field NOT IN array - note that the next parameter value (or its children if a collection/array)
should be compatible for storage in a
JsonArray) - IN: field IN array - note that the next parameter value (or its children if a collection/array) should be
compatible for storage in a
JsonArray) - TRUE: field = TRUE
- FALSE: field = FALSE
- REGEX: REGEXP_LIKE(field, "a") - note that the ignoreCase is ignored here, a is a regular expression in String form
- EXISTS: field IS NOT MISSING - used to verify that the JSON contains this attribute
The following are not supported and will throw an
IllegalArgumentException if encountered:
- NEAR, WITHIN: geospatial is not supported in N1QL as of now
- Author:
- Simon Baslé, Subhashni Balakrishnan, Mark Paluch
-
Constructor Summary
ConstructorsConstructorDescriptionOldN1qlQueryCreator(PartTree tree, ParameterAccessor parameters, N1QLExpression selectFrom, CouchbaseConverter converter, CouchbaseQueryMethod queryMethod) -
Method Summary
Modifier and TypeMethodDescriptionprotected N1QLExpressionand(Part part, N1QLExpression base, Iterator<Object> iterator) protected N1QLExpressioncomplete(N1QLExpression criteria, Sort sort) protected N1QLExpressioncom.couchbase.client.java.json.JsonValueGet the named placeholder valuesprotected N1QLExpressionor(N1QLExpression base, N1QLExpression criteria) Methods inherited from class org.springframework.data.repository.query.parser.AbstractQueryCreator
createQuery, createQuery
-
Constructor Details
-
OldN1qlQueryCreator
public OldN1qlQueryCreator(PartTree tree, ParameterAccessor parameters, N1QLExpression selectFrom, CouchbaseConverter converter, CouchbaseQueryMethod queryMethod)
-
-
Method Details
-
create
- Specified by:
createin classAbstractQueryCreator<N1QLExpression,N1QLExpression>
-
and
- Specified by:
andin classAbstractQueryCreator<N1QLExpression,N1QLExpression>
-
or
- Specified by:
orin classAbstractQueryCreator<N1QLExpression,N1QLExpression>
-
complete
- Specified by:
completein classAbstractQueryCreator<N1QLExpression,N1QLExpression>
-
getPlaceHolderValues
public com.couchbase.client.java.json.JsonValue getPlaceHolderValues()Description copied from interface:PartTreeN1qlQueryCreatorGet the named placeholder values- Specified by:
getPlaceHolderValuesin interfacePartTreeN1qlQueryCreator
-