filmov
tv
Spring boot Annotations

Показать описание
1. @ SpringBootApplication -We use this annotation in our application’s main class to enable spring boot features like auto-configuration and component scanning.
@Component - We use this annotation at the class level, classes annotated with @ Component will be scanned as spring-managed beans, and we will not require to write explicit code to scan the customized beans we create.
@ Service - This is to annotate the class as the service layer, this simply means that the class will be holding the business logic of the application, and there is no other use for this annotation.
@Reposiyory - It’s used with the class that deals with the DAO(Data Access Object) layer of the application or It’s used with the repository class which deals with database CRUD operations
@Controller - A class annotated with @ Controller will handle all the user requests and return an appropriate response back. This annotation is used for Restful Web Services to handle Requests and Responses.
@RequestMapping -This annotation is used with @ Controller annotation to map HTTP Request to the appropriate handler method. This can be used at the class level or method level.
@Autowired - Autowired Injects dependency on spring-managed components automatically, in simple words, it initializes objects for you.
@Qualifier - There can be ambiguity in managing dependency injection when spring finds, more than one bean with the same type, with @ Qualifier annotation we can specify the name of the bean we want to inject
@Bean - This is method-level annotation, used on a method that returns a bean to be managed in the spring context. It is commonly used in configuration classes.
@ Configuration- A class annotated with @ Configuration indicates that the class is going to be used to declare multiple methods to return spring beans#learnjava #java #Springboot
@Component - We use this annotation at the class level, classes annotated with @ Component will be scanned as spring-managed beans, and we will not require to write explicit code to scan the customized beans we create.
@ Service - This is to annotate the class as the service layer, this simply means that the class will be holding the business logic of the application, and there is no other use for this annotation.
@Reposiyory - It’s used with the class that deals with the DAO(Data Access Object) layer of the application or It’s used with the repository class which deals with database CRUD operations
@Controller - A class annotated with @ Controller will handle all the user requests and return an appropriate response back. This annotation is used for Restful Web Services to handle Requests and Responses.
@RequestMapping -This annotation is used with @ Controller annotation to map HTTP Request to the appropriate handler method. This can be used at the class level or method level.
@Autowired - Autowired Injects dependency on spring-managed components automatically, in simple words, it initializes objects for you.
@Qualifier - There can be ambiguity in managing dependency injection when spring finds, more than one bean with the same type, with @ Qualifier annotation we can specify the name of the bean we want to inject
@Bean - This is method-level annotation, used on a method that returns a bean to be managed in the spring context. It is commonly used in configuration classes.
@ Configuration- A class annotated with @ Configuration indicates that the class is going to be used to declare multiple methods to return spring beans#learnjava #java #Springboot