/** * Return the connection where tenantId is optionally provided by a lazy loading query. */ Connection getConnectionForTenant(Object tenantId) throws SQLException { Connection connection = dataSource.getConnection(); connection.setSchema(schemaProvider.schema(tenantId)); return connection; }
/** * Returns the DB schema for the current user Tenant Id. */ private String tenantSchema() { return schemaProvider.schema(tenantProvider.currentId()); }