Class N1QLExpression

java.lang.Object
org.springframework.data.couchbase.core.query.N1QLExpression

public class N1QLExpression extends Object
  • Method Details

    • x

      public static N1QLExpression x(String value)
      Creates an arbitrary expression from the given string value. No quoting or escaping will be done on the input. In addition, it is not checked if the given value is an actual valid (N1QL syntax wise) expression.
      Parameters:
      value - the value to create the expression from.
      Returns:
      a new N1QLExpression representing the value.
    • i

      public static N1QLExpression i(String... identifiers)
      An identifier or list of identifiers escaped using backquotes `. Useful for example for identifiers that contains a dash like "beer-sample". Multiple identifiers are returned as a list of escaped identifiers separated by ", ".
      Parameters:
      identifiers - the identifier(s) to escape.
      Returns:
      an N1QLExpression representing the escaped identifier.
    • s

      public static N1QLExpression s(String... strings)
      An identifier or list of identifiers which will be quoted as strings (with "").
      Parameters:
      strings - the list of strings to quote.
      Returns:
      an N1QLExpression representing the quoted strings.
    • TRUE

      public static N1QLExpression TRUE()
      Returns an expression representing boolean TRUE.
      Returns:
      an expression representing TRUE.
    • FALSE

      public static N1QLExpression FALSE()
      Returns an expression representing boolean FALSE.
      Returns:
      an expression representing FALSE.
    • NULL

      public static N1QLExpression NULL()
      Returns an expression representing NULL.
      Returns:
      an expression representing NULL.
    • MISSING

      public static N1QLExpression MISSING()
      Returns an expression representing MISSING.
      Returns:
      an expression representing MISSING.
    • path

      public static N1QLExpression path(Object... pathComponents)
      Construct a path ("a.b.c") from Expressions or values. Strings are considered identifiers (so they won't be quoted).
      Parameters:
      pathComponents - the elements of the path, joined together by a dot.
      Returns:
      the path created from the given components.
    • meta

      public static N1QLExpression meta(N1QLExpression expression)
      Returns:
      metadata for the document expression
    • select

      public static N1QLExpression select(N1QLExpression... expressions)
      Prepends a SELECT to the given expression
    • delete

      public static N1QLExpression delete()
      Begins a delete statement
    • count

      public static N1QLExpression count(N1QLExpression expression)
      Returned expression results in count of all the non-NULL and non-MISSING values in the group.
    • and

      public N1QLExpression and(N1QLExpression right)
      AND-combines two expressions.
      Parameters:
      right - the expression to combine with the current one.
      Returns:
      a combined expression.
    • or

      public N1QLExpression or(N1QLExpression right)
      OR-combines two expressions.
      Parameters:
      right - the expression to combine with the current one.
      Returns:
      a combined expression.
    • as

      public N1QLExpression as(N1QLExpression alias)
      Adds a AS clause between the current and the given expression. Often used to alias an identifier.
      Parameters:
      alias - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • from

      public N1QLExpression from(N1QLExpression bucketName)
    • from

      public N1QLExpression from(String bucketName)
    • where

      public N1QLExpression where(N1QLExpression right)
    • returning

      public N1QLExpression returning(N1QLExpression right)
    • keys

      public N1QLExpression keys(Iterable<? extends Serializable> ids)
    • lower

      public N1QLExpression lower()
      Returned expression results in the given expression in lowercase.
    • convertToString

      public N1QLExpression convertToString()
      Returned expression will be converted to a string
    • eq

      public N1QLExpression eq(N1QLExpression right)
      Combines two expressions with the equals operator ("=").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • eq

      public N1QLExpression eq(boolean value)
    • asc

      public N1QLExpression asc()
    • desc

      public N1QLExpression desc()
    • limit

      public N1QLExpression limit(int limit)
    • offset

      public N1QLExpression offset(int offset)
    • between

      public N1QLExpression between(N1QLExpression right)
      Adds a BETWEEN clause between the current and the given expression.
      Parameters:
      right - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • gt

      public N1QLExpression gt(N1QLExpression right)
      Combines two expressions with the greater than operator (">").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • isNull

      public N1QLExpression isNull()
      Appends a "IS NULL" to the expression.
      Returns:
      the postfixed expression.
    • isNotNull

      public N1QLExpression isNotNull()
      Appends a "IS NOT NULL" to the expression.
      Returns:
      the postfixed expression.
    • ne

      public N1QLExpression ne(N1QLExpression right)
      Combines two expressions with the not equals operator ("!=").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • gte

      public N1QLExpression gte(N1QLExpression right)
      Combines two expressions with the greater or equals than operator (">=").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • lte

      public N1QLExpression lte(N1QLExpression right)
      Combines two expressions with the less or equals than operator ("<=").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • like

      public N1QLExpression like(N1QLExpression right)
      Adds a LIKE clause between the current and the given expression.
      Parameters:
      right - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • notLike

      public N1QLExpression notLike(N1QLExpression right)
      Adds a NOT LIKE clause between the current and the given expression.
      Parameters:
      right - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • in

      public N1QLExpression in(N1QLExpression right)
      Adds a IN clause between the current and the given expression.
      Parameters:
      right - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • notIn

      public N1QLExpression notIn(N1QLExpression right)
      Adds a NOT IN clause between the current and the given expression.
      Parameters:
      right - the right hand side expression.
      Returns:
      a new expression with the clause applied.
    • isNotMissing

      public N1QLExpression isNotMissing()
      Appends a "IS NOT MISSING" to the expression.
      Returns:
      the postfixed expression.
    • lt

      public N1QLExpression lt(N1QLExpression right)
      Combines two expressions with the less than operator ("<").
      Parameters:
      right - the expression to combine.
      Returns:
      the combined expressions.
    • orderBy

      public N1QLExpression orderBy(N1QLExpression... expressions)
    • toString

      public String toString()
      Overrides:
      toString in class Object