Hibernate 异常:“@OneToOne or @ManyToOne on XXX references an unknown entity: XXX”

作者: yiyi_2
发布时间:2015-08-07 10:42:37

使用Hibernate进行自关联时@ManyToOne 定义的类型Order是接口,需要显示指定实现类

@ManyToOne(fetch=FetchType.LAZY, targetEntity = OrderImpl.class, cascade = CascadeType.MERGE)  
@JoinColumn(name="PARENT_ORDER_ID")  
private Order parent; 

 

标签: Hibernate
来源:http://www.cnblogs.com/youneverdie/p/4012657.html

推荐: