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


Java DefaultPersistenceUnitManager.setDefaultDataSource方法代码示例

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


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

示例1: persistenceUnitManager

import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager; //导入方法依赖的package包/类
/**
 * @return Introduce custom persistence unit manager so that we can use the orm.xml file to rename the table
 * mapping for Student.java and verify that we pick up the renamed mapping via ProviderAccess.
 */
@Bean
public PersistenceUnitManager persistenceUnitManager(DataSource dataSource) {
    DefaultPersistenceUnitManager manager = new DefaultPersistenceUnitManager();
    manager.setPersistenceXmlLocation("classpath:META-INF/pedal-test-persistence.xml");
    manager.setDefaultDataSource(dataSource);
    return manager;
}
 
开发者ID:eclecticlogic,项目名称:pedal-dialect,代码行数:12,代码来源:JpaConfiguration.java

示例2: corePersistenceUnitManager

import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager; //导入方法依赖的package包/类
@Bean(name="corePersistenceUnitManager")
@Primary
public PersistenceUnitManager corePersistenceUnitManager(DatabaseSelector dataSource) {
	DefaultPersistenceUnitManager persistenceUnitManager = new DefaultPersistenceUnitManager();
	persistenceUnitManager.setDefaultDataSource(dataSource);
	persistenceUnitManager.setPackagesToScan("edu.cmu.cs.lti.discoursedb.core.model");
	persistenceUnitManager.setDefaultPersistenceUnitName("corePersistenceUnitManager");
	return persistenceUnitManager;
}
 
开发者ID:DiscourseDB,项目名称:discoursedb-core,代码行数:10,代码来源:BaseConfiguration.java

示例3: systemPersistenceUnitManager

import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager; //导入方法依赖的package包/类
@Bean(name="systemPersistenceUnitManager")
public PersistenceUnitManager systemPersistenceUnitManager() {
	DefaultPersistenceUnitManager persistenceUnitManager = new DefaultPersistenceUnitManager();
	persistenceUnitManager.setDefaultDataSource(this.systemDataSource());
	persistenceUnitManager.setPackagesToScan("edu.cmu.cs.lti.discoursedb.system.model");
	persistenceUnitManager.setDefaultPersistenceUnitName("systemPersistenceUnitManager");
	return persistenceUnitManager;
}
 
开发者ID:DiscourseDB,项目名称:discoursedb-core,代码行数:9,代码来源:SystemDbConfiguration.java

示例4: preparePersistentUnitManager

import org.springframework.orm.jpa.persistenceunit.DefaultPersistenceUnitManager; //导入方法依赖的package包/类
private PersistenceUnitManager preparePersistentUnitManager(Config config, String prefix, DataSource datasource) {
	DefaultPersistenceUnitManager persistenceUnitManager = new DefaultPersistenceUnitManager();
	persistenceUnitManager.setDefaultDataSource(datasource);
	persistenceUnitManager.setPersistenceXmlLocations(new String[] {determineConfigProperty(config, prefix, "PersistenceXmlLocation", "META-INF/persistence.xml")});
	persistenceUnitManager.setDefaultPersistenceUnitRootLocation(determineConfigProperty(config, prefix, "PersistenceUnitRootLocation", "classpath:"));
	RicePersistenceUnitPostProcessor postProcessor = new RicePersistenceUnitPostProcessor();
	postProcessor.setJtaDataSource(datasource);
	persistenceUnitManager.setPersistenceUnitPostProcessors(new RicePersistenceUnitPostProcessor[] { postProcessor });
	persistenceUnitManager.afterPropertiesSet();
	return persistenceUnitManager;
}
 
开发者ID:aapotts,项目名称:kuali_rice,代码行数:12,代码来源:RiceLocalContainerEntityManagerFactoryBean.java


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