Package org.hibernate.service

Examples of org.hibernate.service.ServiceRegistryBuilder


  }

  private static StandardServiceRegistryImpl createServiceRegistry(Properties properties) {
    Environment.verifyProperties( properties );
    ConfigurationHelper.resolvePlaceHolders( properties );
    return (StandardServiceRegistryImpl) new ServiceRegistryBuilder().applySettings( properties ).buildServiceRegistry();
  }
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 (databaseAutoSynchronizer != null) {
View Full Code Here

  SessionFactory buildSessionFactory() throws HibernateException {
        LOG.startingServiceAtJndiName( boundName );
        LOG.serviceProperties( properties );
        return buildConfiguration().buildSessionFactory(
        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

  }

  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

  }

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

    hibernateConfiguration.addAnnotatedClass( Foo.class );
    Properties properties = new Properties();
    properties.setProperty( "hibernate.search.default.directory_provider", "ram" );
    hibernateConfiguration.getProperties().putAll( properties );

    ServiceRegistryBuilder registryBuilder = new ServiceRegistryBuilder();
    registryBuilder.applySettings( hibernateConfiguration.getProperties() );

    ServiceRegistry serviceRegistry = ServiceRegistryTools.build( registryBuilder );
    try {
      hibernateConfiguration.buildSessionFactory( serviceRegistry );
      fail( "ByteMan should have forced an exception" );
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

    for ( Class<?> annotatedClass : annotatedClasses ) {
      hibConfiguration.addAnnotatedClass( annotatedClass );
    }
    hibConfiguration.getProperties().putAll( cfg );

    ServiceRegistryBuilder registryBuilder = new ServiceRegistryBuilder();
    registryBuilder.applySettings( hibConfiguration.getProperties() );

    final ServiceRegistry serviceRegistry = ServiceRegistryTools.build( registryBuilder );
    SessionFactoryImpl sessionFactoryImpl = (SessionFactoryImpl) hibConfiguration.buildSessionFactory(
        serviceRegistry
    );
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.