Jan 2nd, 2012, 09:59 PM
Spring data-JPA with Hibernate Session API
AFAIK , Spring data only provides a ready-to-go DAO framework for the JPA 's EntityManager use . However , is it possible to use Spring data in Hibernate Session API ?
I know using the standardized JPA interface is the good practise as it allows changing the JPA implementation easily.
But I don't think my application will change to use another persistence implementation in the future .Besides , I am more familiar with Hibernate and it is more feature rich.
Last edited by drupalspring; Jan 3rd, 2012 at 12:33 AM.
Jan 9th, 2012, 06:02 AM
As the name suggests Spring Data JPA is built on top of JPA. Nevertheless it's possible to get access to the underlying persistence provider by casting the EntityManager to the concrete EntityManager type and accessing it's methods then. The reference documentation contains an FAQ entry  showing how to access the underlying SessionFactory as Spring bean from a Hibernate EntityManager. This bean can be injected into a client for low level API usage then.
Tags for this Thread