【发布时间】:2011-12-22 14:54:03
【问题描述】:
我的 webapp 中有一些名为 Site 的域对象。 站点将包含 IP 地址列表,即
@Entity
class Site {
...
@ManyToMany(fetch=FetchType.LAZY)
public Set<String> ips= new HashSet<String>();
...
}
但当我尝试启动 webapp 时出现错误,休眠已关闭:
Caused by: org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class: my.webapp.Site.ips[java.lang.String]
有什么问题?
【问题讨论】:
标签: java hibernate jpa orm many-to-many