本文整理汇总了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;
}