Skip to content

Commit

Permalink
feat: include oracle nosql database!
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed May 26, 2024
1 parent 624a6c6 commit d64ad82
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
8 changes: 7 additions & 1 deletion oracle-nosql/src/main/java/org/jnosql/demo/se/beer/App4.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,23 @@ public static void main(String[] args) {
BeerRepository repository = container.select(BeerRepository.class).get();
for (int index = 0; index < 100; index++) {
Beer beer = Beer.of(faker);
// repository.save(beer);
//repository.save(beer);

}

PageRequest pageRequest = PageRequest.ofSize(3);
var page1 = repository.style("Stout", pageRequest);
System.out.println("Page 1");
page1.forEach(System.out::println);

PageRequest pageRequest2 = page1.nextPageRequest();
var page2 = repository.style("Stout", pageRequest2);
System.out.println("Page 2");
page2.forEach(System.out::println);

System.out.println("JDQL query: ");

repository.jpql("Stout").forEach(System.out::println);
}

System.exit(0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
*/
package org.jnosql.demo.se.beer;

import java.util.List;
import java.util.Set;

import jakarta.data.page.CursoredPage;
Expand All @@ -36,4 +37,7 @@ public interface BeerRepository extends OracleNoSQLRepository<Beer, String> {
@Find
@OrderBy("hop")
CursoredPage<Beer> style(@By("style") String style, PageRequest pageRequest);

@Query("From Beer where style = ?1")
List<Beer> jpql(String style);
}

0 comments on commit d64ad82

Please sign in to comment.