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


Java LocalContainerEntityManagerFactoryBean.setPersistenceProviderClass方法代码示例

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


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

示例1: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
@Bean
public LocalContainerEntityManagerFactoryBean entityManagerFactory() {
	LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
	entityManagerFactoryBean.setDataSource(dataSource());
	entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistence.class);
	entityManagerFactoryBean.setPackagesToScan(env.getRequiredProperty(PROP_ENTITYMANAGER_PACKAGES_TO_SCAN));

	entityManagerFactoryBean.setJpaProperties(getHibernateProperties());

	return entityManagerFactoryBean;
}
 
开发者ID:noveogroup-amorgunov,项目名称:spring-mvc-react,代码行数:12,代码来源:SpringWebConfig.java

示例2: entityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
/**
 * Create new EntityManagerFactory
 *
 * @param dataSource          the data source
 * @param hibernateProperties the hibernate properties
 * @return the entity manager factory
 */
@Bean
public EntityManagerFactory entityManagerFactory(final DataSource dataSource, final Properties hibernateProperties) {
    final LocalContainerEntityManagerFactoryBean em = new LocalContainerEntityManagerFactoryBean();
    em.setDataSource(dataSource);
    em.setPackagesToScan(entitymanagerPackagesToScan);
    em.setJpaVendorAdapter(new HibernateJpaVendorAdapter());
    em.setJpaProperties(hibernateProperties);
    em.setPersistenceUnitName("nestedbird");
    em.setSharedCacheMode(SharedCacheMode.ENABLE_SELECTIVE);
    em.setPersistenceProviderClass(HibernatePersistenceProvider.class);
    em.afterPropertiesSet();

    return em.getObject();
}
 
开发者ID:mhaddon,项目名称:Sound.je,代码行数:22,代码来源:DatabaseConfig.java

示例3: kernEntityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
/**
 * @return entity manager factory (kern; alleen lezen)
 */
@Bean(name = ENTITY_MANAGER_KERN)
@DependsOn(TRANSACTION_MANAGER)
public LocalContainerEntityManagerFactoryBean kernEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(kernDataSource());
    entityManagerFactoryBean.setPersistenceUnitName(PERSISTENCE_UNIT_KERN);
    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

示例4: masterEntityManagerFactory

import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; //导入方法依赖的package包/类
/**
 * @return entity manager factory (kern; schrijven)
 */
@Bean(name = ENTITY_MANAGER_MASTER)
@DependsOn(TRANSACTION_MANAGER)
public LocalContainerEntityManagerFactoryBean masterEntityManagerFactory() {
    final LocalContainerEntityManagerFactoryBean entityManagerFactoryBean = new LocalContainerEntityManagerFactoryBean();
    entityManagerFactoryBean.setDataSource(masterDataSource());
    entityManagerFactoryBean.setPersistenceUnitName(PERSISTENCE_UNIT_MASTER);
    entityManagerFactoryBean.setPersistenceProviderClass(HibernatePersistenceProvider.class);
    entityManagerFactoryBean.setPackagesToScan(PACKAGE_USERTYPES, PACKAGE_STAMGEGEVEN_ENTITY, PACKAGE_BEHEER_VIEW);
    entityManagerFactoryBean.setJpaProperties(hibernateProperties());

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

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

示例6: protocolleringEntityManagerFactory

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

    entityManagerFactoryBean.setJpaProperties(hibernateProperties());

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


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