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