我有以下两个实体:
1- 交易
@OneToMany(cascade=CascadeType.ALL,mappedBy = "deal", fetch = FetchType.EAGER)
@Fetch( FetchMode.SELECT)
private List<DealCheckList> dealCheckList;
2- 交易清单
@JoinColumn(name = "DEAL_ID", referencedColumnName = "DEAL_ID", insertable = false, updatable = false)
@ManyToOne(fetch = FetchType.LAZY)
private Deal deal;
在这样做session.delete(deal)
时,我收到以下错误
Caused by: org.hibernate.ObjectDeletedException: deleted object would be re-saved by cascade (remove deleted object from associations):
请帮忙。