The Hibernate team is proud to announce the release of ORM 5.1 which includes a number of new features and enhancements, including:
In HQL you now have the ability to define a join to an entity, not just a mapped association. For example:
select ... from FinancialRecord f left join User u on r.lastUpdateBy = u.username
See HHH-16 for details.
Loading multiple entities of same type by identifier is now a first class API much like loading a single entity by identifier. For example:
// load Users 1, 2 and 3 at one shot List<User> users = session.byMultipleIds(User.class) .multiLoad( 1, 2, 3 );
See HHH-7572 for details.
Especially in regards to in-container integration, we have seen gaps between the JPA, CDI and EE specs in terms of timing between JPA and CDI components. Generally this manifests as Hibernate trying to access the CDI BeanManager too soon. 5.1 offers some solutions to deal with this. Long term we are working with the Weld development team to propose a solution at the JPA and CDI spec levels.
Historically Hibernate would always treat all null column values for an @Embeddable to mean that the @Embeddable should itself be null. 5.1
allows applications to dictate that Hibernate should instead use an empty @Embeddable instance. This is achieved via an opt-in setting:
See HHH-7610 for details.
When deinfing an Envers audit query you can now refer across an association.
A further performance improvement here will be for this feature to leverage the entity-join work (HHH-16) mentioned above. That work did not get done in time for inclusion in 5.1.0, but will be in 5.1.1.
See HHH-3555 for details.
In addition there have been many performance improvements and bug fixes.
For information on consuming the release via your favorite dependency-management-capable build tool, see https://hibernate.org/orm/downloads/