Session session = entityManager.unwrap(org.hibernate.Session.class);
2、获得java.sql.Connectio
entityManager.getTransaction().begin();
java.sql.Connection connection = entityManager.unwrap(java.sql.Connection.class);
...
entityManager.getTransaction().commit();
但是对于Hibernate3.6.5会报错PersistenceException包含如下信息:Hibernate cannot unwrap interface java.sql.Connection
SessionImplementor session =entityManager.unwrap(SessionImplementor.class);
session.connection();