Context:
Lets say I have 3 entities. Entity A (Portfolio) which contains a list of Entity B (Categories) which contains a list of Entity C (CategoryItems)
Let's say I already have a Portfolio with some categories and category items persisted.
Problem:
If I have a list of Categories and nested CategoryItems. Some of which have ID's as they have already been persisted, and some which are new objects and have null ID's. And maybe some of the category items have been updated and are now nested under a different category.
Is their any easy way to persist this using Hibernate?
Or do we need to manually handle the merge by iterating through the new updated Categories and Items and handle the updates / create the new items.