当前位置: 首页>>代码示例>>Java>>正文


Java JpaTransactionManager.afterPropertiesSet方法代码示例

本文整理汇总了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());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:22,代码来源:JpaComponentTest.java

示例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());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:21,代码来源:JpaEndpointTest.java

示例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());
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:19,代码来源:JpaEndpointTest.java

示例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;
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:8,代码来源:DatabaseConfig.java

示例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;
}
 
开发者ID:hortonworks,项目名称:cloudbreak,代码行数:8,代码来源:DatabaseConfig.java

示例6: createTransactionManager

import org.springframework.orm.jpa.JpaTransactionManager; //导入方法依赖的package包/类
protected PlatformTransactionManager createTransactionManager() {
    JpaTransactionManager tm = new JpaTransactionManager(getEntityManagerFactory());
    tm.afterPropertiesSet();
    return tm;
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:6,代码来源:JpaEndpoint.java


注:本文中的org.springframework.orm.jpa.JpaTransactionManager.afterPropertiesSet方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。