Spring Framework JpaTransactionManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Spring Framework JpaTransactionManager class.

This code example shows how to use the following methods:afterPropertiesSet
     */ 
    @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()); 
    } 
 
    @Test 
    public void testJpaEndpointCustomEMFandTM() throws Exception { 
7
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEntityManagerFactory
    return ds; 
  } 
 
  @Bean(name = "transactionManager") 
  public PlatformTransactionManager annotationDrivenTransactionManager() { 
    JpaTransactionManager transactionManager = new JpaTransactionManager(); 
    transactionManager.setEntityManagerFactory(entityManagerFactory()); 
    return transactionManager; 
  } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEntityManagerFactory
	@Bean public JpaDialect jpaDialect() { 
		return new HibernateJpaDialect(); 
	} 
 
	@Bean public PlatformTransactionManager transactionManager() { 
		JpaTransactionManager txManager = new JpaTransactionManager(); 
		txManager.setEntityManagerFactory(entityManagerFactory()); 
		return txManager; 
	} 
 
	@Bean(initMethod = "loadData") public JpaLoader jpaLoader() { 
		return new JpaLoader(); 
	} 
 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDataSource, setEntityManagerFactory
        return new HibernateJpaVendorAdapter(); 
    } 
 
    @Bean 
    public PlatformTransactionManager transactionManager() { 
        JpaTransactionManager txManager = new JpaTransactionManager(); 
        txManager.setEntityManagerFactory(this.entityManagerFactory); 
        txManager.setDataSource(this.dataSource); 
        return txManager; 
    } 
 
    @Bean 
    public DataSource dataSource() { 
        EmbeddedDatabaseBuilder builder = new EmbeddedDatabaseBuilder(); 
        builder.setType(EmbeddedDatabaseType.H2); 
        return builder.build(); 
    } 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setEntityManagerFactory
		return new HibernateJpaDialect(); 
	} 
 
	@Bean 
	public PlatformTransactionManager transactionManager() { 
		JpaTransactionManager txManager = new JpaTransactionManager(); 
		txManager.setEntityManagerFactory(entityManagerFactory()); 
		return txManager; 
	} 
} 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
	private int rowCount; 
 
	@Override 
	protected void setUpResources(DataSource dataSource) throws Exception { 
		entityManagerFactory = getEntityManagerFactory(dataSource); 
		JpaTransactionManager tm = new JpaTransactionManager(entityManagerFactory); 
		executionListener = new JpaFlowExecutionListener(entityManagerFactory, tm); 
		rowCount = 1; 
	} 
 
	@Override 
	protected FlowExecutionListener getListener() { 
		return executionListener; 
	} 
 
	@Override 
	protected void assertSessionNotBound() { 
		assertNull(TransactionSynchronizationManager.getResource(entityManagerFactory)); 
	} 
 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		return new EmbeddedDatabaseBuilder().setName("data").setType(EmbeddedDatabaseType.HSQL).build(); 
	} 
 
	@Bean 
	public JpaTransactionManager transactionManager(EntityManagerFactory emf) { 
		return new JpaTransactionManager(emf); 
	} 
 
	@Bean 
	public HibernateJpaVendorAdapter jpaVendorAdapter() { 
 
		HibernateJpaVendorAdapter adapter = new HibernateJpaVendorAdapter(); 
		adapter.setGenerateDdl(true); 
		adapter.setDatabase(Database.HSQL); 
 
		return adapter; 
	} 
 
	@Bean 
	public LocalContainerEntityManagerFactoryBean entityManagerFactory() { 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:sleep, getEntityManagerFactory
 
    private TestWorkItemHandler workItemHandler = new TestWorkItemHandler(); 
 
    public void initStartDisposeAndLoadSession() { 
        try { 
            EntityManager em = txm.getEntityManagerFactory().createEntityManager(); 
            // create new ksession with kstore 
            KieSession ksession = kstore.newKieSession(kbase, 
                    null, 
                    getEnvironment()); 
            sessionId = ksession.getId(); 
 
            logger.info("\n\tSession id: " + sessionId + "\n"); 
 
            ksession.getWorkItemManager().registerWorkItemHandler("testWorkItemHandler", 
                    workItemHandler); 
 
            ksession.startProcess("timer-flow", 
                    null); 
            Thread.sleep(4000); 

5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
		return factory; 
	} 
 
	@Bean 
	public PlatformTransactionManager transactionManager() { 
		return new JpaTransactionManager(); 
	} 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:setDataSource, setJpaDialect
        return entityManagerFactory.getObject(); 
    } 
 
    @Bean 
    public PlatformTransactionManager transactionManager() throws URISyntaxException { 
        JpaTransactionManager transactionManager = new JpaTransactionManager(entityManagerFactory()); 
        transactionManager.setDataSource(dataSource()); 
        transactionManager.setJpaDialect(new HibernateJpaDialect()); 
        return transactionManager; 
    } 
 
    @Bean 
    public Properties hibernateProperties() { 
        Properties properties = new Properties(); 
        properties.put("hibernate.dialect", "org.hibernate.dialect.PostgreSQLDialect"); 
        properties.put("hibernate.show_sql", "true"); 
        properties.put("hibernate.hbm2ddl.auto", "update"); 
        return properties; 
    } 
 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Spring Framework JpaTransactionManager Methods: