Package org.hibernate.service

Examples of org.hibernate.service.ServiceRegistry


  @Override
  public void generateSchema() {
    processProperties();

    final ServiceRegistry serviceRegistry = buildServiceRegistry();
    final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );

    // IMPL NOTE : TCCL handling here is temporary.
    //    It is needed because this code still uses Hibernate Configuration and Hibernate commons-annotations
    //     in turn which relies on TCCL being set.
View Full Code Here


  @SuppressWarnings("unchecked")
  public EntityManagerFactory build() {
    processProperties();

    final ServiceRegistry serviceRegistry = buildServiceRegistry();
    final ClassLoaderService classLoaderService = serviceRegistry.getService( ClassLoaderService.class );

    // IMPL NOTE : TCCL handling here is temporary.
    //    It is needed because this code still uses Hibernate Configuration and Hibernate commons-annotations
    //     in turn which relies on TCCL being set.
View Full Code Here

    @Override
    public void sessionFactoryClosed(SessionFactory sessionFactory) {
      SessionFactoryImplementor sfi = ( (SessionFactoryImplementor) sessionFactory );
      sfi.getServiceRegistry().destroy();
      ServiceRegistry basicRegistry = sfi.getServiceRegistry().getParentServiceRegistry();
      ( (ServiceRegistryImplementor) basicRegistry ).destroy();
    }
View Full Code Here

  protected UserTransaction locateUserTransaction() {
    return new UserTransactionImpl( neo4jDb() );
  }

  private GraphDatabaseAPI neo4jDb() {
    ServiceRegistry serviceRegistry = serviceRegistry();
    serviceRegistry = serviceRegistry
        .getService( SessionFactoryServiceRegistryFactory.class )
        .buildServiceRegistry( (SessionFactoryImplementor) null, (Configuration) null );
    Neo4jDatastoreProvider service = (Neo4jDatastoreProvider) serviceRegistry.getService( DatastoreProvider.class );
    return (GraphDatabaseAPI) service.getDataBase();
  }
View Full Code Here

    this.dropSQL = configuration.generateDropSchemaScript( dialect );
    this.createSQL = configuration.generateSchemaCreationScript( dialect );
  }

  public SchemaExport(MetadataImplementor metadata) {
    ServiceRegistry serviceRegistry = metadata.getServiceRegistry();
    this.connectionHelper = new SuppliedConnectionProviderConnectionHelper(
        serviceRegistry.getService( ConnectionProvider.class )
    );
        JdbcServices jdbcServices = serviceRegistry.getService( JdbcServices.class );
    this.sqlStatementLogger = jdbcServices.getSqlStatementLogger();
    this.formatter = ( sqlStatementLogger.isFormat() ? FormatStyle.DDL : FormatStyle.NONE ).getFormatter();
    this.sqlExceptionHelper = jdbcServices.getSqlExceptionHelper();

    this.importFiles = ConfigurationHelper.getString(
        AvailableSettings.HBM2DDL_IMPORT_FILES,
        serviceRegistry.getService( ConfigurationService.class ).getSettings(),
        DEFAULT_IMPORT_FILE
    );

    final Dialect dialect = jdbcServices.getDialect();
    this.dropSQL = metadata.getDatabase().generateDropSchemaScript( dialect );
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

      contextClassLoader = thread.getContextClassLoader();
      thread.setContextClassLoader( overridenClassLoader );
    }

    try {
      final ServiceRegistry serviceRegistry = buildLifecycleControledServiceRegistry( builder );
      return  new EntityManagerFactoryImpl(
          transactionType,
          discardOnClose,
          getSessionInterceptorClass( cfg.getProperties() ),
          cfg,
View Full Code Here

        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

      contextClassLoader = thread.getContextClassLoader();
      thread.setContextClassLoader( overridenClassLoader );
    }

    try {
      final ServiceRegistry serviceRegistry = buildLifecycleControledServiceRegistry( builder );
      return new EntityManagerFactoryImpl(
          transactionType,
          discardOnClose,
          getSessionInterceptorClass( cfg.getProperties() ),
          cfg,
View Full Code Here

        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

TOP

Related Classes of org.hibernate.service.ServiceRegistry

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.