org.hibernate.boot.registry.StandardServiceRegistryBuilderhibernate4.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();