Unwrapping a Session from EntityManager

When we need access to a Hibernate Session, we have to unwrap it from the current EntityManager via the unwrap() method as follows:

// Spring and Java EE EntityManager em = ...;Session session = em.unwrap(Session.class);
Share the Post:
Share on facebook
Share on twitter
Share on linkedin

Related Posts