Hibernate: OneToMany save children by cascade
In the class Parent there is a list List. When the parent is saved the children which have been added or changed shall be save / updated by hibernate. I've found many explanations on this, however, I just don't get it to work. Parent.class try A @Entity public class Parent { // id and other attributes @OneToMany(mappedBy = "parent") @org.hibernate.annotations.Cascade(org.hibernate.annotations.CascadeType.ALL) protected List<child> children; Parent.class try B @Entity public class Parent { // id and other attributes @OneToMany(mappedBy = "parent", cascade = { javax.persistence.CascadeType.ALL }