Package org.hibernate

Examples of org.hibernate.MultiTenancyStrategy


    if ( debugEnabled ) {
      LOG.debugf( "Check Nullability in Core (should be disabled when Bean Validation is on): %s", enabledDisabled(checkNullability) );
    }
    settings.setCheckNullability(checkNullability);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );
View Full Code Here


  }

  @Override
  @SuppressWarnings( {"unchecked"})
  public MultiTenantConnectionProvider initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    final MultiTenancyStrategy strategy = MultiTenancyStrategy.determineMultiTenancyStrategyconfigurationValues );
    if ( strategy == MultiTenancyStrategy.NONE || strategy == MultiTenancyStrategy.DISCRIMINATOR ) {
      // nothing to do, but given the separate hierarchies have to handle this here.
      return null;
    }
View Full Code Here

    return ConnectionProvider.class;
  }

  @Override
  public ConnectionProvider initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    final MultiTenancyStrategy strategy = MultiTenancyStrategy.determineMultiTenancyStrategyconfigurationValues );
    if ( strategy == MultiTenancyStrategy.DATABASE || strategy == MultiTenancyStrategy.SCHEMA ) {
      // nothing to do, but given the separate hierarchies have to handle this here.
      return null;
    }
View Full Code Here

    }
    this.sqlExceptionHelper = new SqlExceptionHelper( sqlExceptionConverter );
  }

  private JdbcConnectionAccess buildJdbcConnectionAccess(Map configValues) {
    final MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );

    if ( MultiTenancyStrategy.NONE == multiTenancyStrategy ) {
      connectionProvider = serviceRegistry.getService( ConnectionProvider.class );
      return new ConnectionProviderJdbcConnectionAccess( connectionProvider );
    }
View Full Code Here

    if ( statementFetchSize != null && debugEnabled ) {
      LOG.debugf( "JDBC result set fetch size: %s", statementFetchSize );
    }
    settings.setJdbcFetchSize(statementFetchSize);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

    String releaseModeName = ConfigurationHelper.getString( AvailableSettings.RELEASE_CONNECTIONS, properties, "auto" );
    if ( debugEnabled ) {
      LOG.debugf( "Connection release mode: %s", releaseModeName );
    }
    ConnectionReleaseMode releaseMode;
    if ( "auto".equals(releaseModeName) ) {
      releaseMode = serviceRegistry.getService( TransactionFactory.class ).getDefaultReleaseMode();
    }
    else {
      releaseMode = ConnectionReleaseMode.parse( releaseModeName );
      if ( releaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
        // we need to make sure the underlying JDBC connection access supports aggressive release...
        boolean supportsAgrressiveRelease = multiTenancyStrategy.requiresMultiTenantConnectionProvider()
            ? serviceRegistry.getService( MultiTenantConnectionProvider.class ).supportsAggressiveRelease()
            : serviceRegistry.getService( ConnectionProvider.class ).supportsAggressiveRelease();
        if ( ! supportsAgrressiveRelease ) {
          LOG.unsupportedAfterStatement();
          releaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;
View Full Code Here

        typeInfoSet
    );
  }

  private JdbcConnectionAccess buildJdbcConnectionAccess(Map configValues) {
    final MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );

    if ( MultiTenancyStrategy.NONE == multiTenancyStrategy ) {
      connectionProvider = serviceRegistry.getService( ConnectionProvider.class );
      return new ConnectionProviderJdbcConnectionAccess( connectionProvider );
    }
View Full Code Here

    }
    this.sqlExceptionHelper = new SqlExceptionHelper( sqlExceptionConverter );
  }

  private JdbcConnectionAccess buildJdbcConnectionAccess(Map configValues) {
    final MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );

    if ( MultiTenancyStrategy.NONE == multiTenancyStrategy ) {
      connectionProvider = serviceRegistry.getService( ConnectionProvider.class );
      return new ConnectionProviderJdbcConnectionAccess( connectionProvider );
    }
View Full Code Here

    if ( statementFetchSize != null && debugEnabled ) {
      LOG.debugf( "JDBC result set fetch size: %s", statementFetchSize );
    }
    settings.setJdbcFetchSize(statementFetchSize);

    MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( properties );
    if ( debugEnabled ) {
      LOG.debugf( "multi-tenancy strategy : %s", multiTenancyStrategy );
    }
    settings.setMultiTenancyStrategy( multiTenancyStrategy );

    String releaseModeName = ConfigurationHelper.getString( AvailableSettings.RELEASE_CONNECTIONS, properties, "auto" );
    if ( debugEnabled ) {
      LOG.debugf( "Connection release mode: %s", releaseModeName );
    }
    ConnectionReleaseMode releaseMode;
    if ( "auto".equals(releaseModeName) ) {
      releaseMode = serviceRegistry.getService( TransactionFactory.class ).getDefaultReleaseMode();
    }
    else {
      releaseMode = ConnectionReleaseMode.parse( releaseModeName );
      if ( releaseMode == ConnectionReleaseMode.AFTER_STATEMENT ) {
        // we need to make sure the underlying JDBC connection access supports aggressive release...
        boolean supportsAgrressiveRelease = multiTenancyStrategy.requiresMultiTenantConnectionProvider()
            ? serviceRegistry.getService( MultiTenantConnectionProvider.class ).supportsAggressiveRelease()
            : serviceRegistry.getService( ConnectionProvider.class ).supportsAggressiveRelease();
        if ( ! supportsAgrressiveRelease ) {
          LOG.unsupportedAfterStatement();
          releaseMode = ConnectionReleaseMode.AFTER_TRANSACTION;
View Full Code Here

  }

  @Override
  @SuppressWarnings( {"unchecked"})
  public MultiTenantConnectionProvider initiateService(Map configurationValues, ServiceRegistryImplementor registry) {
    final MultiTenancyStrategy strategy = MultiTenancyStrategy.determineMultiTenancyStrategyconfigurationValues );
    if ( strategy == MultiTenancyStrategy.NONE || strategy == MultiTenancyStrategy.DISCRIMINATOR ) {
      // nothing to do, but given the separate hierarchies have to handle this here.
    }

    final Object configValue = configurationValues.get( AvailableSettings.MULTI_TENANT_CONNECTION_PROVIDER );
View Full Code Here

    }
    this.sqlExceptionHelper = new SqlExceptionHelper( sqlExceptionConverter );
  }

  private JdbcConnectionAccess buildJdbcConnectionAccess(Map configValues) {
    final MultiTenancyStrategy multiTenancyStrategy = MultiTenancyStrategy.determineMultiTenancyStrategy( configValues );

    if ( MultiTenancyStrategy.NONE == multiTenancyStrategy ) {
      connectionProvider = serviceRegistry.getService( ConnectionProvider.class );
      return new ConnectionProviderJdbcConnectionAccess( connectionProvider );
    }
View Full Code Here

TOP

Related Classes of org.hibernate.MultiTenancyStrategy

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.