-
Notifications
You must be signed in to change notification settings - Fork 2.9k
Migration Guide 3.12
Introduction of New Interfaces:
- With spring-data-jpa 3.x
, two new interfaces, ListCrudRepository
and ListPagingAndSortingRepository
, were introduced. These interfaces return List<T>
types, unlike the existing PagingAndSortingRepository
and CrudRepository
, which return Iterable<T>
.
- The class hierarchy has been modified: PagingAndSortingRepository
no longer extends CrudRepository
. Instead, JpaRepository
now extends both CrudRepository
and PagingAndSortingRepository
.
-
To accommodate these changes, the extension’s hierarchy was restructured. Rather than maintaining different implementors, a single implementor now checks the repository type and implements the corresponding methods.
-
All logic is consolidated in the
RepositoryMethodsImplementor
, which implements all repository methods based on the repository type. -
The
SpringDataRestProcessor
has been updated to include the new interfaces and now performs registration in a unified method (registerRepositories
) instead of using two separate methods. -
Unification of PropertiesProvider Classes: these classes have been unified to incorporate the new methods from the
List***Repository
interfaces. -
Updates to
EntityClassHelper
: theEntityClassHelper
has been relocated and now includes new methods used byRepositoryMethodsImplementor
to detect the repository type for implementation. -
Modifications to Tests: the
Paged*Test
no longer checks methods inherited fromCrudRepos
. A new test case,CrudAndPagedResourceTest
, has been added for a repository extending bothCrud
andPaged
repositories.
Note:
The new List**
methods are not specifically exposed via REST, as this is consistent with Spring’s behavior.