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 Summary
Constructors Constructor Description DataSourceTenantConnectionResolver()DataSourceTenantConnectionResolver(String persistenceUnitName, Optional<String> dataSourceName, MultiTenancyStrategy multiTenancyStrategy, String multiTenancySchemaDataSourceName)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.hibernate.engine.jdbc.connections.spi.ConnectionProviderresolve(String tenantId)Returns a connection provider for the current tenant based on the context.
-
-
-
Constructor Detail
-
DataSourceTenantConnectionResolver
public DataSourceTenantConnectionResolver()
-
DataSourceTenantConnectionResolver
public DataSourceTenantConnectionResolver(String persistenceUnitName, Optional<String> dataSourceName, MultiTenancyStrategy multiTenancyStrategy, String multiTenancySchemaDataSourceName)
-
-
Method Detail
-
resolve
public org.hibernate.engine.jdbc.connections.spi.ConnectionProvider resolve(String tenantId)
Description copied from interface:TenantConnectionResolverReturns a connection provider for the current tenant based on the context.- Specified by:
resolvein interfaceTenantConnectionResolver- 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.
-
-