// Fetch and pre-process the Hibernate mapping descriptors.
loadHibernateDescriptors(hbmConfig);
// Initialize the Hibernate session factory.
ServiceRegistry serviceRegistry = new ServiceRegistryBuilder().applySettings(hbmConfig.getProperties()).buildServiceRegistry();
SessionFactory factory = hbmConfig.buildSessionFactory(serviceRegistry);
hibernateSessionFactoryProvider.setSessionFactory(factory);
// Set the default schema if specified via system property or via hibernate configuration.
// NOTE: To set the default schema via hibernate configuration, the hibernate.cfg.xml file must be modified.