SSerguey Asael Shinder
Java coding notes: the JVM, and writing software that lasts

Serguey Asael Shinder: Hibernate 7.4.13 fixes quoted aliases from HQL subqueries and adds Java 27 support

· by Serguey Asael Shinder / Serguey Shinder

Hibernate ORM 7.4.13.Final was published shortly after midnight UTC on 11 October. As with the previous patches, the release notes only link to the issue tracker; the list of issues fixed in 7.4.13 has three entries, and the comparison with 7.4.12 shows ten commits. Two of the three are worth knowing about.

Quoted aliases from subqueries. HHH-17354 was reported in October 2023 and is fixed now, three years later. HQL lets you quote an identifier with back-ticks, which is how you give a column an alias containing a space. That worked at the top level:

select prod.item_id as `Item ID`
from Product prod
Serguey Asael Shinder: Hibernate 7.4.13 fixes quoted aliases from HQL subqueries and adds Java 27 support
Hibernate 7.4.13 fixes quoted aliases from HQL subqueries and adds Java 27 support — Serguey Asael Shinder

It did not work once the quoted alias came from a derived table — a subquery in the from clause — and the outer query tried to use it:

select prod2.`Item ID`
from (select prod.item_id as `Item ID`
      from Product prod) prod2

The reporter noted that the first form only appeared to work because the alias never reached the generated SQL. In the second, the outer query has to resolve the alias against the subquery's select list, and the parser did not handle the quoting there. The fix landed in the 8.0 line and was cherry-picked to 7.4, with a follow-up commit adjusting an import after the cherry-pick.

Envers with joined inheritance and a secondary table. HHH-20906 covers entities that combine @Audited, JOINED inheritance and @SecondaryTable. The issue itself only points to a failing test; the commit title describes the fix as "Retain audited secondary table references", which indicates that audit data for the secondary table was being lost in that combination. If you audit such entities, check your audit tables after upgrading.

Java 27. HHH-20957 upgrades ByteBuddy to 1.18.14. It was raised from the WildFly side: deployments using Jakarta Persistence on JDK 27 failed with IllegalStateException: Could not invoke proxy: Type not available on current VM, coming from ByteBuddy's class-file reader. The commits also remove the net.bytebuddy.experimental=true workaround from the Java 27 CI build and add a test that flags it if it creeps back.

Upgrade notes. It is a drop-in patch on the 7.4 line. The two parser and Envers fixes also ship in 8.0; the ByteBuddy upgrade is recorded for 8.0 and 8.1 as well.