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
11
11
12
12
[source,java]
13
13
----
14
- Window<User> users = repository.findFirst10ByLastnameOrderByFirstname("Doe", ScrollPosition.offset());
14
+ ScrollPosition position = ScrollPosition.offset();
15
+ Window<User> users;
15
16
do {
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);
23
23
} while (!users.isEmpty() && users.hasNext());
24
24
----
25
25
You can’t perform that action at this time.
0 commit comments