코드를 사용하여 작업했습니다. 여기에서 사람들은 두 개의 다른 두 개의 @oneToMany를 사용했음을 알 수 있습니다. "예를 들어 삭제 취소를 수행 할 수 없습니다 org.hibernate.AssertionFailure"나는 솔루션을 찾고있었습니다
후 나는 다음 포스트 org.hibernate.AssertionFailure: Unable to perform un-delete for instance 을 참조 온이 이유 실체, 그것은 나에게 의 오류를 보여주는 게시물은 내 문제를 이해하는 데 유용하지만 솔루션이 명확하지 않습니다. 여기에 첫 번째 해결 방법이 있지만 그 또는 그녀는 방금 말했다 - "먼저 C에서 A로 참조를 제거하고 B와 A를 모두 삭제하여이 문제를 해결할 수 있도록 코드를 다시 배열하십시오." 하지만 어떻게? 여기 동일한 엔티티에 여러 개의 @oneToMany를 선언하여 org.hibernate.AssertionFailure를 피할 수있는 방법 : un-delete를 수행 할 수 없습니다.
@Entity
@Table(name="c")
public class C extends BaseEntity{
/**
*
*/
private static final long serialVersionUID = -5610744565502850451L;
private String cCode;
private String cTitle;
private String cOverview;
@ManyToOne
@JoinColumn(name="user_id")
private UserEntity userEntity;
@OneToMany(mappedBy="cEntity",cascade=CascadeType.ALL,fetch=FetchType.EAGER)
private List<LeEntity> leEntity;
@OneToMany(mappedBy="cEntity",cascade=CascadeType.ALL)
@LazyCollection(LazyCollectionOption.FALSE)
private List<LaEntity> laEntity;
이 @where 주석을 제안 할 여기에 설명 ??? –
문제를 찾아 냈습니다. mappedby 대신에 @joinTable annotion을 사용해야한다. –