I am already using ComponentScan
annotation in Main
class of Spring Boot
app , but If I use only this annotation it will gives issue while getting repositories reference. So to overcome this I am using EntityScan
and EnableJpaRepositories
annotations with componentScan
.
@EntityScan(basePackages={"com.gonkar.fleetms.models"})
@EnableJpaRepositories(basePackages={"com.gonkar.fleetms.repositories"})
So my question is why its required to use other two annotations? if I am already using @ComponentScan
.