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


Java HibernateTransactionManager.setSessionFactory方法代码示例

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


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

示例1: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory s) {
   HibernateTransactionManager txManager = new HibernateTransactionManager();
   txManager.setSessionFactory(s);
   return txManager;
}
 
开发者ID:mustafamym,项目名称:FeedbackCollectionAndMgmtSystem,代码行数:8,代码来源:HibernateConfiguration.java

示例2: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory s) {
    HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(s);
    return txManager;
}
 
开发者ID:zsavvas,项目名称:ReCRED_FIDO_UAF_OIDC,代码行数:8,代码来源:HibernateConfiguration.java

示例3: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
	HibernateTransactionManager txManager = new HibernateTransactionManager();
	txManager.setSessionFactory(sessionFactory);
	return txManager;
}
 
开发者ID:karabill,项目名称:maellak_spring_example,代码行数:8,代码来源:MyConfiguration.java

示例4: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
  HibernateTransactionManager txManager = new HibernateTransactionManager();
  txManager.setSessionFactory(sessionFactory);

  return txManager;
}
 
开发者ID:tloszabno,项目名称:FirefightersCenter,代码行数:9,代码来源:PersistenceCOnfig.java

示例5: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
    HibernateTransactionManager txManager =  new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory);
    return txManager;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:8,代码来源:ContextMappingConfiguration.java

示例6: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
    HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory);

    return txManager;
}
 
开发者ID:olegnikitin,项目名称:thesis,代码行数:9,代码来源:DBConfiguration.java

示例7: buildSessionFactory

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Override
public synchronized SessionFactory buildSessionFactory() {
	try {
		LOG.debug("Building new session factory");
		SessionFactory real = configurationProvider.getConfiguration().buildSessionFactory(
				this.serviceRegistryBuilder.buildServiceRegistry());

		LOG.debug("Session factory created, creating new Transaction Manager to handle transactions");
		HibernateTransactionManager txManager = new HibernateTransactionManager();

		txManager.setDataSource(((DatasourceConnectionProviderImpl) ((SessionFactoryImplementor) real).getServiceRegistry()
				.getService(ConnectionProvider.class)).getDataSource());
		txManager.setSessionFactory(proxySessionFactory);
		txManager.setValidateExistingTransaction(true);
		txManager.afterPropertiesSet();

		// The anotations at this point uses the new transaction manager
		AnnotationTransactionAspect txAspect = AnnotationTransactionAspect.aspectOf();
		txAspect.setTransactionManager(txManager);
		LOG.debug("New transaction manager established to AnnotationTransactionAspect, now the annotations used the new Transaction Manager");

		return real;
	} catch (RuntimeException ex) {
		LOG.error("Runtime exception when trying to create session factory.", ex);
		throw ex;
	}
}
 
开发者ID:frincon,项目名称:openeos,代码行数:28,代码来源:SessionFactoryManagerOsgiService.java

示例8: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
   HibernateTransactionManager txManager = new HibernateTransactionManager();
   txManager.setSessionFactory(sessionFactory);
 
   return txManager;
}
 
开发者ID:jkardynia,项目名称:mvc-spring-hibernate,代码行数:9,代码来源:HibernateConfig.java

示例9: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
/**
 * Creates a new HibernateTransactionManager.
 *
 * @param resourceLoader any ResourceLoader.
 * @return a HibernateTransactionManager.
 */
@Bean
public HibernateTransactionManager transactionManager(ResourceLoader resourceLoader) {
    HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory(resourceLoader).getObject());
    return txManager;
}
 
开发者ID:dan-zx,项目名称:zekke-webapp,代码行数:13,代码来源:BeanConfig.java

示例10: transactionManager

import org.springframework.orm.hibernate4.HibernateTransactionManager; //导入方法依赖的package包/类
@Bean(name = "org.sakaiproject.springframework.orm.hibernate.GlobalTransactionManager")
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
    HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory);
    return txManager;
}
 
开发者ID:sakaiproject,项目名称:sakai,代码行数:7,代码来源:AssignmentTestConfiguration.java


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