Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FluentQuery when call page(Pagable pagable) automatically call sortBy(Sort sort) if Pageble sort is not null #3238

Open
Mrakobec opened this issue Jan 24, 2025 · 1 comment
Labels
status: waiting-for-triage An issue we've not yet triaged

Comments

@Mrakobec
Copy link

Mrakobec commented Jan 24, 2025

it possible to implement the method fluentQuery.page(Pageble pagable) for automatically call sortBy(Sort sort) if pagable.sort is not null?

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jan 24, 2025
@mp911de
Copy link
Member

mp911de commented Jan 24, 2025

As per our Javadoc:

pageable - the pageable to request a paged result, can be Pageable.unpaged(), must not be null. The given Pageable will override any previously specified sort if the Sort object is not Sort.isUnsorted(). Any potentially specified limit(int) will be overridden by Pageable.getPageSize().

So we expect that Pageable.sort takes precedence over any previously configured Sort if Pageable is sorted.

Care to elaborate what Spring Data module and which API (Querydsl, Specifications, Query by Example) you're using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: waiting-for-triage An issue we've not yet triaged
Projects
None yet
Development

No branches or pull requests

3 participants