StandardServiceRegistryBuilder
org.hibernate.boot.registry.StandardServiceRegistryBuilder
hibernate4.3
Configuration cfg = new Configuration() .configure(); ServiceRegistry serviceRegistry = new ServiceRegistryBuilder() .applySettings(cfg.getProperties()) .buildServiceRegistry(); /*ServiceRegistry serviceRegistry = new StandardServiceRegistryBuilder() .applySettings(cfg.getProperties()).build();*/ SessionFactory sessionFactory = cfg.buildSessionFactory(serviceRegistry); Session session = sessionFactory.openSession(); Transaction tx = session.beginTransaction();
本博客文章皆出于学习目的,个人总结或摘抄整理自网络。引用参考部分在文章中都有原文链接,如疏忽未给出请联系本人。另外,作为一名菜鸟程序媛,如文章内容有错误,欢迎点击博客右上方的扣扣链接指导交流。