Which annotation is primarily used in Spring Data JPA to mark a class as a JPA entity?
- @Controller
- @Entity
- @Repository
- @Service
The primary annotation used in Spring Data JPA to mark a class as a JPA entity is @Entity. This annotation indicates that the class represents a persistent entity that can be stored in a relational database using JPA. The other annotations listed are not used for marking classes as JPA entities; they serve different purposes in the Spring framework.
Loading...
Related Quiz
- You are working on a Spring Boot application with multiple service components interacting with each other. How would you isolate and test a single service component ensuring that the interactions with other components are not affecting the test results?
- How can you configure multiple data sources in a Spring Boot application?
- When performing integration testing in Spring Boot, which of the following is used to load only specific slices of the application?
- How can you implement password hashing in Spring Security?
- You are tasked with implementing fine-grained security constraints on service methods in a Spring application. How would you leverage method security expressions to fulfill complex security requirements?