I am trying to understand the difference here. I see that a class has been annotated with both of them with same package example :
@Configuration
@EntityScan("some.known.persistence")
@ComponentScan({ "some.known.persistence"})
public class ApiConfig {
}
I understand the differences from API docs but want to understand in detail. Also does it mean that anything that is scanned by @ComponentScan
is having wider visibility wrt Spring context and @EntityScan
does not. If so using some attribute with @ComponentScan
should have sufficed the need to bind in a JPA context, isn't it?