Today, we published a new maintenance release of Hibernate ORM 6.2: 6.2.2.Final.

What’s new

This release includes several bug fixes and small performance improvements.

Batch fetch performance

The performance of batch fetch loading (@BatchSize) has been improved by better caching of SQL AST and other references where possible. See HHH-16441 for details.

SQL ARRAY for multi-key loads

When loading entities or collections by multiple keys, Hibernate can now utilize a SQL ARRAY valued parameter to pass all ids at once. This is implemented for all multi-key loads:

This is limited to single-column keys and databases which support ARRAY types. In cases where an ARRAY parameter cannot be used, Hibernate falls back to its padded strategy which uses a pre-built SQL AST with a fix-sized IN parameter list.

See HHH-16466 for details.


Table resolution and self referencing associations

We have fixed how Hibernate internally resolves the table references to use in a query, with special care put towards self referencing associations and possible optimizations using foreign key columns (see HHH-16382 and related issues).

Bytecode Enhancement

We have fixed a couple issues related to bytecode enhancement:

  • Faulty code was generated when bidirectional association management was enabled, preventing Hibernate from correctly handling both sides of the association (see HHH-15602).

  • When both a lazy @ManyToOne association and an eager one were used on the same entity, in some cases Hibernate would not eagerly initialize the latter (see HHH-16477).

GROUP BY and ORDER BY clauses

We have fixed several bugs related to GROUP BY and ORDER BY clauses:

  • When grouping by an entity valued property (like a to-one association), we now always expand the rendered GROUP BY clause to use all columns of the entity type to guarantee that the underlying DBMS can correctly group the selections (see HHH-16409).

  • When using window or ordered-set aggregate functions, we now explicitly disallow using aliased or positional expressions in the ORDER BY clause to prevent problematic query interpretation. We also fixed a bug that was preventing users from ordering by multiple column expression in OVER and WITHIN GROUP clauses (see HHH-16347).

@Where clause

We fixed a bug causing the @Where clause to be mis-rendered when used in a delete mutation query, specifically for the subquery to clean up association tables (see HHH-16392).

Sybase and jConnect JDBC driver

We have fixed several issues encountered when using Sybase with the jConnect JDBC driver, for a detailed view of the fixes please see the full list of changes link at the bottom of the page.

Java Records

Support for Java Records annotated with @Embeddable was introduced with Hibernate 6.2, but there were still a couple issues:

  • Java Record embeddables were not included in the JPA metamodel generation (see HHH-16261).

  • Java Record embeddables properties were not correctly ordered in ValueAccess#getValues() (see HHH-16457).


We continue to improve support for using Java Generics in entity classes, this time we solved an issue regarding a generic enum property annotated with @Enumerated (see HHH-16479).

You can find the full list of changes in this version here.


For additional details, see:

Feedback, issues, ideas?

To get in touch, use the usual channels:

Back to top