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 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