From 4162b764707b36592de9705cff01503ab7924c17 Mon Sep 17 00:00:00 2001 From: Mark Paluch Date: Wed, 10 Apr 2024 10:42:41 +0200 Subject: [PATCH] Polishing. Use PositionFunction from OffsetScrollPosition. See: #3409 Original pull request: #3415 --- .../data/jpa/repository/query/ScrollDelegate.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ScrollDelegate.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ScrollDelegate.java index d529b73f7..359dfb6ea 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ScrollDelegate.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/query/ScrollDelegate.java @@ -71,7 +71,7 @@ public class ScrollDelegate { } if (scrollPosition instanceof OffsetScrollPosition offset) { - return createWindow(result, limit, OffsetScrollPosition.positionFunction(offset.isInitial() ? 0 : offset.getOffset())); + return createWindow(result, limit, offset.positionFunction()); } throw new UnsupportedOperationException("ScrollPosition " + scrollPosition + " not supported");