Let's first understand the meaning of @Component, @Repository, and @Service:
1. @Component is a universal stereotype for any Spring-managed component or bean.
2. @Repository is a stereotype for the persistence layer.
3. @Service is a stereotype for the service layer.
This is a good diagram to explain the hierarchy of all these notation:
The difference between them is, @component is used to annotate compound classes, @Repository is a marker for automatic exception translation in the persistence layer, for service layer we need to use @service.
You can refer Spring Documentation to know more.