本文整理汇总了Java中org.springframework.boot.orm.jpa.hibernate.SpringJtaPlatform类的典型用法代码示例。如果您正苦于以下问题:Java SpringJtaPlatform类的具体用法?Java SpringJtaPlatform怎么用?Java SpringJtaPlatform使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SpringJtaPlatform类属于org.springframework.boot.orm.jpa.hibernate包,在下文中一共展示了SpringJtaPlatform类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: configureSpringJtaPlatform
import org.springframework.boot.orm.jpa.hibernate.SpringJtaPlatform; //导入依赖的package包/类
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());
}
}
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:21,代码来源:HibernateJpaAutoConfiguration.java
示例2: defaultJtaPlatform
import org.springframework.boot.orm.jpa.hibernate.SpringJtaPlatform; //导入依赖的package包/类
@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);
}
开发者ID:vikrammane23,项目名称:https-github.com-g0t4-jenkins2-course-spring-boot,代码行数:12,代码来源:HibernateJpaAutoConfigurationTests.java
示例3: defaultJtaPlatform
import org.springframework.boot.orm.jpa.hibernate.SpringJtaPlatform; //导入依赖的package包/类
@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));
}