-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Migration Guide 3.12
The Hibernate ORM extension for Quarkus now verifies that the database version it connects to at runtime is at least as high as the one configured at build time, even when that configuration is not explicit (i.e. when relying on the defaults that target Quarkus' minimum supported DB versions.
This change was made to make application developers aware they use a version of the database that is no longer considered as supported by Hibernate ORM or Quarkus: in that case, Quarkus will refuse to start with an exception.
This change should only affect a supported database subset and only for older versions:
-
MariaDB older than
10.6
-
MySQL older than
8
-
Oracle Database older than
12
-
Microsoft SQL Server older than
13 (2016)
If the database cannot be upgraded to a supported version, it is still possible to use it, although some features might not work. To continue using an older, unsupported version of a database:
-
If necessary, set the dialect explicitly. In some cases, very old databases versions require using a legacy dialect found in the
hibernate-community-dialects
Maven artifact. See here for more information.
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.