本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}