spring-data-jpa在SpringBoot多模块项目整合JPA使用时,dao依赖注入失败
试了很多方法,都不行,依赖和jar包都没有少,就是依赖无法注入,找不到Dao层的bean
解决方案:
启动类上添加一**解
@SpringBootApplication(scanBasePackages =“com.example.userdal”)—dao层所在包路径上一层
@EnableEurekaClient
@ComponentScan(“com.example”)
@EnableJpaRepositories(“com.example.userdal.dao”)—dao层包路径(JPA的子类)
@EntityScan(“com.example.userdal.entity”)—实体类所在包路径

至于为什么有待研究,个人觉得是JPA的问题…

相关文章:

  • 2021-07-02
  • 2022-02-10
  • 2022-01-17
  • 2022-02-04
  • 2022-12-23
  • 2021-05-03
  • 2021-12-09
  • 2021-12-31
猜你喜欢
  • 2021-12-28
  • 2021-10-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-23
  • 2021-12-12
相关资源
相似解决方案