JpaRepository not implemented/injected when in separate package from componentscan

后端 未结 1 1406
长情又很酷
长情又很酷 2021-01-05 10:27

I have a JpaRepository interface that is not being implemented (or injected?) by Spring data when it\'s in a separate package from the main class containing the @ComponentSc

相关标签:
1条回答
  • 2021-01-05 11:20

    That's probably the expected behaviour (see docs here). The package containing the @EnableAutoConfiguration is actually the default guess for both @EnableJpaRepostories and @EntityScan. You will need both if those packages are disjunct from the main autoconfig package.

    0 讨论(0)
提交回复
热议问题