Example usage for org.hibernate.internal SessionImpl getJdbcCoordinator

List of usage examples for org.hibernate.internal SessionImpl getJdbcCoordinator

Introduction

In this page you can find the example usage for org.hibernate.internal SessionImpl getJdbcCoordinator.

Prototype

JdbcCoordinator getJdbcCoordinator();

Source Link

Usage

From source file:debop4k.data.orm.jpa.JpaEx.java

License:Apache License

/**
 * entity manager    ? {@link Connection}? .
 *
 * @param em entity manager//from  w w  w . j av a2s. co m
 * @return {@link Connection} ?
 */
public static Connection currentConnection(@NonNull EntityManager em) {
    SessionImpl session = (SessionImpl) em.unwrap(Session.class);

    return session.getJdbcCoordinator().getLogicalConnection().getPhysicalConnection();
}