• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java HibernateTransactionManager类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.springframework.orm.hibernate5.HibernateTransactionManager的典型用法代码示例。如果您正苦于以下问题:Java HibernateTransactionManager类的具体用法?Java HibernateTransactionManager怎么用?Java HibernateTransactionManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: setUp

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
/**
 */
@Before
public void setUp() {
    final DataSource ds = new DriverManagerDataSource(System.getProperty("jdbc.url", "jdbc:sap://localhost:30115"),
            System.getProperty("jdbc.user", "hibernate"), System.getProperty("jdbc.password", "hibernate"));

    final LocalSessionFactoryBuilder builder = new LocalSessionFactoryBuilder(ds);
    builder.setProperty(AvailableSettings.DIALECT,
            System.getProperty("hibernate.dialect", HANAColumnStoreDialect.class.getName()));
    builder.setProperty(AvailableSettings.HBM2DDL_AUTO, "create-drop");
    builder.setProperty(AvailableSettings.USE_NEW_ID_GENERATOR_MAPPINGS, "true");

    builder.addAnnotatedClass(Employee.class);

    this.sessionFactory = builder.buildSessionFactory();

    final HibernateTemplate ht = new HibernateTemplate();
    ht.setSessionFactory(this.sessionFactory);

    ht.afterPropertiesSet();

    this.template = ht;

    final HibernateTransactionManager txnMgr = new HibernateTransactionManager();
    txnMgr.setDataSource(ds);
    txnMgr.setSessionFactory(this.sessionFactory);
    txnMgr.afterPropertiesSet();

    this.transactionTemplate = new TransactionTemplate(txnMgr);
}
 
开发者ID:aclemons,项目名称:hibernate-hdb-demo,代码行数:32,代码来源:TestEmployee.java


示例2: db1TransactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
public HibernateTransactionManager db1TransactionManager(DataSource dataSource,LocalSessionFactoryBean localSessionFactory) {
       HibernateTransactionManager txManager = new HibernateTransactionManager();
       txManager.setSessionFactory(localSessionFactory.getObject());
       txManager.setDataSource(dataSource);
       return txManager;
}
 
开发者ID:PacktPublishing,项目名称:Spring-5.0-Cookbook,代码行数:8,代码来源:HiberConfig.java


示例3: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
    System.out.println(sessionFactory);
    HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(sessionFactory);
    return txManager;
}
 
开发者ID:ArturWisniewski,项目名称:ToDoApp-Spring,代码行数:9,代码来源:HibernateConfig.java


示例4: getTransactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean(name = "transactionManager")
public HibernateTransactionManager getTransactionManager(
        SessionFactory sessionFactory) {
    HibernateTransactionManager transactionManager = new HibernateTransactionManager(
            sessionFactory);
    return transactionManager;
}
 
开发者ID:PacktPublishing,项目名称:Building-Web-Apps-with-Spring-5-and-Angular,代码行数:8,代码来源:AppConfig.java


示例5: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
   HibernateTransactionManager hibernateTransactionManager = new HibernateTransactionManager();
    hibernateTransactionManager.setSessionFactory(sessionFactory);
   return hibernateTransactionManager;
}
 
开发者ID:Exercon,项目名称:AntiSocial-Platform,代码行数:8,代码来源:HibernateConfiguration.java


示例6: txManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
  public PlatformTransactionManager txManager() throws Exception {
HibernateTransactionManager returnVal = new HibernateTransactionManager(
		hibernateConfig.sessionFactory());
returnVal.setDataSource(dataSourceConfig.dataSource());
return returnVal;
  }
 
开发者ID:RJBTechnology,项目名称:rjb-blog-multitenancy,代码行数:8,代码来源:TransactionConfig.java


示例7: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
/**
 * Initialize Transaction Manager 
 * @param sessionFactory
 * @return HibernateTransactionManager
 */
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
	HibernateTransactionManager txManager = new HibernateTransactionManager();
	txManager.setSessionFactory(sessionFactory);
	return txManager;
}
 
开发者ID:mjfcolas,项目名称:infotaf,代码行数:13,代码来源:AppConfig.java


示例8: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
/**
 * Initialize Transaction Manager
 * 
 * @param sessionFactory
 * @return HibernateTransactionManager
 */
@Bean
public HibernateTransactionManager transactionManager(SessionFactory sessionFactory) {
	HibernateTransactionManager txManager = new HibernateTransactionManager();
	txManager.setSessionFactory(sessionFactory);
	return txManager;
}
 
开发者ID:bytestree,项目名称:spring4-hibernate5-example,代码行数:13,代码来源:HibernateConfig.java


示例9: transactionManager

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


示例10: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory s) {
    final HibernateTransactionManager txManager = new HibernateTransactionManager();
    txManager.setSessionFactory(s);
    txManager.setDataSource(dataSource());
    return txManager;
}
 
开发者ID:music-for-all,项目名称:music-for-all-application,代码行数:9,代码来源:HibernateConfigDev.java


示例11: transactionManager

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


示例12: transactionManager

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


示例13: txManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
public HibernateTransactionManager txManager() throws SQLException {
    HibernateTransactionManager hibernateTransactionManager = new HibernateTransactionManager();
    hibernateTransactionManager.setSessionFactory(sessionFactory().getObject());
    return hibernateTransactionManager;
}
 
开发者ID:dragon-yuan,项目名称:Ins_fb_pictureSpider_WEB,代码行数:7,代码来源:DatabaseConfiguration.java


示例14: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
public PlatformTransactionManager transactionManager(SessionFactory sessionFatory) {
    final HibernateTransactionManager txm = new HibernateTransactionManager();
    txm.setSessionFactory(sessionFatory);
    return txm;
}
 
开发者ID:optionfactory,项目名称:hibernate-json,代码行数:7,代码来源:JsonDriverTest.java


示例15: buildTransactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
private HibernateTransactionManager buildTransactionManager(String name, Config config, DataSource dataSource, JdbcConfig jdbc) {
	return HibernateSessionBuilder.builder().packages(config.getDataSources().getOrElse(name, Arrays.asList())).dataSource(dataSource).env(jdbc).build()
			.transactionManager();
}
 
开发者ID:aol,项目名称:micro-server,代码行数:5,代码来源:HibernateSpringConfigurer.java


示例16: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
@Autowired
public HibernateTransactionManager transactionManager(SessionFactory _sessionFactory) {
	HibernateTransactionManager hibernateTransactionManager = new HibernateTransactionManager(_sessionFactory);
	return hibernateTransactionManager;
}
 
开发者ID:sylvainleroux,项目名称:bank,代码行数:7,代码来源:BankConfig.java


示例17: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
PlatformTransactionManager transactionManager(@Autowired SessionFactory sessionFactory) {
    return new HibernateTransactionManager(sessionFactory);
}
 
开发者ID:cims-bioko,项目名称:cims-server,代码行数:5,代码来源:PersistenceConfig.java


示例18: transactionManager

import org.springframework.orm.hibernate5.HibernateTransactionManager; //导入依赖的package包/类
@Bean
public PlatformTransactionManager transactionManager() {
	return new HibernateTransactionManager(sessionFactory());
}
 
开发者ID:hantsy,项目名称:spring4-sandbox,代码行数:5,代码来源:Hibernate5Config.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java UiTemplate类代码示例发布时间:2022-05-21
下一篇:
Java ContainerResponse类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap