File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
src/main/antora/modules/ROOT/pages/repositories Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -11,15 +11,15 @@ Similar to consuming a Java `Iterator<List<…>>` by obtaining the next batch of
1111
1212[source,java]
1313----
14- Window<User> users = repository.findFirst10ByLastnameOrderByFirstname("Doe", ScrollPosition.offset());
14+ ScrollPosition position = ScrollPosition.offset();
15+ Window<User> users;
1516do {
16-
17- for (User u : users) {
18- // consume the user
19- }
20-
21- // obtain the next Scroll
22- users = repository.findFirst10ByLastnameOrderByFirstname("Doe", users.positionAt(users.size() - 1));
17+ users = repository.findFirst10ByLastnameOrderByFirstname("Doe", position);
18+ for (User u : users) {
19+ // consume the user
20+ }
21+ // update the position
22+ position = users.positionAt(users.size() - 1);
2323} while (!users.isEmpty() && users.hasNext());
2424----
2525
You can’t perform that action at this time.
0 commit comments