Odd behavior with Parent/Child cascade persistence

Description

See attached maven project

In the run() method, there are two lines commented (1) and (2). As it stands, the 3rd child does not get persisted. If you comment out line (1), the 3rd child is persisted. Comment it out again and uncomment (2), the 3rd child gets persisted.

Why does the reload of the Parent object in the run() method cause its Children collection not to be saved on a call to saveOrUpdate()?

Attachments

1
  • 14 Dec 2012, 01:12 AM

Activity

Brett MeyerOctober 9, 2013 at 12:25 AM

Please start questions like this in the user forums: https://forum.hibernate.org/viewforum.php?f=1. Open JIRA tickets only when there is a concise, reproduceable issue within ORM. Thanks!

Rejected

Details

Assignee

Reporter

Components

Affects versions

Priority

Created December 14, 2012 at 1:12 AM
Updated October 9, 2013 at 12:25 AM
Resolved October 9, 2013 at 12:25 AM

Flag notifications