I have an entity which contains a @OneToMany Set with
Code:
cascade=CascadeType.ALL
andCode:
@Cascade(DELETE_ORPHAN)
I need to update the parent entity (and all of its descendants) using entityManager.merge(...) because the entire object graph is detached. The entity is updated, and the set of child items is first cleared, and then new ones are added. The merge appears to work as requested, but the next time the entity is queried, the removed items from the set are still there (and the new ones are not)!
Am I to understand that DELETE_ORPHAN will not work on a merge with detached entities?