Vlad Mihalcea (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-11496 (
https://hibernate.atlassian.net/browse/HHH-11496?atlOrigin=eyJpIjoiMTFmMz...
)
Re: Wrong insert order for OneToOne associations (
https://hibernate.atlassian.net/browse/HHH-11496?atlOrigin=eyJpIjoiMTFmMz...
)
The best way to create a test case for Hibernate is to fork the repository and create the
test based on some existing one, as explained in this article (
https://in.relation.to/2018/06/04/best-way-write-hibernate-orm-issue-test... ).
You shouldn’t use frameworks like Spring or Lombok, as they could interfere with the
replicating test case.
Once you do that, you should create a new Jira issue, as this one is closed and doesn’t
use the same mappings as your own.
Also, your mappings are wrong. The entity you called Child is actually the parent entity.
The entity you called Parent is the one that contains the FK, so it should be the child
instead.
And, cascading from the child side to the parent is also a mistake. How can a child exist
prior to its parent?
And, you are better off using @MapsId instead of @PrimaryKeyJoinColumn. Check out this
article (
https://vladmihalcea.com/the-best-way-to-map-a-onetoone-relationship-with...
) for more details.
Now, I’m no longer working on the Hibernate project, so once you add the test case as a
Pull Request, someone from the team should review it.
(
https://hibernate.atlassian.net/browse/HHH-11496#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-11496#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#100122- sha1:93a3ad8 )