本文整理汇总了Java中org.springframework.orm.jpa.JpaTransactionManager.afterPropertiesSet方法的典型用法代码示例。如果您正苦于以下问题:Java JpaTransactionManager.afterPropertiesSet方法的具体用法?Java JpaTransactionManager.afterPropertiesSet怎么用?Java JpaTransactionManager.afterPropertiesSet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.orm.jpa.JpaTransactionManager
的用法示例。
在下文中一共展示了JpaTransactionManager.afterPropertiesSet方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: testJpaComponentEMFandTM
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Test
public void testJpaComponentEMFandTM() throws Exception {
JpaComponent comp = new JpaComponent();
comp.setCamelContext(context);
assertNull(comp.getEntityManagerFactory());
assertNull(comp.getTransactionManager());
EntityManagerFactory fac = Persistence.createEntityManagerFactory("camel");
JpaTransactionManager tm = new JpaTransactionManager(fac);
tm.afterPropertiesSet();
comp.setEntityManagerFactory(fac);
comp.setTransactionManager(tm);
assertSame(fac, comp.getEntityManagerFactory());
assertSame(tm, comp.getTransactionManager());
JpaEndpoint jpa = (JpaEndpoint) comp.createEndpoint("jpa://" + SendEmail.class.getName());
assertNotNull(jpa);
assertNotNull(jpa.getEntityType());
}
示例2: testJpaEndpointCtrUrlEMFandTM
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
/**
*
* @deprecated
*/
@Deprecated
@Test
public void testJpaEndpointCtrUrlEMFandTM() throws Exception {
EntityManagerFactory fac = Persistence.createEntityManagerFactory("camel");
JpaTransactionManager tm = new JpaTransactionManager(fac);
tm.afterPropertiesSet();
JpaEndpoint jpa = new JpaEndpoint("jpa://org.apache.camel.examples.SendEmail", fac, tm);
jpa.setEntityType(SendEmail.class);
assertSame(fac, jpa.getEntityManagerFactory());
assertSame(tm, jpa.getTransactionManager());
assertEquals("jpa://org.apache.camel.examples.SendEmail", jpa.getEndpointUri());
assertEquals("camel", jpa.getPersistenceUnit());
}
示例3: testJpaEndpointCustomEMFandTM
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Test
public void testJpaEndpointCustomEMFandTM() throws Exception {
EntityManagerFactory fac = Persistence.createEntityManagerFactory("camel");
JpaTransactionManager tm = new JpaTransactionManager(fac);
tm.afterPropertiesSet();
JpaEndpoint jpa = new JpaEndpoint();
jpa.setEntityType(SendEmail.class);
jpa.setEntityManagerFactory(fac);
jpa.setTransactionManager(tm);
assertSame(fac, jpa.getEntityManagerFactory());
assertSame(tm, jpa.getTransactionManager());
assertEquals("jpa://org.apache.camel.examples.SendEmail", jpa.getEndpointUri());
assertEquals("camel", jpa.getPersistenceUnit());
}
示例4: transactionManager
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Bean
public PlatformTransactionManager transactionManager() throws SQLException {
JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
jpaTransactionManager.setEntityManagerFactory(entityManagerFactory());
jpaTransactionManager.afterPropertiesSet();
return jpaTransactionManager;
}
示例5: transactionManager
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
@Bean
public PlatformTransactionManager transactionManager() throws SQLException {
JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
jpaTransactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
jpaTransactionManager.afterPropertiesSet();
return jpaTransactionManager;
}
示例6: createTransactionManager
import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
protected PlatformTransactionManager createTransactionManager() {
JpaTransactionManager tm = new JpaTransactionManager(getEntityManagerFactory());
tm.afterPropertiesSet();
return tm;
}