Class DataSourceTenantConnectionResolver
java.lang.Object
io.quarkus.hibernate.orm.runtime.tenant.DataSourceTenantConnectionResolver
- All Implemented Interfaces:
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
ConstructorDescriptionDataSourceTenantConnectionResolver
(String persistenceUnitName, Optional<String> dataSourceName, MultiTenancyStrategy multiTenancyStrategy, String multiTenancySchemaDataSourceName) -
Method Summary
-
Constructor Details
-
DataSourceTenantConnectionResolver
public DataSourceTenantConnectionResolver() -
DataSourceTenantConnectionResolver
public DataSourceTenantConnectionResolver(String persistenceUnitName, Optional<String> dataSourceName, MultiTenancyStrategy multiTenancyStrategy, String multiTenancySchemaDataSourceName)
-
-
Method Details
-
resolve
Description copied from interface:TenantConnectionResolver
Returns a connection provider for the current tenant based on the context.- Specified by:
resolve
in 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.
-