use of org.springframework.orm.jpa.JpaTransactionManager in project spring-security by spring-projects.
the class DataConfig method transactionManager.
@Bean
public PlatformTransactionManager transactionManager() {
JpaTransactionManager txManager = new JpaTransactionManager();
txManager.setEntityManagerFactory(entityManagerFactory().getObject());
return txManager;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project camel by apache.
the class JpaEndpointTest method testJpaEndpointCtrUrlEMFandTM.
/**
*
* @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());
}
use of org.springframework.orm.jpa.JpaTransactionManager in project camel by apache.
the class JpaMessageIdRepository method createTransactionTemplate.
private static TransactionTemplate createTransactionTemplate(EntityManagerFactory entityManagerFactory) {
TransactionTemplate transactionTemplate = new TransactionTemplate();
transactionTemplate.setTransactionManager(new JpaTransactionManager(entityManagerFactory));
transactionTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRED);
return transactionTemplate;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project cas by apereo.
the class SamlIdPJpaMetadataConfiguration method transactionManagerSamlMetadata.
@Autowired
@Bean
public PlatformTransactionManager transactionManagerSamlMetadata(@Qualifier("samlMetadataEntityManagerFactory") final EntityManagerFactory emf) {
final JpaTransactionManager mgmr = new JpaTransactionManager();
mgmr.setEntityManagerFactory(emf);
return mgmr;
}
use of org.springframework.orm.jpa.JpaTransactionManager in project cas by apereo.
the class JpaServiceRegistryConfiguration method transactionManagerServiceReg.
@Autowired
@Bean
public PlatformTransactionManager transactionManagerServiceReg(@Qualifier("serviceEntityManagerFactory") final EntityManagerFactory emf) {
final JpaTransactionManager mgmr = new JpaTransactionManager();
mgmr.setEntityManagerFactory(emf);
return mgmr;
}
Aggregations