Package org.springframework.orm.jpa

Examples of org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.afterPropertiesSet()


  private static EntityManager entityManager(DataSource dataSource) {
    LocalContainerEntityManagerFactoryBean emfBean = new LocalContainerEntityManagerFactoryBean();
    emfBean.setDataSource(dataSource);
    emfBean.setPersistenceUnitName(PERSISTENCE_UNIT_NAME);
    emfBean.setPersistenceProviderClass(PERSISTENCE_PROVIDER_CLASS);
    emfBean.afterPropertiesSet();
    Map map = new HashMap<String, String>();
    map.put("openjpa.ConnectionFactoryProperties", "PrintParameters=true");
    return emfBean.getObject().createEntityManager(map);
  }
View Full Code Here


    Properties ps = new Properties();
    ps.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
    ps.put("hibernate.hbm2ddl.auto", "create");
    lcemfb.setJpaProperties(ps);
   
    lcemfb.afterPropertiesSet();

        return lcemfb;
   
    }
 
View Full Code Here

    Properties ps = new Properties();
    ps.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
    ps.put("hibernate.hbm2ddl.auto", "create");
    lcemfb.setJpaProperties(ps);
   
    lcemfb.afterPropertiesSet();

        return lcemfb;
   
    }
 
View Full Code Here

    Properties ps = new Properties();
    ps.put("hibernate.dialect", "org.hibernate.dialect.HSQLDialect");
    ps.put("hibernate.hbm2ddl.auto", "create");
    lcemfb.setJpaProperties(ps);
   
    lcemfb.afterPropertiesSet();

        return lcemfb;
   
    }
  
View Full Code Here

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml");
    OpenJpaVendorAdapter openJpa = new OpenJpaVendorAdapter();
    factory.setJpaVendorAdapter(openJpa);
    factory.afterPropertiesSet();
    return factory.getObject();
  }

  private void assertSessionBound() {
    assertNotNull(TransactionSynchronizationManager.getResource(entityManagerFactory));
View Full Code Here

    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml");
    OpenJpaVendorAdapter openJpa = new OpenJpaVendorAdapter();
    factory.setJpaVendorAdapter(openJpa);
    factory.afterPropertiesSet();
    return factory.getObject();
  }

  private void assertSessionNotBound() {
    assertNull(TransactionSynchronizationManager.getResource(entityManagerFactory));
View Full Code Here

    }
    if (dataSource != null) {
      entityManagerFactoryFactory.setDataSource(dataSource);
    }

    entityManagerFactoryFactory.afterPropertiesSet();
    return entityManagerFactoryFactory;
  }

  @ExternalBean
  public abstract String persistenceUnitName();
View Full Code Here

  private EntityManagerFactory getEntityManagerFactory(DataSource dataSource) throws Exception {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml");
    factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    factory.afterPropertiesSet();
    return factory.getObject();
  }

}
View Full Code Here

  private EntityManagerFactory getEntityManagerFactory(DataSource dataSource) throws Exception {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml");
    factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    factory.afterPropertiesSet();
    return factory.getObject();
  }

  private void assertSessionNotBound() {
    assertNull(TransactionSynchronizationManager.getResource(entityManagerFactory));
View Full Code Here

  private EntityManagerFactory getEntityManagerFactory(DataSource dataSource) throws Exception {
    LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setPersistenceXmlLocation("classpath:org/springframework/webflow/persistence/persistence.xml");
    factory.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    factory.afterPropertiesSet();
    return factory.getObject();
  }

}
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.