Skip to content

Commit 8849272

Browse files
lucamolteniyrodiere
andcommitted
Hibernate 7 on Quarkus: apply suggestions from code review
Co-authored-by: Yoann Rodière <[email protected]>
1 parent 4fb0560 commit 8849272

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

_posts/2025-06-18-hibernate7-on-quarkus.adoc

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: post
33
title: 'Hibernate 7 on Quarkus: every new version is a better database experience for the users'
44
date: 2025-06-18
55
tags: hibernate, database, jpa
6-
synopsis: a roundup on the new upgrades of Hibernate on Quarkus
6+
synopsis: A roundup on the new upgrades of Hibernate on Quarkus.
77
author: lmolteni
88
---
99
:imagesdir: /assets/images/posts/hibernate7
@@ -15,14 +15,14 @@ The new Quarkus 3.24 release upgrades Hibernate to version 7, a major upgrade th
1515
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.
1616

1717
=== License and Governance Updates
18-
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+
Both Quarkus and Hibernate are now projects of the https://www.commonhaus.org[Commonhaus Foundation], a non-profit organization dedicated to creating a collaborative environment for open-source libraries.
1919
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.
2020

2121
=== Hibernate ORM 7.0 Updates
2222
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.
2323

2424
==== Support for Jakarta Data
25-
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.:
25+
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 been 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.:
2626

2727
[source,xml]
2828
----
@@ -60,16 +60,15 @@ In the meantime, you can always refer to the https://quarkus.io/version/main/gui
6060
==== New Restrictions API
6161
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.
6262

63-
[source,text]
63+
[source,java]
6464
----
65-
var books =
65+
List<Book> books =
6666
SelectionSpecification.create(Book.class,
6767
"""
6868
from Book where discontinued = false
6969
""")
7070
.restrict(Restriction.startsWith(Book_.title, "hibernate"))
7171
.sort(Order.desc(Book_.title))
72-
.fetch(Path.from(Book.class).to(Book_publisher))
7372
.createQuery(session)
7473
.setPage(Page.first(50))
7574
.getResultList();

0 commit comments

Comments
 (0)