one
one copied to clipboard
A better suggestion about the annotation usage
Hi, I found that there may be some minor improvements about annotations in your code.
A Spring bean in the persistence layer should be annotated using @Repository instead of @Component annotation. @Repository annotation is a specialization of @Component in persistence layer. By using a specialized annotation we hit two birds with one stone. First, they are treated as Spring bean, and second, you can put special behavior required by that layer.
For better understanding and maintainability of a large application, @Repository is a better choice.