Hibernate工具类
来源:互联网 发布:男生基本款大衣 知乎 编辑:程序博客网 时间:2024/06/06 17:13
package com.wsl.util;
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static SessionFactory sessionFactory = null;
static {
sessionFactory = new Configuration().configure().buildSessionFactory();
}
public static Session getSession(){
return sessionFactory.openSession();
}
}
import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.Configuration;
public class HibernateUtil {
private static SessionFactory sessionFactory = null;
static {
sessionFactory = new Configuration().configure().buildSessionFactory();
}
public static Session getSession(){
return sessionFactory.openSession();
}
}
阅读全文
0 0
- Hibernate工具类
- Hibernate工具类
- Hibernate工具类
- Hibernate 的工具类
- Hibernate工具类
- HIbernate工具类
- Hibernate工具类模版
- Hibernate 工具类
- hibernate的工具类
- Hibernate工具类
- Hibernate的工具类
- Hibernate工具类
- Hibernate的工具类
- hibernate分页工具类
- hibernate 操作工具类
- hibernate工具类
- Hibernate工具类
- hibernate连接工具类
- 《Python学习手册》学习笔记(12)之第12章if测试和语法规则(关键词:编程语言/Python/if)
- HDU3308线段树区间合并
- put()方法和write()方法
- HDU 5954 Do not pour out(二分+积分)
- bzoj 4415: [Shoi2013]发牌
- Hibernate工具类
- equals方法的覆盖
- 趣图 | 懂算法的程序员,不懂的程序员
- 程序员中的老司机们,30 后的路该开向哪里?
- 公众号“今日作文素材”文章列表 (20171001-20171031)
- BP learning算法简单推导
- 《Python学习手册》学习笔记(13)之第13章while和for循环(关键词:编程语言/Python/while/for)
- Android开发者2017年最值得关注的25个库
- 谈谈反爬虫“政策与对策”