Question: what is the difference between @repository and @component?
Answer: 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.