Accessing Hibernate APIs from JPA
来自ling
Session session = entityManager.unwrap( Session.class ); SessionImplementor sessionImplementor = entityManager.unwrap( SessionImplementor.class ); SessionFactory sessionFactory = entityManager.getEntityManagerFactory().unwrap( SessionFactory.class );