quarkusio / quarkus

Quarkus: Supersonic Subatomic Java.
https://quarkus.io
Apache License 2.0
13.54k stars 2.61k forks source link

Spring Data JpaRepository pagination and sorting doesn't work after bump to Spring Boot 3.2 #41136

Closed michalvavrik closed 2 months ago

michalvavrik commented 2 months ago

Describe the bug

After https://github.com/quarkusio/quarkus/pull/40344 I detected a change to behavior. I have REST repo like this:

public interface ArticleJpaRepository extends JpaRepository<Article, Long> {
}

previous when I send request to /article-jpa with query params size and page I received paginated results. That doesn't seem to be true anymore even though JpaRepository still extends PagingAndSortingRepository. Now I receive all the results, response is not paginated.

Also, sorting with sort query param stopped to work as well.

Expected behavior

I could be missing some new required change, so either it could be documented or fixed.

Actual behavior

Unsorted and unpaginated results.

How to Reproduce?

  1. git clone git@github.com:michalvavrik/quarkus-test-suite.git -b feature/fix-spring-data-compilation
  2. cd quarkus-test-suite/spring/spring-data
  3. mvn clean verify -Dit.test=JpaRepositoryRestResourceIT#sorting -Dreruns=0 and mvn clean verify -Dit.test=JpaRepositoryRestResourceIT#pagination -Dreruns=0

Output of uname -a or ver

Fedora 38

Output of java -version

OpenJDK 21

Quarkus version or git rev

999-SNAPSHOT

Build tool (ie. output of mvnw --version or gradlew --version)

Apache Maven 3.9.4

Additional information

No response

quarkus-bot[bot] commented 2 months ago

/cc @geoand (spring)

michalvavrik commented 2 months ago

/cc @aureamunoz

jedla97 commented 2 months ago

Just my observation from fixing different testsuite.

Parameters mentioned above are working when using CrudRepository and PagingAndSortingRepository. Not working when using ListCrudRepository and ListPagingAndSortingRepository. These two extending JpaRepository. So maybe this will be helpful when looking for fix

aureamunoz commented 2 months ago

I mananaged to fix but I still need to add some tests. It's going to need a new release of quarkus-spring-api @gsmet. I'll let you know soon

michalvavrik commented 2 months ago

I mananaged to fix but I still need to add some tests.

thanks for info and working on it

geoand commented 2 months ago

Fixed by #41206