Moritz Becker (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiZWRmNmE3NjYz...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16960?atlOrigin=eyJpIjoiZWRmNm...
) HHH-16960 (
https://hibernate.atlassian.net/browse/HHH-16960?atlOrigin=eyJpIjoiZWRmNm...
) OneToOne lazy loading fails when fetch graph is involved (
https://hibernate.atlassian.net/browse/HHH-16960?atlOrigin=eyJpIjoiZWRmNm...
)
Issue Type: Bug Affects Versions: 6.2.6 Assignee: Unassigned Attachments:
one-to-one-loading-issue.zip Components: hibernate-core Created: 20/Jul/2023 07:54 AM
Environment: Spring-Boot 3.1.1 Priority: Major Reporter: Moritz Becker (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
Given:
* Entity with a @OneToOne with a reverse @OneToOne mapping that uses @MapsId
* Fetch graph that does not include the @OneToOne association
* An entity instance persisted where the @OneToOne is not set.
When querying the entity with the fetch graph Hibernate creates a proxy for the
association. When the proxy is accessed, the association does not evaluate to null as
expected but a EntityNotFoundException is thrown.
Find reproducer attached.
one-to-one-loading-issue.zip (
https://hibernate.atlassian.net/rest/api/3/attachment/content/50514 )
.
(
https://hibernate.atlassian.net/browse/HHH-16960#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16960#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#100232- sha1:1e691fe )