What Is JPA?
JPA is the standard Java specifies for object-relational mapping -- Hibernate is the tool that actually implements it.
What Is JPA?
JPA (Jakarta Persistence API, formerly Java Persistence API) is a specification that defines a standard way to map Java objects to relational database tables. It defines annotations like @Entity, @Id, and @Column, and interfaces like EntityManager, but it doesn't include any actual implementation -- that's provided by an ORM framework like Hibernate, EclipseLink, or OpenJPA.
Why JPA Matters
- It's a standard -- code written against JPA annotations isn't locked to one specific ORM vendor
- Spring Data JPA builds directly on it, which is how repository interfaces like findById() work with almost no code
- It defines the entity lifecycle (transient, managed, detached, removed) that every JPA-based app relies on
- It standardizes relationship mapping (@OneToMany, @ManyToOne, @ManyToMany) across implementations
JPA in a Typical Spring Boot App
Adding spring-boot-starter-data-jpa pulls in JPA plus Hibernate as its implementation. You write @Entity classes and a Repository interface; Spring Data JPA generates the implementation of common queries at runtime, and Hibernate translates entity operations into actual SQL against the database.