You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: _posts/2025-06-18-hibernate7-on-quarkus.adoc
+11-9Lines changed: 11 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -10,18 +10,18 @@ author: lmolteni
10
10
11
11
=== Introduction ===
12
12
Hibernate is improving at a very fast speed, and so is its Quarkus support, as great database access is a key part of the Quarkus experience.
13
-
The new Quarkus 3.24 release upgrades Hibernate to version 7, a major breaking change that requires some investigation with the https://docs.jboss.org/hibernate/orm/7.0/migration-guide/migration-guide.html[migration guide] when upgrading.
13
+
The new Quarkus 3.24 release upgrades Hibernate to version 7, a major upgrade that implies some breaking changes, and thus will require some investigation with the https://docs.jboss.org/hibernate/orm/7.0/migration-guide/migration-guide.html[migration guide] when upgrading.
14
14
Developers working on Hibernate and Quarkus are constantly collaborating, so here’s a quick peek at what has happened in the last months and what Quarkus users might expect in the future.
15
15
16
16
=== License and Governance Updates ===
17
17
Both Quarkus and Hibernate are now projects of the https://www.commonhaus.org[Commonhaus Foundation], a non-profit organization dedicated to the sustainability of open-source libraries.
18
18
Since the upgrade to Hibernate 7, Quarkus and all modules of Hibernate now share the same open-source license: the https://www.apache.org/licenses/LICENSE-2.0[Apache License Version 2.0]. Implementing a proper open-source approach is crucial to the success of the two projects.
19
19
20
20
=== Hibernate ORM 7.0 Updates ===
21
-
The new version of Hibernate brings better performance and https://docs.jboss.org/hibernate/orm/7.0/whats-new/whats-new.html[all kinds of features], some of which improve the developer experience, such as https://docs.jboss.org/hibernate/orm/7.0/whats-new/whats-new.html#session-find-multiple[using findMultiple() and getMultiple()] to efficiently fetch entities in batches
21
+
The new version of Hibernate brings better performance and https://docs.jboss.org/hibernate/orm/7.0/whats-new/whats-new.html[all kinds of features], some of which improve the developer experience, such as https://docs.jboss.org/hibernate/orm/7.0/whats-new/whats-new.html#session-find-multiple[using `findMultiple()` and `getMultiple()`] to efficiently fetch entities in batches.
22
22
23
23
==== New Restrictions API ====
24
-
After the deprecation of the Hibernate Criteria API, users were still missing its simplicity, so the Hibernate ORM team introduced a new https://docs.jboss.org/hibernate/orm/7.0/introduction/html_single/Hibernate_Introduction.html#restrictions-and-ordering[Restriction API] that even has new features, such as the possibility to further restrict an already written query using JPQL
24
+
After the deprecation of the Hibernate Criteria API, developers were still missing its simplicity, so the Hibernate team introduced a new https://docs.jboss.org/hibernate/orm/7.0/introduction/html_single/Hibernate_Introduction.html#restrictions-and-ordering[Restriction API] that even has new features, such as the possibility to further restrict an already written query using JPQL/HQL.
25
25
26
26
[source,java]
27
27
----
@@ -37,7 +37,7 @@ var books =
37
37
----
38
38
39
39
==== Support for Jakarta Data ====
40
-
https://jakarta.ee/specifications/data/1.0/jakarta-data-1.0[Jakarta Data] is a simpler way to write data accessing applications, and it’s supported in Quarkus since https://in.relation.to/2024/11/04/data-in-quarkus/[November 2024]. We suggest giving it a try, as many data repositories can benefit from this approach. Simply include the `jakarta.data:jakarta.data-api` dependency with the latest version of Quarkus, i.e.:
40
+
https://jakarta.ee/specifications/data/1.0/jakarta-data-1.0[Jakarta Data] is a simpler way to write data accessing applications, and it’s supported in Quarkus since https://in.relation.to/2024/11/04/data-in-quarkus/[November 2024]. We suggest giving it a try, as it enables a very quick and easy implementation of the DAO/repository patterns, without any boilerplate code and in a type-safe manner. Simply include the `jakarta.data:jakarta.data-api` dependency with the latest version of Quarkus, i.e.:
41
41
42
42
[source,xml]
43
43
----
@@ -69,9 +69,11 @@ public interface Library {
69
69
70
70
This topic deserves a deeper dive, so let us know if you're interested, as we could provide more content.
71
71
72
+
In the meantime, you can always refer to the https://quarkus.io/version/main/guides/hibernate-orm#jakarta-data-2[dedicated Quarkus guide] to get started quickly, and to the https://docs.jboss.org/hibernate/orm/7.0/repositories/html_single/Hibernate_Data_Repositories.html[corresponding documentation in Hibernate ORM] for more advanced usage.
73
+
72
74
=== Hibernate Reactive together with Hibernate ORM ===
73
75
74
-
A long-awaited feature is the ability to https://github.com/quarkusio/quarkus/issues/13425[mix Hibernate ORM and Hibernate Reactive extensions] in the same Quarkus application. Without this feature, making the two extensions coexist required workarounds that are now unnecessary as, since Quarkus 3.2.4, it is now possible to mix the two.
76
+
A long-awaited feature is the ability to https://github.com/quarkusio/quarkus/issues/13425[mix Hibernate ORM and Hibernate Reactive extensions] in the same Quarkus application. Without this feature, making the two extensions coexist required workarounds that are now unnecessary as, since Quarkus 3.24, it is now possible to mix the two.
75
77
Hibernate Reactive is a powerful reactive data access abstraction, but its advantages vary per project. Instead of dictating usage, we enable users to experiment easily with both Hibernate ORM and Reactive. Projects using Hibernate ORM can add the Reactive extension, create reactive resources reusing mapped entities, running tests and benchmarks, and determine if it suits their specific needs and scalability goals. While using both, it’s easier to choose the most suitable approach for different use cases. Another benefit is that it makes it easier to migrate in small steps from one to the other as necessary.
76
78
Panache users will have this possibility in the API as well starting from https://github.com/quarkusio/quarkus/issues/46096[Panache 2.0]
77
79
@@ -81,13 +83,13 @@ The Hibernate Schema Manager is a powerful tool to generate DDL scripts out of J
81
83
82
84
=== The Future ===
83
85
84
-
The teams have many new ideas for the future of the projects: the DevUI of Quarkus will be enhanced with improvements to the developer experience, with the possibility of https://github.com/quarkusio/quarkus/issues/39584[executing arbitrary HQL queries] to try out the syntax and experiment with test data and https://github.com/quarkusio/quarkus/issues/43723[generating migration scripts on the fly]
86
+
The teams have many plans for the future of the projects: the DevUI of Quarkus will be enhanced with improvements to the developer experience, with the possibility of https://github.com/quarkusio/quarkus/issues/39584[executing arbitrary HQL queries] to try out the syntax and experiment with test data and https://github.com/quarkusio/quarkus/issues/43723[generating migration scripts on the fly]
85
87
86
88
image::console.gif[scaledwidth=100%]
87
89
88
90
We’re working on improving the Hibernate Reactive extension as well, by providing support for https://github.com/quarkusio/quarkus/pull/48007[Named Data Sources and Named Persistence Units].
89
91
90
-
Also, as part of giving a better experience for the user, performance and efficiency improvements are constantly refined thanks to the collaboration between the Quarkus and the Hibernate team, for example, an optimization that https://hibernate.atlassian.net/browse/HHH-18326[avoids the need for a IdentityHasMap to track persistence entities] improved the performance by https://github.com/hibernate/hibernate-orm-benchmark/pull/15[8% while running a simple query of 100-1000 immutable entities], end even more when dealing with persistent collections.
91
-
Even bigger performance improvements are expected to be made in the future.
92
+
Also, as part of giving a better experience for the user, the Quarkus and Hibernate teams constantly collaborate on performance and efficiency improvements. For example, an optimization that https://hibernate.atlassian.net/browse/HHH-18326[avoids the need for an `IdentityHasMap` to track persistence entities] improved the performance by https://github.com/hibernate/hibernate-orm-benchmark/pull/15[8% while running a simple query of 100-1000 immutable entities], end even more when dealing with persistent collections.
93
+
And that's just _one_ improvement among many, and not the last one: even bigger performance improvements are expected in the future.
92
94
93
-
Take a look at the new release and let us know what you think!
95
+
https://quarkus.io/guides/update-quarkus[Take a look at the new release] and let us know what you think!
0 commit comments