本文整理汇总了Java中org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.setPersistenceProvider方法的典型用法代码示例。如果您正苦于以下问题:Java LocalContainerEntityManagerFactoryBean.setPersistenceProvider方法的具体用法?Java LocalContainerEntityManagerFactoryBean.setPersistenceProvider怎么用?Java LocalContainerEntityManagerFactoryBean.setPersistenceProvider使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
的用法示例。
在下文中一共展示了LocalContainerEntityManagerFactoryBean.setPersistenceProvider方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory() {
logger.debug("Configuring EntityManager");
LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean();
lcemfb.setPersistenceProvider(new HibernatePersistenceProvider());
lcemfb.setPersistenceUnitName("persistenceUnit");
lcemfb.setDataSource(dataSource());
lcemfb.setJpaDialect(new HibernateJpaDialect());
lcemfb.setJpaVendorAdapter(jpaVendorAdapter());
lcemfb.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
Properties jpaProperties = new Properties();
jpaProperties.put("hibernate.generate_statistics", false);
jpaProperties.put("hibernate.show_sql", Boolean.parseBoolean(databaseShowSQL));
lcemfb.setJpaProperties(jpaProperties);
lcemfb.setPackagesToScan("cn.org.once.cstack.model");
lcemfb.afterPropertiesSet();
return lcemfb.getObject();
}
示例2: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory() {
logger.debug("Configuring EntityManager");
LocalContainerEntityManagerFactoryBean lcemfb = new LocalContainerEntityManagerFactoryBean();
lcemfb.setPersistenceProvider(new HibernatePersistenceProvider());
lcemfb.setPersistenceUnitName("persistenceUnit");
lcemfb.setDataSource(dataSource());
lcemfb.setJpaDialect(new HibernateJpaDialect());
lcemfb.setJpaVendorAdapter(jpaVendorAdapter());
lcemfb.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
Properties jpaProperties = new Properties();
jpaProperties.put("hibernate.generate_statistics", true);
jpaProperties.put("hibernate.show_sql", Boolean.parseBoolean(databaseShowSQL));
lcemfb.setJpaProperties(jpaProperties);
lcemfb.setPackagesToScan("cn.org.once.cstack.model");
lcemfb.afterPropertiesSet();
return lcemfb.getObject();
}
示例3: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public EntityManagerFactory entityManagerFactory(DataSource dataSource) {
final Database database = Database.valueOf(vendor.toUpperCase());
/*
final HibernateJpaVendorAdapter vendorAdapter = new HibernateJpaVendorAdapter();
vendorAdapter.setShowSql(showSql);
vendorAdapter.setGenerateDdl(showDdl);
vendorAdapter.setDatabase(database);
*/
final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
factory.setPersistenceUnitName("CCRI_PU");
// factory.setJpaVendorAdapter(vendorAdapter);
factory.setPackagesToScan("uk.nhs.careconnect.ri.entity");
factory.setDataSource(dataSource);
factory.setPersistenceProvider(new HibernatePersistenceProvider());
factory.setJpaProperties(jpaProperties());
factory.afterPropertiesSet();
return factory.getObject();
}
示例4: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory(DataSource dataSource) {
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(dataSource);
emf.setPackagesToScan(Post.class.getPackage().getName());
emf.setPersistenceProvider(new HibernatePersistenceProvider());
emf.setJpaProperties(jpaProperties());
return emf;
}
示例5: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = new LocalContainerEntityManagerFactoryBean();
//retVal.setPersistenceUnitManager(persistenceUnitManager());
retVal.setMappingResources(orm);
retVal.setPackagesToScan("org.partners.usciitg_prep.terminology.jpa");
retVal.setPersistenceUnitName(persistenceUnitName);
retVal.setDataSource(dataSource());
retVal.setPersistenceProvider(new HibernatePersistenceProvider());
retVal.setJpaProperties(jpaProperties());
return retVal;
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:13,代码来源:FhirServerTestConfigDstu3.java
示例6: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = new LocalContainerEntityManagerFactoryBean();
//retVal.setPersistenceUnitManager(persistenceUnitManager());
retVal.setPackagesToScan(new String[]{"org.partners.usciitg_prep.terminology.jpa","org.partners.usciitg_prep.fhir.model"});
retVal.setMappingResources(orm);
retVal.setPersistenceUnitName(defaultPersistenceUnitName);
retVal.setDataSource(dataSource());
retVal.setPersistenceProvider(new HibernatePersistenceProvider());
retVal.setJpaProperties(jpaProperties());
return retVal;
}
示例7: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = new LocalContainerEntityManagerFactoryBean();
//retVal.setPersistenceUnitManager(persistenceUnitManager());
retVal.setPackagesToScan("org.partners.usciitg_prep.terminology.jpa","org.partners.usciitg_prep.fhir");
retVal.setMappingResources(orm);
retVal.setPersistenceUnitName(defaultPersistenceUnitName);
retVal.setDataSource(dataSource());
retVal.setPersistenceProvider(new HibernatePersistenceProvider());
retVal.setJpaProperties(jpaProperties());
return retVal;
}
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:13,代码来源:FhirServiceTestConfig.java
示例8: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean()
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean retVal = new LocalContainerEntityManagerFactoryBean();
retVal.setPersistenceUnitName("HAPI_PU");
retVal.setDataSource(dataSource());
retVal.setPackagesToScan("ca.uhn.fhir.jpa.entity");
retVal.setPersistenceProvider(new HibernatePersistenceProvider());
retVal.setJpaProperties(jpaProperties());
return retVal;
}
示例9: entityManagerFactory
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
emf.setDataSource(dataSource);
emf.setPackagesToScan(Constants.BASE_PACKAGE);
emf.setPersistenceProvider(new HibernatePersistenceProvider());
emf.setJpaProperties(jpaProperties());
return emf;
}