In this chapter, we’ll start with the Jakarta Persistence API (JPA), Hibernate, and Spring Data and work through a step-by-step example. We’ll look at the persistence APIs and see the benefits of using either standardized JPA, native Hibernate, or Spring Data.
We’ll begin with a tour through JPA, Hibernate, and Spring Data, looking at a straightforward “Hello World” application. JPA (Jakarta Persistence API, formerly Java Persistence API) is the specification defining an API that manages the persistence of objects and object/relational mappings—it specifies what must be done to persist objects. Hibernate, the most popular implementation of this specification, will make the persistence happen. Spring Data makes the implementation of the persistence layer even more efficient; it’s an umbrella project that adheres to the Spring framework principles and offers an even simpler approach.