Hibernate4 buildSessionFactory过时解决方案HibernateUtil
来源:互联网 发布:sql培训班 编辑:程序博客网 时间:2024/05/21 11:09
hibernate 4 buildSessionFactory 已经过时 ,官方给出这样的写法
package com.bbs.tool;import org.hibernate.SessionFactory;import org.hibernate.cfg.Configuration;import org.hibernate.service.ServiceRegistry;import org.hibernate.service.ServiceRegistryBuilder; public class HibernateUtil { private static final SessionFactory sessionFactory = buildSessionFactory(); private static SessionFactory buildSessionFactory() { try { // Create the SessionFactory from hibernate.cfg.xml Configuration cfg = new Configuration(); cfg.configure(); ServiceRegistry sr = new ServiceRegistryBuilder().applySettings(cfg.getProperties()).buildServiceRegistry(); return cfg.buildSessionFactory(sr); } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed System.err.println("Initial SessionFactory creation failed." + ex); throw new ExceptionInInitializerError(ex); } } public static SessionFactory getSessionFactory() { return sessionFactory; }}
- Hibernate4 buildSessionFactory过时解决方案HibernateUtil
- Hibernate4.3.8 buildSessionFactory过时解决方案HibernateUtil
- Hibernate4.3 buildSessionFactory过时解决方案
- Hibernate4的buildSessionFactory过时
- Hibernate4 buildSessionFactory过时解决方案(Annotation也是一样解决)
- hibernate4.0 buildSessionFactory过时问题
- hibernate4.1.4 Final 中 buildSessionFactory() 过时
- Hibernate系列之----Hibernate4.1.5 buildSessionFactory过时
- hibernate4.0 中buildSessionFactory()
- Hibernate 4中buildSessionFactory()过时
- hibernate里的buildSessionFactory过时
- [Hibernate]关于Hibernate buildsessionfactory()过时处理
- Hibernate4环境搭建和HibernateUtil
- Hibernate3和Hibernate4的HibernateUtil
- Hibernate4中buildSessionFactory方法废弃问题。
- hibernate4.0 中buildSessionFactory()新方式解惑
- Hibernate4中buildSessionFactory方法废弃解决
- hibernate4.0以上的hibernateUtil工具类
- 资料保全与技术鉴定
- php中文乱码
- 如何使自己的程序只运行一次
- Sencha Touch 2 快速入门系列(五)-- 布局(Layouts)
- 备注
- Hibernate4 buildSessionFactory过时解决方案HibernateUtil
- 轮询
- ACE 开 发 环 境 构 建 笔 记
- Linux内核bridge中的数据包处理流程
- SELECT INTO 和 INSERT INTO SELECT 两种表复制语句 (自我复制语句)
- Flex 字幕滚动效果 网站公告效果
- HttpClient, 使用C#操作Web
- AndroidManifest.xml文件详解(二)
- 如何从github安装rails 2 的plugin