How to add persisted entities in a relationship marked with CascadeType.ALL?
问题 I have an Entity with a bidirectional ManyToMany relationship (on the same entity) marked as CascadeType.ALL . Here is how it looks for the Contact entity: @ManyToMany(cascade= CascadeType.ALL) private List<Contact> parentContacts = new ArrayList<Contact>(); @ManyToMany(cascade= CascadeType.ALL, mappedBy="parentContacts") private List<Contact> childContacts = new ArrayList<Contact>(); I have a method on the server side supposed to do save this entity: public AltContact saveContact