Hibernate cascade save parent and children - parent key not found
I am using Spring, Hibernate and oracle for a project. The database schema was created manually by running sql script. Everything works fine until I encountered a problem with hibernate one-to-many bidirectional cascade save. In the parent class (Product.java) @OneToMany(mappedBy="product", fetch=FetchType.EAGER, cascade={CascadeType.ALL}) public Set<Picture> getPictures() { return pictures; } @Transient public void addPicture(Picture picture) { picture.setProduct(this); pictures.add(picture); } In the child class (Picture.java) @ManyToOne(cascade={CascadeType.ALL}) @JoinColumn(name="lse09lse0
0 upvotes
View original discussion ↗
Comments
Sign in or sign up to comment and upvote.
No comments yet.