-
Jan 2nd, 2012, 09:59 PM
#1
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
#2
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 [0] 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.
[0] http://static.springsource.org/sprin.../html/#d0e1467
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules