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");