O'Reilly logo

Hands-On High Performance with Spring 5 by Dinesh Radadiya, Prashant Goswami, Pritesh Shah, Subhash Shah, Chintan Mehta

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring with JPA using Hibernate

As we know, JPA is not an implementation; it is the specification for persistence. The Hibernate framework follows all of the specifications, and it also has its own additional features. Using the JPA specification in an application enables us to easily switch the persistence provider later if needed.

To use Hibernate on its own requires SessionFactory, and to use Hibernate with JPA requires EntityManager. We are going to use JPA, and the following is the Spring Java-based Hibernate JPA configuration:

@Configuration@EnableTransactionManagement@PropertySource({ "classpath:persistence-hibernate.properties" })@ComponentScan({ "com.packt.springhighperformance.ch6.bankingapp" })public class PersistenceJPAConfig ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required