Code example for BootstrapServiceRegistryBuilder

0
            .setProperty("hibernate.connection.driver_class", "org.h2.Driver")
            .setProperty("hibernate.connection.url", "jdbc:h2:mem:test-publish")
            .setProperty("hibernate.connection.username", "sa")
            .setProperty("hibernate.connection.password", "");
		 
		BootstrapServiceRegistryBuilder bsrb = new BootstrapServiceRegistryBuilder().with(new Hibernate4Integrator());
		StandardServiceRegistryBuilder ssrb = new StandardServiceRegistryBuilder(bsrb.build()).applySettings(configuration.getProperties());
		ServiceRegistry serviceRegistry = ssrb.build();
		sessionFactory = configuration.buildSessionFactory(serviceRegistry);
	} 
	 
	protected void open() { 
		Method m;
		try { 
			m = sessionFactory.getClass().getMethod("openSession");
			session = (Session)m.invoke(sessionFactory);
		}  
		catch (Exception e) {
			throw new RuntimeException("Could not open session", e);
		}