当前位置: 首页>>代码示例>>Java>>正文


Java LocalContainerEntityManagerFactoryBean.setPersistenceUnitName方法代码示例

本文整理汇总了Java中org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.setPersistenceUnitName方法的典型用法代码示例。如果您正苦于以下问题:Java LocalContainerEntityManagerFactoryBean.setPersistenceUnitName方法的具体用法?Java LocalContainerEntityManagerFactoryBean.setPersistenceUnitName怎么用?Java LocalContainerEntityManagerFactoryBean.setPersistenceUnitName使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean的用法示例。


在下文中一共展示了LocalContainerEntityManagerFactoryBean.setPersistenceUnitName方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean(EntityManagerFactoryBeanName)
@Primary
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource1");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
 
开发者ID:omacarena,项目名称:only-short-poc,代码行数:17,代码来源:MySqlSource1Config.java

示例2: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
	emf.setDataSource(dataSource());
	emf.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
	emf.setPackagesToScan(TestJpaDomain.class.getPackage().getName());
	emf.setPersistenceUnitName("test");
	return emf;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:10,代码来源:TestBase.java

示例3: 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();
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:19,代码来源:DatabaseConfiguration.java

示例4: 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();
}
 
开发者ID:oncecloud,项目名称:devops-cstack,代码行数:19,代码来源:DatabaseConfigurationTest.java

示例5: getEntityManagerFactoryBean

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean getEntityManagerFactoryBean(final DataSource dataSource) {

    final LocalContainerEntityManagerFactoryBean factory = new LocalContainerEntityManagerFactoryBean();
    factory.setDataSource(dataSource);
    factory.setJpaVendorAdapter(new OpenJpaVendorAdapter());
    factory.setPersistenceUnitName("jwala-unit");
    factory.setPersistenceXmlLocation("classpath:META-INF/persistence.xml");

    return factory;
}
 
开发者ID:cerner,项目名称:jwala,代码行数:12,代码来源:AemJpaConfiguration.java

示例6: 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

示例7: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
	emf.setDataSource(dataSource());
	HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter();
	va.setShowSql(true);
	emf.setJpaVendorAdapter(va);
	emf.setPackagesToScan(TestJpaDomain.class.getPackage().getName());
	emf.setPersistenceUnitName("test");
	emf.getJpaPropertyMap().put("hibernate.jdbc.batch_size", 5);
	return emf;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:13,代码来源:TestJpaDatastoreHibernate.java

示例8: 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;
}
 
开发者ID:Discovery-Research-Network-SCCM,项目名称:FHIR-CQL-ODM-service,代码行数:13,代码来源:FhirServiceConfig.java

示例9: 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

示例10: entityManagerFactory2

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
@Qualifier("two")
public FactoryBean<EntityManagerFactory> entityManagerFactory2(@Qualifier("two") DataSource dataSource) {
	LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
	emf.setDataSource(dataSource);
	HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter();
	va.setShowSql(true);
	emf.setJpaVendorAdapter(va);
	emf.setPackagesToScan(TestJpaDomain2.class.getPackage().getName());
	emf.setPersistenceUnitName("two");
	return emf;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:13,代码来源:TestEnableDatastoreMulti.java

示例11: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
	emf.setDataSource(dataSource());

	HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter();
	va.setShowSql(true);

	emf.setJpaVendorAdapter(va);

	emf.setPackagesToScan(TestJpaDomain.class.getPackage().getName());
	emf.setPersistenceUnitName("test");
	return emf;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa-querydsl,代码行数:15,代码来源:TestJpaQueryDslDatastoreHibernate.java

示例12: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean(EntityManagerFactoryBeanName)
public LocalContainerEntityManagerFactoryBean entityManagerFactory(
        @Qualifier(DataSourceBeanName) DataSource dataSource,
        @Qualifier(JpaVendorAdapterBeanName) JpaVendorAdapter vendorAdapter) {

    LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(dataSource);
    entityManagerFactoryBean.setJpaVendorAdapter(vendorAdapter);
    entityManagerFactoryBean.setJpaDialect(new HibernateJpaDialect());
    entityManagerFactoryBean.setPackagesToScan(Organization.class.getPackage().getName());
    entityManagerFactoryBean.setPersistenceUnitName("mysqlsource2");
    entityManagerFactoryBean.afterPropertiesSet();

    return entityManagerFactoryBean;
}
 
开发者ID:omacarena,项目名称:only-short-poc,代码行数:16,代码来源:MySqlSource2Config.java

示例13: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public FactoryBean<EntityManagerFactory> entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean emf = new LocalContainerEntityManagerFactoryBean();
	emf.setDataSource(dataSource());

	HibernateJpaVendorAdapter va = new HibernateJpaVendorAdapter();
	va.setDatabase(Database.H2);
	emf.setJpaVendorAdapter(va);

	emf.setPackagesToScan(TestJpaDomain.class.getPackage().getName());
	emf.setPersistenceUnitName("test");
	return emf;
}
 
开发者ID:holon-platform,项目名称:holon-datastore-jpa,代码行数:14,代码来源:TestMultiTenancy.java

示例14: getLocalContainerEntityManagerFactoryBean

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean getLocalContainerEntityManagerFactoryBean() {
	LocalContainerEntityManagerFactoryBean bean = new LocalContainerEntityManagerFactoryBean();
	bean.setJpaProperties(hibernateProperties());
	bean.setPackagesToScan(MovieEntity.class.getPackage().getName());
	bean.setDataSource(testDataSource());
	bean.setPersistenceUnitName("TEST");
	return bean;
}
 
开发者ID:crnk-project,项目名称:crnk-framework,代码行数:10,代码来源:OperationsTestConfig.java

示例15: archiveringEntityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
/**
 * @return entity manager factory (archivering; alleen lezen)
 */
@Bean(name = ENTITY_MANAGER_ARCHIVERING)
@DependsOn(TRANSACTION_MANAGER)
public LocalContainerEntityManagerFactoryBean archiveringEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(archiveringDataSource());
    entityManagerFactoryBean.setPersistenceUnitName(PERSISTENCE_UNIT_ARCHIVERING);
    entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
    entityManagerFactoryBean.setPackagesToScan(PACKAGE_USERTYPES, PACKAGE_STAMGEGEVEN_ENTITY, PACKAGE_BEHEER_VIEW);

    entityManagerFactoryBean.setJpaProperties(hibernateProperties());

    return entityManagerFactoryBean;
}
 
开发者ID:MinBZK,项目名称:OperatieBRP,代码行数:17,代码来源:RepositoryConfiguratie.java


注:本文中的org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean.setPersistenceUnitName方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。