October 2018
Intermediate to advanced
590 pages
15h 5m
English
As mentioned, Spring Data JPA will instantiate EntityManager for us. EntityManager is an interface of JPA. And, in our application, Hibernate is the underlying implementation. Hibernate offers a more powerful API than JPA. For example, the org.hibernate.query.Query interface supports Generics while the javax.persistence.Query interface does not. In this book, we will use Hibernate's API in our repository implementation most of the time.
To make things easier, let's first create an abstract base class, HibernateSupport, to retrieve an instance of org.hibernate.Session from EntityManager. Here is how it looks:
...abstract class HibernateSupport { EntityManager entityManager; HibernateSupport(EntityManager entityManager) ...Read now
Unlock full access