考虑班级
@Entity
public class CustomType {
@Column
private String name;
@Column
private CustomType child;
}
我有一种情况,我可以删除child
实体,我希望它级联到它parent
当我尝试这样做时,我看到
Caused by: javax.persistence.PersistenceException: org.hibernate.exception.ConstraintViolationException: DELETE on table 'CustomType' caused a violation of foreign key constraint 'FK197854DCA5BD6640' for key (bece5b16-fafd-49fd-9ff3-cc19b050e174). The statement has been rolled back.
我错过了什么?