Here are the examples of the java api org.hibernate.Session.doReturningWork() taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.
1 Examples
16
Source : HibernateJdbcSession.java
with Apache License 2.0
from akka
with Apache License 2.0
from akka
@Override
public <Result> Result withConnection(Function<Connection, Result> func) {
EnreplacedyManager enreplacedyManager = enreplacedyManager();
Session hibernateSession = ((Session) enreplacedyManager.getDelegate());
return hibernateSession.doReturningWork(new ReturningWork<Result>() {
@Override
public Result execute(Connection connection) throws SQLException {
try {
return func.apply(connection);
} catch (SQLException e) {
throw e;
} catch (Exception e) {
throw new SQLException(e);
}
}
});
}