What is Spring Data JPA, and how do repository interfaces work with no implementation code?
Must Know🌱 FresherSpring Data JPA sits on top of JPA/Hibernate and eliminates almost all of the boilerplate data-access code (open a session, build a query, map results). You declare a repository interface extending JpaRepository<Entity, IdType> — no implementation class needed. At startup, Spring generates a dynamic proxy implementation of that interface on the fly (using reflection), backed by an actual EntityManager, giving you CRUD, paging, and sorting for free.
interface UserRepository extends JpaRepository<User, Long> {
// save(), findById(), findAll(), delete(), count()... all inherited, already implemented
}