Java 类org.springframework.boot.orm.jpa.hibernate.SpringJtaPlatform 实例源码

项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HibernateJpaAutoConfiguration.java   
private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
        JtaTransactionManager jtaTransactionManager) {
    try {
        vendorProperties.put(JTA_PLATFORM,
                new SpringJtaPlatform(jtaTransactionManager));
    }
    catch (LinkageError ex) {
        // NoClassDefFoundError can happen if Hibernate 4.2 is used and some
        // containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
        if (!isUsingJndi()) {
            throw new IllegalStateException("Unable to set Hibernate JTA "
                    + "platform, are you using the correct "
                    + "version of Hibernate?", ex);
        }
        // Assume that Hibernate will use JNDI
        if (logger.isDebugEnabled()) {
            logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
        }
    }
}
项目:spring-boot-concourse    文件:HibernateJpaAutoConfiguration.java   
private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
        JtaTransactionManager jtaTransactionManager) {
    try {
        vendorProperties.put(JTA_PLATFORM,
                new SpringJtaPlatform(jtaTransactionManager));
    }
    catch (LinkageError ex) {
        // NoClassDefFoundError can happen if Hibernate 4.2 is used and some
        // containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
        if (!isUsingJndi()) {
            throw new IllegalStateException("Unable to set Hibernate JTA "
                    + "platform, are you using the correct "
                    + "version of Hibernate?", ex);
        }
        // Assume that Hibernate will use JNDI
        if (logger.isDebugEnabled()) {
            logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
        }
    }
}
项目:contestparser    文件:HibernateJpaAutoConfiguration.java   
private void configureSpringJtaPlatform(Map<String, Object> vendorProperties,
        JtaTransactionManager jtaTransactionManager) {
    try {
        vendorProperties.put(JTA_PLATFORM,
                new SpringJtaPlatform(jtaTransactionManager));
    }
    catch (LinkageError ex) {
        // NoClassDefFoundError can happen if Hibernate 4.2 is used and some
        // containers (e.g. JBoss EAP 6) wraps it in the superclass LinkageError
        if (!isUsingJndi()) {
            throw new IllegalStateException("Unable to set Hibernate JTA "
                    + "platform, are you using the correct "
                    + "version of Hibernate?", ex);
        }
        // Assume that Hibernate will use JNDI
        if (logger.isDebugEnabled()) {
            logger.debug("Unable to set Hibernate JTA platform : " + ex.getMessage());
        }
    }
}
项目:https-github.com-g0t4-jenkins2-course-spring-boot    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isInstanceOf(SpringJtaPlatform.class);
}
项目:spring-boot-concourse    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"))
            .isInstanceOf(SpringJtaPlatform.class);
}
项目:contestparser    文件:HibernateJpaAutoConfigurationTests.java   
@Test
public void defaultJtaPlatform() throws Exception {
    this.context.register(JtaProperties.class, JtaAutoConfiguration.class);
    setupTestConfiguration();
    this.context.refresh();
    Map<String, Object> jpaPropertyMap = this.context
            .getBean(LocalContainerEntityManagerFactoryBean.class)
            .getJpaPropertyMap();
    assertThat(jpaPropertyMap.get("hibernate.transaction.jta.platform"),
            instanceOf(SpringJtaPlatform.class));
}