File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
jnosql-couchbase/src/main/java/org/eclipse/jnosql/databases/couchbase/mapping Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 1919import java .lang .annotation .RetentionPolicy ;
2020import java .lang .annotation .Target ;
2121
22+
2223/**
23- * To a dynamic query on CouchbaseRepository and CouchbaseRepositoryAsync interfaces.
24+ * Annotation used to define a dynamic N1QL query in {@link CouchbaseRepository}.
25+ * <p>
26+ * This annotation allows repository methods to be mapped to Couchbase N1QL queries.
27+ * Parameters can be provided using the {@link Param} annotation.
28+ * </p>
29+ *
30+ * <h2>Example Usage</h2>
31+ * <pre>{@code
32+ * @Repository
33+ * interface ProductRepository extends CouchbaseRepository<Product, String> {
34+ *
35+ * @N1QL("SELECT * FROM products WHERE category = $category")
36+ * List<Product> findByCategory(@Param("category") String category);
37+ * }
38+ * }</pre>
2439 */
2540@ Retention (RetentionPolicy .RUNTIME )
2641@ Target (ElementType .METHOD )
2742public @interface N1QL {
28-
43+ /**
44+ * The N1QL query string to be executed.
45+ *
46+ * @return the N1QL query
47+ */
2948 String value ();
3049}
You can’t perform that action at this time.
0 commit comments