Wednesday, April 12, 2023

Spring Boot Annotations

  1. @SpringBootApplication - This is the main annotation that is used to start a Spring Boot application. It is a combination of several other annotations, including @Configuration, @EnableAutoConfiguration, and @ComponentScan.

  2. @RestController - This annotation is used to indicate that a class is a RESTful controller that will handle incoming HTTP requests.

  3. @GetMapping, @PostMapping, @PutMapping, @DeleteMapping - These annotations are used to map incoming HTTP requests to specific methods in a controller class.

  4. @Autowired - This annotation is used to automatically wire dependencies between components in the application.

  5. @Value - This annotation is used to inject configuration properties from external configuration files or command-line arguments.

  6. @EnableScheduling - This annotation is used to enable scheduling of tasks within the application.

  7. @Transactional - This annotation is used to mark a method or class as transactional, ensuring that database operations are performed atomically.

 

No comments:

Post a Comment