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 . |