File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
src/main/java/os/expert/sample Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
package os .expert .sample ;
2
2
3
+ import jakarta .data .Order ;
4
+ import jakarta .data .Sort ;
5
+ import jakarta .data .page .Page ;
6
+ import jakarta .data .page .PageRequest ;
3
7
import jakarta .enterprise .context .ApplicationScoped ;
4
8
import jakarta .inject .Inject ;
5
9
import org .eclipse .jnosql .mapping .Database ;
@@ -23,7 +27,10 @@ public GoalService(@Database(DatabaseType.DOCUMENT) NewYearWishes newYearWishes)
23
27
}
24
28
25
29
public List <Goal > findGoals (int page , int size ) {
26
- return null ;
30
+ PageRequest pageRequest = PageRequest .ofPage (page ).size (size );
31
+ Order <Goal > priority = Order .by (Sort .asc ("priority" ));
32
+ Page <Goal > goals = newYearWishes .findAll (pageRequest , priority );
33
+ return goals .content ();
27
34
}
28
35
29
36
public Goal save (Goal goal ) {
You can’t perform that action at this time.
0 commit comments