Skip to content

Modify getQuery(Specification, Pageable) #3517

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

Closed

Conversation

birariro
Copy link
Contributor

@birariro birariro commented Jun 19, 2024

#3476

This problem is not just happening with findAll(pageable pageable)
also occur in findAll(Specification<T> spec, Pageable pageable)

How about fixing it like this?

@Override
public Page<T> findAll(Pageable pageable) {
	return findAll((Specification<T>) null, pageable);
}
protected TypedQuery<T> getQuery(@Nullable Specification<T> spec, Pageable pageable) {
	return getQuery(spec, getDomainClass(), pageable.getSort());
}
  • You have read the Spring Data contribution guidelines.
  • You use the code formatters provided here and have them applied to your changes. Don’t submit any formatting related changes.
  • You submit test cases (unit or integration tests) that back your changes.
  • You added yourself as author in the headers of the classes you touched. Amend the date range in the Apache license header if needed. For new types, add the license header (copy from another file and set the current year only).

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 19, 2024
@christophstrobl christophstrobl self-assigned this Jul 1, 2024
christophstrobl pushed a commit that referenced this pull request Jul 4, 2024
This commit makes sure to pass on a given Sort from an unpaged Pageable to the actual query.

Closes: #3476
Original Pull Request: #3517
@birariro
Copy link
Contributor Author

birariro commented Jul 8, 2024

commit Close PR

@birariro birariro closed this Jul 8, 2024
@mp911de mp911de added type: enhancement A general enhancement and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 14, 2024
@mp911de mp911de added this to the 3.4 M1 (2024.1.0) milestone Nov 14, 2024
@mp911de mp911de linked an issue Nov 14, 2024 that may be closed by this pull request
mp911de pushed a commit that referenced this pull request Feb 17, 2025
This commit makes sure to pass on a given Sort from an unpaged Pageable to the actual query.

Closes: #3476
Original Pull Request: #3517
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: enhancement A general enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sorting of Pageable.unpaged(sort) is ignored by JPA Repository
4 participants