Gajendra Kumar (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *commented* on HHH-13410 (
https://hibernate.atlassian.net/browse/HHH-13410?atlOrigin=eyJpIjoiYjVlNz...
)
Re: "order_inserts = true" causes FK Violation when inserting with a special
case of Unidirectional Relations between 4 Entities (
https://hibernate.atlassian.net/browse/HHH-13410?atlOrigin=eyJpIjoiYjVlNz...
)
This issue is due to below code in ActionQueue as nextBatchIdentifier.parent is assigned a
parent. There can be multiple parents but with this code only one parent reference is
being hold.
for ( int j = i + 1; j < latestBatches.size(); j++ ) {
BatchIdentifier nextBatchIdentifier = latestBatches.get( j );
if ( nextBatchIdentifier.hasAnyParentEntityNames( batchIdentifier ) )
{
nextBatchIdentifier.parent = batchIdentifier;
}
if ( batchIdentifier.hasAnyChildEntityNames( nextBatchIdentifier ) )
{
nextBatchIdentifier.parent = batchIdentifier;
}
}
Fix: parent should be added to nextBatchIdentifier.parentEntityNames
for ( int j = i + 1; j < latestBatches.size(); j++ ) {
BatchIdentifier nextBatchIdentifier = latestBatches.get( j );
if ( nextBatchIdentifier.hasAnyParentEntityNames( batchIdentifier ) )
{
nextBatchIdentifier.parent = batchIdentifier;
nextBatchIdentifier.getParentEntityNames().add(batchIdentifier.getEntityName());
}
if ( batchIdentifier.hasAnyChildEntityNames( nextBatchIdentifier ) )
{
nextBatchIdentifier.parent = batchIdentifier;
nextBatchIdentifier.getParentEntityNames().add(batchIdentifier.getEntityName());
}
}
I’ll create pull request soon 🙂
(
https://hibernate.atlassian.net/browse/HHH-13410#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-13410#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#100133- sha1:d093d11 )