You can specify multiple packages there as well. So, do not initialize a class by explicit constructor. The Spring Framework pick it up and configure it in the application context as a Spring Bean. A Java class annotated with Component is found during the classpath. It is used to mark a Java class as a bean. Many SQL databases require this step when used with Spring Data JPA as well. As, that instance will not be registered to Spring for dependency injection. Spring Framework Stereotype Annotations Component: It is a class-level annotation.
0 Comments
Leave a Reply. |