From ad8e5e1c40a33fbff9a7fd792a3899e7d7088744 Mon Sep 17 00:00:00 2001 From: Otavio Santana Date: Wed, 24 Jan 2024 05:43:32 +0000 Subject: [PATCH] feat: update documentaion Signed-off-by: Otavio Santana --- mongodb/pom.xml | 2 +- .../src/main/java/org/jnosql/demo/se/App.java | 8 +++++--- .../main/java/org/jnosql/demo/se/App2.java | 19 +++++++++++++------ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/mongodb/pom.xml b/mongodb/pom.xml index 5674b1fc..f36a730a 100644 --- a/mongodb/pom.xml +++ b/mongodb/pom.xml @@ -29,7 +29,7 @@ org.eclipse.jnosql.databases jnosql-mongodb - ${jnosql.version} + 1.0.5-SNAPSHOT net.datafaker diff --git a/mongodb/src/main/java/org/jnosql/demo/se/App.java b/mongodb/src/main/java/org/jnosql/demo/se/App.java index f83a3842..a2714027 100644 --- a/mongodb/src/main/java/org/jnosql/demo/se/App.java +++ b/mongodb/src/main/java/org/jnosql/demo/se/App.java @@ -12,13 +12,15 @@ package org.jnosql.demo.se; -import jakarta.data.repository.Page; -import jakarta.data.repository.Pageable; -import jakarta.data.repository.Sort; + +import jakarta.data.Sort; +import jakarta.data.page.Page; +import jakarta.data.page.Pageable; import jakarta.enterprise.inject.se.SeContainer; import jakarta.enterprise.inject.se.SeContainerInitializer; import net.datafaker.Faker; + public class App { diff --git a/mongodb/src/main/java/org/jnosql/demo/se/App2.java b/mongodb/src/main/java/org/jnosql/demo/se/App2.java index 885760ce..0b46822c 100644 --- a/mongodb/src/main/java/org/jnosql/demo/se/App2.java +++ b/mongodb/src/main/java/org/jnosql/demo/se/App2.java @@ -1,15 +1,22 @@ package org.jnosql.demo.se; -import jakarta.data.repository.Page; -import jakarta.data.repository.Pageable; + +import jakarta.data.page.Page; +import jakarta.data.page.Pageable; +import jakarta.enterprise.inject.se.SeContainer; +import jakarta.enterprise.inject.se.SeContainerInitializer; public class App2 { public static void main(String[] args) { - People people = null; - Page page = people.findAll(Pageable.ofPage(2).size(2)); - Pageable nextPageable = page.nextPageable(); - Page page2 = people.findAll(nextPageable); + try (SeContainer container = SeContainerInitializer.newInstance().initialize()) { + People people = container.select(People.class).get();; + + Page page = people.findAll(Pageable.ofPage(2).size(2)); + Pageable nextPageable = page.nextPageable(); + Page page2 = people.findAll(nextPageable); + + } } }