I have a working application where I use Java EE 6 with EclipseLink for persistence and a PostgreSQL database.
For the User-Registration I want to set the password i
Here is a snippet of code that works with Hibernate 4, based on dulon's answer
Connection getConnection() {
Session session = entityManager.unwrap(Session.class);
MyWork myWork = new MyWork();
session.doWork(myWork);
return myWork.getConnection();
}
private static class MyWork implements Work {
Connection conn;
@Override
public void execute(Connection arg0) throws SQLException {
this.conn = arg0;
}
Connection getConnection() {
return conn;
}
}