snaker-hibernate4/src/main/java/org/snaker/engine/access/hibernate4/Hibernate4Access.java
protected Connection getConnection() throws SQLException {
        if (sessionFactory instanceof SessionFactoryImpl) {
            SessionFactoryImpl sessionFactoryImpl = (SessionFactoryImpl) sessionFactory;
            ConnectionProvider provider = sessionFactoryImpl.getServiceRegistry().getService(ConnectionProvider.class);
            if(provider != null) return provider.getConnection();
        }
        return null;
    }
protected Connection getConnection() throws SQLException {
        if (sessionFactory instanceof SessionFactoryImpl) {
            SessionFactoryImpl sessionFactoryImpl = (SessionFactoryImpl) sessionFactory;
            ConnectionProvider provider = sessionFactoryImpl.getServiceRegistry().getService(ConnectionProvider.class);
            if(provider != null) return provider.getConnection();
        }
        return null;
    }
protected Connection getConnection ( ) throws SQLException { if ( sessionFactory instanceof SessionFactoryImpl ) { SessionFactoryImpl sessionFactoryImpl = ( SessionFactoryImpl ) sessionFactory ; ConnectionProvider provider = sessionFactoryImpl . getServiceRegistry ( ) . getService ( ConnectionProvider . class ) ; if ( provider != null ) return provider . getConnection ( ) ; } return null ; }
取得hibernate的connection对象
取得hibernate的connection对象