1.首先检查pom.xml配置中有没有添加相关依赖(如果没有复制粘贴以下依赖到pom.xml文件中)

    <dependency>
          <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-data-jpa</artifactId>
    </dependency>

2.如果添加依赖后,还是@Entity还是报红,光标放在@Entity后面,按ctrl+1,选择要导的包

SpringBoot中,@Entity注解不能使用的解决方法

SpringBoot中,@Entity注解不能使用的解决方法

相关文章:

  • 2021-10-31
  • 2022-12-23
  • 2022-12-23
  • 2021-12-08
  • 2022-12-23
  • 2022-03-10
  • 2022-12-23
猜你喜欢
  • 2021-12-28
  • 2022-12-23
  • 2023-03-14
  • 2021-12-19
  • 2022-12-23
  • 2021-08-20
相关资源
相似解决方案