The @Repository annotation in Spring Boot is particularly useful when working with _____ to interact with the database.
- @EntityManager
- @Service
- @JpaRepository
- @DataSource
The @Repository annotation in Spring Boot is particularly useful when working with @JpaRepository to interact with the database. @JpaRepository is a Spring Data JPA-specific repository interface that provides out-of-the-box CRUD (Create, Read, Update, Delete) operations. While @Service and other options can be used in Spring applications, they are not typically associated with database interaction like @Repository and @JpaRepository.
Loading...
Related Quiz
- How can you handle validation errors and display them to the user in Spring Boot?
- You are developing a Spring Boot application which has conflicting auto-configuration classes. How would you analyze and resolve these conflicts to ensure the correct configurations are applied?
- In Spring Data JPA, the _____ is responsible for managing transaction boundaries during the execution of a method annotated with @Transactional.
- How can you ensure that the ApplicationContext is not loaded while performing unit testing on web layers in Spring Boot?
- The _____ in a YAML configuration file in Spring Boot is used to represent a list of values.