| Hi guys, I don't know if this is the same problem I am facing with 5.1.0 but mine is definitely also related to filters. We have implemented multi-tenancy within one schema using a discriminator clolumn with filters. This worked great with hibernate 4.x. Since the latest upgrade to 5.1.0 the filters' query parameters don't get set resulting in exceptions like the following:
I have tracked it down to QueryParameters line 472 method processFilters:
if ( filters.size() == 0 || !sql.contains( ParserHelper.HQL_VARIABLE_PREFIX ) ) {
processedPositionalParameterValues = getPositionalParameterValues();
processedPositionalParameterTypes = getPositionalParameterTypes();
processedSQL = sql;
}
where the contains condition prevents parameter binding. This is the filter definition:
@FilterDef(name = "tenancy",
parameters = @ParamDef(name = "clientIds", type = "string"),
defaultCondition = "($FILTER_PLACEHOLDER$.client is null or $FILTER_PLACEHOLDER$.client IN (:clientIds))"),
Is this bug related or should I open a new issue? Kind regards, Sebastian |