1.问题
生成实体类后,
注解错误:
Entity cannot be resolved to a type
2.分析
jpa依赖hibernate的,项目缺少hibernate的相关依赖
3.解决方案
引入hibernate-jpa-2.1-api依赖
pom文件dependencies标签中添加
<dependency>
<groupId>org.hibernate.javax.persistence</groupId>
<artifactId>hibernate-jpa-2.1-api</artifactId>
<version>1.0.0.Final</version>
</dependency>
再clean一下项目
4.相关资料