Example usage for org.springframework.orm.jpa JpaTransactionManager setEntityManagerFactory

List of usage examples for org.springframework.orm.jpa JpaTransactionManager setEntityManagerFactory

Introduction

In this page you can find the example usage for org.springframework.orm.jpa JpaTransactionManager setEntityManagerFactory.

Prototype

public void setEntityManagerFactory(@Nullable EntityManagerFactory emf) 

Source Link

Document

Set the EntityManagerFactory that this instance should manage transactions for.

Usage

From source file:com.gondor.config.ApplicationContextConfig.java

@Bean
public JpaTransactionManager transactionManager() throws ClassNotFoundException {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
    return transactionManager;
}

From source file:com.springsource.html5expense.config.ComponentConfig.java

@Bean
public PlatformTransactionManager transactionManager() {
    final JpaTransactionManager transactionManager = new JpaTransactionManager();

    transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
    Map<String, String> jpaProperties = new HashMap<String, String>();
    jpaProperties.put("transactionTimeout", "43200");
    transactionManager.setJpaPropertyMap(jpaProperties);

    return transactionManager;
}

From source file:com.logicaalternativa.ejemplomock.configuration.AppConfiguration.java

@Bean
public JpaTransactionManager transactionManager() {

    JpaTransactionManager tm = new JpaTransactionManager();
    tm.setEntityManagerFactory(this.entityManagerFactory().getObject());

    return tm;/*from   ww w  . j  a  va2 s. c o m*/

}

From source file:gov.nih.nci.integration.dao.JpaConfig.java

/**
 * Returns JPA tx manager.// w  w  w  .  ja  v  a2s.c  om
 * 
 * @return the jpa transaction manager
 */
@Bean
public JpaTransactionManager transactionManager() {
    final JpaTransactionManager jpaTransactionManager = new JpaTransactionManager();
    jpaTransactionManager.setEntityManagerFactory(entityManagerFactory());
    jpaTransactionManager.setDataSource(dataSource());

    // must set the properties
    jpaTransactionManager.afterPropertiesSet();
    return jpaTransactionManager;
}

From source file:com.invariantproperties.sandbox.springentitylistener.listener.ApplicationContext.java

@Bean
public PlatformTransactionManager transactionManager() {
    JpaTransactionManager tm = new JpaTransactionManager();

    try {/*from   www.  j  a  va2 s .co  m*/
        tm.setEntityManagerFactory(this.entityManagerFactory().getObject());
    } catch (ClassNotFoundException e) {
        log.info("class not found: " + e.getMessage());
    }

    return tm;
}

From source file:org.cambillaum.jpapersistor.persistence.configuration.PersistenceConfiguration.java

@Bean
public JpaTransactionManager transactionManager() {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setDataSource(dataSource());
    transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
    return transactionManager;
}

From source file:br.eti.danielcamargo.backend.common.config.context.CoreConfig.java

@Bean
public PlatformTransactionManager transactionManager() throws PropertyVetoException {
    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory().getObject());
    return transactionManager;
}

From source file:com.invariantproperties.project.student.config.TestPersistenceJpaConfig.java

@Bean
public PlatformTransactionManager transactionManager() {
    JpaTransactionManager tm = new JpaTransactionManager();

    try {/*w w  w  .  j a va 2  s.  co m*/
        tm.setEntityManagerFactory(this.entityManagerFactory().getObject());
    } catch (ClassNotFoundException e) {
        // TODO: log.
    }

    return tm;
}

From source file:gt.dakaik.config.RootContext.java

@Bean
public JpaTransactionManager transactionManager() throws ClassNotFoundException {

    JpaTransactionManager transactionManager = new JpaTransactionManager();
    transactionManager.setEntityManagerFactory(entityManagerFactory());
    return transactionManager;
}

From source file:com.xumpy.security.root.InitDatabase.java

@Bean
@Primary//from   w  ww .j ava2 s.c om
@Qualifier(value = "jpaTransactionManager")
public JpaTransactionManager jpaTransactionManager() {
    JpaTransactionManager txManager = new JpaTransactionManager();
    txManager.setEntityManagerFactory(entityManagerFactory().getNativeEntityManagerFactory());

    return txManager;
}