本文整理汇总了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;
}
示例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();
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}