SpringBoot中,@Entity注解不能使用的解决方法
1.首先检查pom.xml配置中有没有添加相关依赖(如果没有复制粘贴以下依赖到pom.xml文件中)
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-data-jpa</artifactId>
</dependency>
2.如果添加依赖后,还是@Entity还是报红,光标放在@Entity后面,按ctrl+1,选择要导的包