From d08b69d45c74f1e730569e6e228a98ae5c6f5510 Mon Sep 17 00:00:00 2001 From: Bohao Jing Date: Mon, 2 Sep 2024 14:56:30 +0800 Subject: [PATCH] Fix double-sorting usung `limit` of `FetchableFluentQueryBySpecification`. Closes #3600 Original pull request: #3601 --- .../repository/support/FetchableFluentQueryBySpecification.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java index 6121be4374..08659af984 100644 --- a/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java +++ b/spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support/FetchableFluentQueryBySpecification.java @@ -98,7 +98,7 @@ public FetchableFluentQuery limit(int limit) { Assert.isTrue(limit >= 0, "Limit must not be negative"); - return new FetchableFluentQueryBySpecification<>(spec, entityType, resultType, this.sort.and(sort), limit, + return new FetchableFluentQueryBySpecification<>(spec, entityType, resultType, sort, limit, properties, finder, scroll, countOperation, existsOperation, entityManager, projectionFactory); }