使用Hibernate进行自关联时@ManyToOne 定义的类型Order是接口,需要显示指定实现类
@ManyToOne(fetch=FetchType.LAZY, targetEntity = OrderImpl.class, cascade = CascadeType.MERGE) @JoinColumn(name="PARENT_ORDER_ID") private Order parent;
使用Hibernate进行自关联时@ManyToOne 定义的类型Order是接口,需要显示指定实现类
@ManyToOne(fetch=FetchType.LAZY, targetEntity = OrderImpl.class, cascade = CascadeType.MERGE) @JoinColumn(name="PARENT_ORDER_ID") private Order parent;
转载于:https://www.cnblogs.com/youneverdie/p/4012657.html