Closed demonfiddler closed 1 week ago
In which project and version did you experience this issue? In JPA, we added this enhancement with 3.4 M1 (spring-projects/spring-data-jpa#3476)
My apologies, it was remiss of me to omit the version info. I am using Spring Boot version 3.3.5 and the problem manifests through spring-boot-starter-data-jpa. Sounds like I should upgrade to 3.4 once it's released. In the meantime I have a workaround which is to call the findAll(Sort) method when an unsorted Pageable is passed.
(BTW before raising this issue I did search the spring-data-commons project for any issues relating to PagingAndSortingRepository but didn't find any of relevance.)
No worries. It could be that the issue affects other modules as well. Closing this one and moving it to JPA.
Passing an unpaged Pageable containing a sorted Sort to the PagingAndSortingRepository.findAll(Pageable) method ignores the Pageable's Sort, generating an SQL SELECT statement that is missing the requisite ORDER BY clause. The following code fragment illustrates the problem: