Thanks xvik that worked perfectly. Such a simple solution.
Thanks Alessandro for helping.
Can I present one more problem?
I created 'Person' class so it can have more Person as children.
I create structure of "Parent" -> "Child" -> "Grand child" and save it. (This works very well)
I read the "Parent" back from DB, it retrieves child and grand child with it. (This also works)
I add one more grand child to this structure.
Now when I save it, the 2nd grandchild is not saved.
I experimented and found that any changes in existing Persons are saved. Also, any new child objects are also saved, however any new grandchild objects are not saved.
Also note that if I add a child as well (code is commented out), then both new objects (1 child and 1 grandchild) are saved.
This feels very strange. Is this expected behavior?
Source files are attached.