We have identified a regression in Hibernate 6 where an entity with @Id on multiple columns behaves differently than in Hibernate 5. Specifically, if one of the columns in the @Id annotation is null, the entire row is returned as null, whereas in Hibernate 5, the same code worked correctly. This regression is causing issues in our project, particularly when dealing with stored procedures where it may not always be possible to have a unique identifier for the entity. We would like to either have this bug fixed, or alternatively, have the ability to define a property that allows for the previous behavior seen in Hibernate 5. Steps to reproduce:
- Define an entity with @Id annotation on multiple columns.
- Create a row in the database where one of the columns in the @Id annotation is null.
- Retrieve the entity using Hibernate 6.
Expected result: The entity should be retrieved correctly, with the null column treated as a valid value. Actual result: The entire row is returned as null, which is not the expected behavior. |