Reputation: 3031
I have built my application on Hibernate, but now I need to get EntityManager for one third-party module.
Could you please give me some hints how to get JPA objects from Hibernate?
(in my case I have SessionFactory and need EntityManager)
Upvotes: 11
Views: 21073
Reputation: 789
I found this in Hibernate 5.2
Session session = HibernateUtil.getSessionFactory().openSession();
EntityManager em = session.getEntityManagerFactory().createEntityManager();
Upvotes: 15