读书人

hibernate 中一对多的单向关联 注解的

发布时间: 2012-08-30 09:55:54 作者: rapoo

hibernate 中一对多的单向关联 注解的问题
一端:
@OneToMany
private Set<TbBusinessplanaccount> tbBusinessplanaccounts = new HashSet<TbBusinessplanaccount>(0);

多端:
@ManyToOne
@JoinColumn(name="PRODUCEPLANBOOK_ID")
public TbProduceplanbook getTbProduceplanbook() {
return tbProduceplanbook;
}
异常:
Caused by: org.hibernate.HibernateException: Missing table: Tb_ProducePlanBook_Tb_BusinessplanAccount

我是想让多方为主控端,所以不能设@OneToMany(mappedBy=...).
而且也不要采用关联表.这异常是要我增加关联表.
谢谢.

读书人网 >Web前端

热点推荐