Package org.hibernate.service

Examples of org.hibernate.service.ServiceRegistryBuilder


      }
    }
  }

  private ServiceRegistry buildLifecycleControledServiceRegistry(BootstrapServiceRegistryBuilder builder) {
    final ServiceRegistryBuilder serviceRegistryBuilder = new ServiceRegistryBuilder(
        builder.with( new JpaIntegrator() ).build()
    );
    serviceRegistryBuilder.applySettings( cfg.getProperties() );
    configure( (Properties ) null, null );
    NamingHelper.bind( this );
    final ServiceRegistry serviceRegistry = serviceRegistryBuilder.buildServiceRegistry();
    SessionFactoryObserver serviceRegistryCloser = new SessionFactoryObserver() {
      @Override
      public void sessionFactoryCreated(SessionFactory factory) {
      }
View Full Code Here


            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
            final BootstrapServiceRegistryBuilder bootstrapbuilder = new BootstrapServiceRegistryBuilder();
            builder = new ServiceRegistryBuilder(bootstrapbuilder.build()).applySettings(properties);
            serviceRegistry = builder.buildServiceRegistry();

            // Create the SessionFactory from Configuration
            sessionFactory = configuration.configure("hibernate.cfg.xml").buildSessionFactory(serviceRegistry);
View Full Code Here

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
            final BootstrapServiceRegistryBuilder bootstrapbuilder = new BootstrapServiceRegistryBuilder();
            builder = new ServiceRegistryBuilder(bootstrapbuilder.build()).applySettings(properties);
            serviceRegistry = builder.buildServiceRegistry();
            // Create the SessionFactory from Configuration
            sessionFactory = configuration.configure("hibernate.cfg.xml").buildSessionFactory(serviceRegistry);
            // Session session = sessionFactory.openSession();
View Full Code Here

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
            final BootstrapServiceRegistryBuilder bootstrapbuilder = new BootstrapServiceRegistryBuilder();
            builder = new ServiceRegistryBuilder(bootstrapbuilder.build()).applySettings(properties);
            serviceRegistry = builder.buildServiceRegistry();
            // Create the SessionFactory from Configuration
            sessionFactory = configuration.configure("hibernate.cfg.xml").buildSessionFactory(serviceRegistry);
            // Session session = sessionFactory.openSession();
View Full Code Here

            Environment.verifyProperties(properties);
            ConfigurationHelper.resolvePlaceHolders(properties);

            // build the serviceregistry
            final BootstrapServiceRegistryBuilder bootstrapbuilder = new BootstrapServiceRegistryBuilder();
            builder = new ServiceRegistryBuilder(bootstrapbuilder.build()).applySettings(properties);
            serviceRegistry = builder.buildServiceRegistry();
            // Create the SessionFactory from Configuration
            sessionFactory = configuration.configure("hibernate.cfg.xml").buildSessionFactory(serviceRegistry);

        } catch (Throwable ex) { // Make sure you log the exception, as it might be swallowed
View Full Code Here

  }

  private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
  }
View Full Code Here

  }

  private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
  }
View Full Code Here

   * @deprecated Use {@link #buildSessionFactory(ServiceRegistry)} instead
   */
  public SessionFactory buildSessionFactory() throws HibernateException {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    final ServiceRegistry serviceRegistry =  new ServiceRegistryBuilder()
        .applySettings( properties )
        .buildServiceRegistry();
    setSessionFactoryObserver(
        new SessionFactoryObserver() {
          @Override
View Full Code Here

        // 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);

        // Synchronize the database schema.
        if (isEnableDatabaseAutoSynchronization() && getDatabaseAutoSynchronizer() != null) {
View Full Code Here

   }

   public SessionFactory buildSessionFactory() throws HibernateException
   {

      ServiceRegistry servReg = new ServiceRegistryBuilder().applySettings(getProperties()).buildServiceRegistry();
      SessionFactory sessionFactory = buildSessionFactory(servReg);

      return sessionFactory;
   }
View Full Code Here

TOP

Related Classes of org.hibernate.service.ServiceRegistryBuilder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.