diff --git a/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/App4.java b/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/App4.java index 3c50bc61..1e29aba3 100644 --- a/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/App4.java +++ b/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/App4.java @@ -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); diff --git a/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/BeerRepository.java b/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/BeerRepository.java index 6269e9f4..bb72a4a5 100644 --- a/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/BeerRepository.java +++ b/oracle-nosql/src/main/java/org/jnosql/demo/se/beer/BeerRepository.java @@ -14,6 +14,7 @@ */ package org.jnosql.demo.se.beer; +import java.util.List; import java.util.Set; import jakarta.data.page.CursoredPage; @@ -36,4 +37,7 @@ public interface BeerRepository extends OracleNoSQLRepository { @Find @OrderBy("hop") CursoredPage style(@By("style") String style, PageRequest pageRequest); + + @Query("From Beer where style = ?1") + List jpql(String style); } \ No newline at end of file