- Notifications
You must be signed in to change notification settings - Fork 1.5k
Closed
Description
As this code in FetchableFluentQueryBySpecification shows, adding a limit applies the current sorting again.
Lines 96 to 103 in b00220b
| @Override | |
| public FetchableFluentQuery<R> limit(int limit) { | |
| Assert.isTrue(limit >= 0, "Limit must not be negative"); | |
| return new FetchableFluentQueryBySpecification<>(spec, entityType, resultType, this.sort.and(sort), limit, | |
| properties, finder, scroll, countOperation, existsOperation, entityManager, projectionFactory); | |
| } |
In my application, this is causing duplicate order by clause to be included in the SQL generated like order by q1_0."id" desc,q1_0."id" desc, as I call .sortBy first, and then .limit.
Of course, it's easy to fix on the application's side by calling .limit first, but I think this is a bug in the framework, as the other class FetchableFluentQueryByPredicate implementing the same interface does not have this behavior.
Metadata
Metadata
Assignees
Labels
type: bugA general bugA general bug