Example usage for org.springframework.orm.jpa EntityManagerFactoryInfo getBeanClassLoader

List of usage examples for org.springframework.orm.jpa EntityManagerFactoryInfo getBeanClassLoader

Introduction

In this page you can find the example usage for org.springframework.orm.jpa EntityManagerFactoryInfo getBeanClassLoader.

Prototype

ClassLoader getBeanClassLoader();

Source Link

Document

Return the ClassLoader that the application's beans are loaded with.

Usage

From source file:org.springframework.orm.jpa.ExtendedEntityManagerCreator.java

/**
 * Actually create the EntityManager proxy.
 * @param rawEntityManager raw EntityManager
 * @param emfInfo the EntityManagerFactoryInfo to obtain the JpaDialect
 * and PersistenceUnitInfo from/*from ww  w . j av  a 2s  .c  o m*/
 * @param containerManaged whether to follow container-managed EntityManager
 * or application-managed EntityManager semantics
 * @param synchronizedWithTransaction whether to automatically join ongoing
 * transactions (according to the JPA 2.1 SynchronizationType rules)
 * @return the EntityManager proxy
 */
private static EntityManager createProxy(EntityManager rawEntityManager, EntityManagerFactoryInfo emfInfo,
        boolean containerManaged, boolean synchronizedWithTransaction) {

    Assert.notNull(emfInfo, "EntityManagerFactoryInfo must not be null");
    JpaDialect jpaDialect = emfInfo.getJpaDialect();
    PersistenceUnitInfo pui = emfInfo.getPersistenceUnitInfo();
    Boolean jta = (pui != null ? pui.getTransactionType() == PersistenceUnitTransactionType.JTA : null);
    return createProxy(rawEntityManager, emfInfo.getEntityManagerInterface(), emfInfo.getBeanClassLoader(),
            jpaDialect, jta, containerManaged, synchronizedWithTransaction);
}