Giuseppe Milicia (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZTUxYWFlNDBm...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16356?atlOrigin=eyJpIjoiZTUxYW...
) HHH-16356 (
https://hibernate.atlassian.net/browse/HHH-16356?atlOrigin=eyJpIjoiZTUxYW...
) Regression in Hibernate 6, multiple columns @id doesn't allow null value (
https://hibernate.atlassian.net/browse/HHH-16356?atlOrigin=eyJpIjoiZTUxYW...
)
Issue Type: Bug Affects Versions: 6.1.7 Assignee: Unassigned Components: hibernate-core
Created: 22/Mar/2023 09:01 AM Environment: Spring Boot 3, JVM 17 Priority: Major Reporter:
Giuseppe Milicia (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
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.
(
https://hibernate.atlassian.net/browse/HHH-16356#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16356#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100219- sha1:eb3f1fe )