Difference between @EntityScan and @ComponentScan
The @ComponentScan annotation is used to automatically create beans for every class annotated with @Component, @Service, @Controller, @RestController, @Repository, … and adds them to the Spring container (allowing them to be @Autowired). The @EntityScan on the other hand does not create beans as far as I know. It only identifies which classes should be used … Read more