As a follow up to this question, I have a parent entity that contains a collection of children entities.
When updating the parent entity I would like to set the collection of children to the new values without having to manually delete (possibly deleting by parent id) the old items on the collection.
Something like this:
parent.set_children(newListOfChildren);
When I do the above the new list of children entities are persisted BUT the old children entities are still all there.
Is there a way to achieve this out-of-the-box?
The alternative I see is to wipe the parent (that wipes all the children too) and then recreate it with the new children, but that feels dodgy!
Any help appreciated.
Assume the following:
From there, you can initialize your schema and then when you lookup the parent object some other time, you can
clear()the list and add new entries.