Annotation Interface N1QL


@Retention(RUNTIME) @Target(METHOD) public @interface N1QL
Annotation used to define a dynamic N1QL query in CouchbaseRepository. This annotation allows repository methods to be mapped to Couchbase N1QL queries. Parameters can be provided using the Param annotation. Example Usage

 @Repository
 interface ProductRepository extends CouchbaseRepository<Product, String> {

     @N1QL("SELECT * FROM products WHERE category = $category")
     List<Product> findByCategory(@Param("category") String category);
 }
 
  • Required Element Summary

    Required Elements
    Modifier and Type
    Required Element
    Description
    The N1QL query string to be executed.
  • Element Details

    • value

      String value
      The N1QL query string to be executed.
      Returns:
      the N1QL query