org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class
查看一下导入的Entity包是不是import org.hibernate.annotations.Entity;
如果是换下面这个:
import javax.persistence.Entity;
本文介绍了一个常见的Hibernate问题:使用@OneToMany或@ManyToMany注解时针对未映射的类所引发的AnnotationException,并提供了解决方案,即更换Entity包的导入路径。
org.hibernate.AnnotationException: Use of @OneToMany or @ManyToMany targeting an unmapped class
查看一下导入的Entity包是不是import org.hibernate.annotations.Entity;
如果是换下面这个:
import javax.persistence.Entity;

被折叠的 条评论
为什么被折叠?