Skip to content

Commit

Permalink
docs: update query
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <otaviopolianasantana@gmail.com>
  • Loading branch information
otaviojava committed Apr 29, 2023
1 parent de83479 commit eca9402
Showing 1 changed file with 3 additions and 22 deletions.
25 changes: 3 additions & 22 deletions spec/src/main/asciidoc/chapters/api/query.adoc
Expand Up @@ -22,27 +22,8 @@ It is important to note that the Jakarta NoSQL specification does not specify th

Overall, the Jakarta NoSQL API's support for query by text provides Java developers with a flexible and intuitive way to perform CRUD operations on NoSQL databases. Although the query syntax is vendor-specific, the common interfaces and methods provided by the Jakarta NoSQL API make it easy to work with any NoSQL database that supports queries by text. The ability to dynamically bind parameters to a query at runtime adds extra flexibility, allowing developers to adapt their queries to changing requirements.

===== Key-Value Database Types

[source,java]
----
KeyValueTemplate template = // instance;
Stream<User> users = template.query("get \"Diana\"");
template.query("remove \"Diana\"");
----

===== Column-Family Database Types

[source,java]
----
ColumnTemplate template = // instance;
Stream<Person> result = template.query("select * from Person where id = 1");
----

===== Document Database Types

[source,java]
----
DocumentTemplate template = // instance;
Stream<Person> result = template.query("select * from Person where age > 10");
----
Template template = // instance;
Stream<Person> result = template.query("provider query");
----

0 comments on commit eca9402

Please sign in to comment.