Class DataSourceTenantConnectionResolver

java.lang.Object
io.quarkus.hibernate.orm.runtime.tenant.DataSourceTenantConnectionResolver
All Implemented Interfaces:
TenantConnectionResolver

public class DataSourceTenantConnectionResolver extends Object implements TenantConnectionResolver
Creates a database connection based on the data sources in the configuration file. The tenant identifier is used as the data source name.
Author:
Michael Schnell
  • Constructor Details

    • DataSourceTenantConnectionResolver

      public DataSourceTenantConnectionResolver()
    • DataSourceTenantConnectionResolver

      public DataSourceTenantConnectionResolver(String persistenceUnitName, Optional<String> dataSourceName, MultiTenancyStrategy multiTenancyStrategy, String multiTenancySchemaDataSourceName)
  • Method Details

    • resolve

      public org.hibernate.engine.jdbc.connections.spi.ConnectionProvider resolve(String tenantId)
      Description copied from interface: TenantConnectionResolver
      Returns a connection provider for the current tenant based on the context.
      Specified by:
      resolve in interface TenantConnectionResolver
      Parameters:
      tenantId - the tenant identifier. Required value that cannot be null.
      Returns:
      Hibernate connection provider for the current provider. A non-null value is required.