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

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

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

 

posted @ 2014-10-09 09:59  yiyi_2  阅读(5603)  评论(0编辑  收藏  举报