Today, we published a new maintenance release of Hibernate ORM 6.1: 6.1.2.Final.

What’s new

This release introduces a few minor improvements as well as bug fixes.

@Any mapping and HQL function type(…​)

It is now possible to use the HQL function type(…​) to access the type of a polymorphic association.


    public class PropertyHolder {

        @AnyDiscriminatorValue(discriminator = "S", entity = StringProperty.class)
        @AnyDiscriminatorValue(discriminator = "I", entity = IntegerProperty.class)
        @Column(name = "property_type")
        @JoinColumn(name = "property_id")
        private Property property;


    public interface Property {

    public class IntegerProperty implements Property {

we can select the PropertyHolders having a property of type IntegerProperty

List<PropertyHolder> propertyHolders = session.createQuery(
    "select p from PropertyHolder p where type( = IntegerProperty ",
    PropertyHolder.class ).list();


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