0
아이들을 삭제JPA : 나는 아래로 OneToMany 매핑이 OneToMany
부모 :
@OneToMany(mappedBy = parent, orphanRemoval = true, cascade = { CascadeType.ALL})
private List<Child> childs = new ArrayList<Child>();
아이 :
@ManyToOne
@JoinColumn(name = "parentid")
private Parent parent;
부모 개체를 업데이트하는 동안, 나는 예외를 얻고있다 :
A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance
코드 :
parent.getChild().clear();
parent.setChild(childList)