Announcement Announcement Module
No announcement yet.
Spring data-JPA with Hibernate Session API Page Title Module
Move Remove Collapse
Conversation Detail Module
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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, 12:33 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.