nerdexam
Broadcom-VMware

2V0-72.22PSE · Question #17

Refer to the exhibit. Which statement is true? (Choose the best answer.)

The correct answer is C. An implementation of this repository can be automatically generated by Spring Data JPA. Spring Data JPA's core power is its ability to automatically generate repository implementations at runtime via proxy objects. When CustomerRepository extends a Spring Data interface like JpaRepository<Customer, Long>, no manual implementation is needed - Spring inspects the…

Data Access

Question

Refer to the exhibit. Which statement is true? (Choose the best answer.)

Options

  • ACustomerRepository should be a class, not an interface.
  • BJPA annotations are required on the Customer class to successfully use Spring Data JDBC.
  • CAn implementation of this repository can be automatically generated by Spring Data JPA.
  • DA class that implements CustomerRepository must be implemented and declared as a Spring

How the community answered

(45 responses)
  • A
    7% (3)
  • B
    2% (1)
  • C
    89% (40)
  • D
    2% (1)

Explanation

Spring Data JPA's core power is its ability to automatically generate repository implementations at runtime via proxy objects. When CustomerRepository extends a Spring Data interface like JpaRepository<Customer, Long>, no manual implementation is needed - Spring inspects the interface and creates a fully functional implementation for you.

Why the distractors are wrong:

  • A is wrong because repositories must be interfaces, not classes - that's precisely what enables Spring Data to generate the proxy implementation.
  • B is wrong because JPA annotations (@Entity, @Id) apply to Spring Data JPA, not Spring Data JDBC, which uses its own simpler mapping model - mixing them up is a common trap.
  • D is wrong because writing a manual implementation class defeats the entire purpose of Spring Data; you never need to implement the interface yourself.

Memory tip: Think of Spring Data repositories as a contract (interface) that Spring fulfills for you automatically - you define what you need, Spring handles how it works. If the question ever suggests you must write or configure the implementation class yourself, that choice is wrong.

Topics

#Spring Data#Repositories#Auto-proxying#JPA

Community Discussion

No community discussion yet for this question.

Full 2V0-72.22PSE Practice