获取SessionFactory的工具类
来源:互联网 发布:mac版的photoshop cc 编辑:程序博客网 时间:2024/06/05 00:17
package com.zhu.util;import org.hibernate.SessionFactory;import org.hibernate.boot.registry.StandardServiceRegistryBuilder;import org.hibernate.cfg.Configuration;import org.hibernate.service.ServiceRegistry;public class HibernateUtil {private static final SessionFactory sessionFactory=buildSessionFactory();private static SessionFactory buildSessionFactory(){Configuration configuration=new Configuration().configure(); ServiceRegistry serviceRegistry=new StandardServiceRegistryBuilder().applySettings(configuration.getProperties()).build(); SessionFactory sessionFactory=configuration.buildSessionFactory(serviceRegistry); return sessionFactory;}public static SessionFactory getSessionFactory(){return sessionFactory;}}
阅读全文
1 0
- 获取SessionFactory的工具类
- hibernate 获取 SessionFactory 的工具类
- hibernate获取sessionFactory工具类
- sessionFactory的工具类
- sessionfactory的工具类
- Hibernate工具类之获取SessionFactory
- SessionFactory工具类
- Hibernate4 获取SessionFactory 的方式
- hibernate SessionFactory的获取方法
- hibernate 获取SessionFactory的方法
- Hibernate4 获取SessionFactory 的方式
- Hibernate创建sessionFactory工具类
- Hibernate创建sessionFactory,session和关闭session的工具类
- Hibernate4中获取SessionFactory的方法
- 获取SessionFactory对象的三种方式
- Hibernate4.3.9获取SessionFactory的方法
- Hibernate4 获取SessionFactory 的2种方式
- SpringMVC中无法获取SessionFactory的解决!
- [LeetCode] 106. Construct Binary Tree from Inorder and Postorder Traversal
- java整数和byte数组之间的转换
- SVN上传
- 线程安全总结
- 贪吃蛇-----小游戏
- 获取SessionFactory的工具类
- JavaScript Math 对象
- 自定义相机旋转拍照角度
- MySQL分组查询时出现错误SELECT list is not in GROUP BY ;this is incompatible with sql_mode=only_full_group_by
- ppt后续更新模板(二)说明
- 练习赛ming最优安排(贪心)
- testNG入门教程
- 在二叉查找树中插入节点-LintCode
- PHP递归无限分类