Now that we have introduced JPA, its role, and the benefits of using Entities, we can now focus on how to configure our Spring application to handle them.
As we said earlier, the JPA is a specification. Choosing a persistence provider (Hibernate, OpenJPA, TopLink, and so on) or a database provider for an application won't be a commitment as long as they match the standards.
We will see that our JPA configuration in Spring is done by defining two beans: datasource and entityManagerFactory. Then, the optional
Spring Data JPA library offers a
JPA repository abstraction that is able to surprisingly simplify some database operations.