SyntaxFix
Write A Post
Hire A Developer
Questions
In JPA 2.0 if you want to delete an address if you removed it from a User entity you can add orphanRemoval=true (instead of CascadeType.REMOVE) to your @OneToMany.
orphanRemoval=true
CascadeType.REMOVE
@OneToMany
More explanation between orphanRemoval=true and CascadeType.REMOVE is here.