标签:style blog io ar color sp on div log
package cn.com.xf; import org.hibernate.SessionFactory; import org.hibernate.boot.registry.StandardServiceRegistryBuilder; import org.hibernate.cfg.Configuration; import org.hibernate.service.ServiceRegistry; public class HibernateUtils { private static SessionFactory sessionFactory; private static ServiceRegistry serviceRegistry; public static SessionFactory createSessionFactory() { Configuration configuration = new Configuration().configure(); serviceRegistry = new StandardServiceRegistryBuilder().applySettings( configuration.getProperties()).build(); sessionFactory = configuration.buildSessionFactory(serviceRegistry); return sessionFactory; } }
Hibernate4.3.x中SessionFactory的获取方法
标签:style blog io ar color sp on div log
原文地址:http://www.cnblogs.com/jikoy/p/4160295.html