Skip to content

sebagadisk/SpringBoot-annotations-cheat-sheet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 

Repository files navigation

SpringBoot-annotations-cheat-sheet

Annotations Description
Main Class @SpringBootApplication Spring Boot auto configuration
REST Endpoint @RestController Class with REST endpoints
@RequestMapping REST endpoint method
@PathVariable URI path parameter
@RequestBody HTTP request body
Periodic Tasks @Scheduled Method to run periodically
@EnableScheduling Enable Spring's task scheduling
Beans @Configuration A class containing Spring beans
@Bean Objects to be used by Spring loC for
dependency injection
Spring Managed
Components
@Component A candidate for dependency injection
@Service Like @Component
@Repository Like @Component, for data base access
Persistence @Entity A class which can be stored in the data base
via ORM
@Id Primary key
@GeneratedValue Generation strategy of primary key
@EnableipaRepositories Triggers the search for classes with
@Repository annotation
@EnableTransactionManagement Enable Spring's DB transaction management
through @Beans objects
Miscellaneous @Autowired Force dependency injection
@ConfigurationProperties Import settings from properties file
Testing @SpringBootTest Spring integration test
@AutoConfigureMockMvc Configure MockMvc object to test HTTP

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published