use of org.hibernate.internal.FilterAliasGenerator in project hibernate-orm by hibernate.
the class AbstractEntityPersister method applyFilterRestrictions.
@Override
public void applyFilterRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, SqlAstCreationState creationState) {
if (filterHelper == null) {
return;
}
final FilterAliasGenerator filterAliasGenerator = useQualifier && tableGroup != null ? getFilterAliasGenerator(tableGroup) : null;
filterHelper.applyEnabledFilters(predicateConsumer, filterAliasGenerator, enabledFilters);
}
use of org.hibernate.internal.FilterAliasGenerator in project hibernate-orm by hibernate.
the class AbstractCollectionPersister method applyBaseManyToManyRestrictions.
@Override
public void applyBaseManyToManyRestrictions(Consumer<Predicate> predicateConsumer, TableGroup tableGroup, boolean useQualifier, Map<String, Filter> enabledFilters, Set<String> treatAsDeclarations, SqlAstCreationState creationState) {
if (manyToManyFilterHelper == null && manyToManyWhereTemplate == null) {
return;
}
if (manyToManyFilterHelper != null) {
final FilterAliasGenerator aliasGenerator = elementPersister.getFilterAliasGenerator(tableGroup);
manyToManyFilterHelper.applyEnabledFilters(predicateConsumer, aliasGenerator, enabledFilters);
}
if (manyToManyWhereString != null) {
final TableReference tableReference = tableGroup.resolveTableReference(((Joinable) elementPersister).getTableName());
final String alias;
if (tableReference == null) {
alias = null;
} else if (useQualifier && tableReference.getIdentificationVariable() != null) {
alias = tableReference.getIdentificationVariable();
} else {
alias = tableReference.getTableId();
}
applyWhereFragments(predicateConsumer, alias, manyToManyWhereTemplate);
}
}
Aggregations