I need to extract a connection object from an entity manager
i am trying to do what this text says:
Which is from this page:
java.sql.Connection connection = entityManager.unwrap(java.sql.Connection.class);
UnitOfWork unitOfWork = (UnitOfWork)((JpaEntityManager)entityManager.getDe legate()).getActiveSession();
java.sql.Connection connection = unitOfWork.getAccessor().getConnection();
EclipseLink/Examples/JPA/EMAPI - Eclipsepedia
But i can't understand what is that unitOfWork . Could somesone explain that?
I whould also like to know how to get the jpa version (though i believe mine is 1.0, once the unwrap method is not shown by eclipse).
Thanks in advance.