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的子类)
.
原创
2020-06-22 21:28:07 ·
1284 阅读 ·
0 评论