當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。