Issue
I found a lot of similar questions
- Difference between Hibernate library and Hibernate JPA library
- href="https://stackoverflow.com/questions/9881611/whats-the-difference-between-jpa-and-hibernate">What's the difference between JPA and Hibernate?
- similarity and difference between jpa and hibernate
but no one answers my next question. What diference between classical hibernate approach using org.hibernate.SessionFactory
and JPA javax.persistence.EntityManager
implementation? I heard, that this JPA implementation uses org.hibernate.SessionFactory
and works like wrapper, is it real?
Solution
Indeed.
JPA is simply an API that allows you to abstract from the used persistence layer. Hibernate provides an implementation of the EntityManager
interface that acts as an adapter
- it uses the same underlying methods as a hibernate SessionManager
.
The idea is that you could, for example, switch your implementation to Eclipse Link and not have to change any of your source code.
Answered By - Boris the Spider
Answer Checked By - Timothy Miller (JavaFixing Admin)