use of com.blazebit.persistence.view.metamodel.ViewFilterMapping in project blaze-persistence by Blazebit.
the class EntityViewSettingHelper method applyViewFilters.
private static <T, Q extends FullQueryBuilder<T, Q>> void applyViewFilters(EntityViewSetting<?, ?> setting, EntityViewManagerImpl evm, Q cb, ManagedViewTypeImplementor<?> viewType) {
// Add named view filter
for (String filterName : setting.getViewFilters()) {
ViewFilterMapping filterMapping = ((ViewType<?>) viewType).getViewFilter(filterName);
if (filterMapping == null) {
throw new IllegalArgumentException("Could not find view filter mapping with the name '" + filterName + "' in the entity view type '" + viewType.getJavaType().getName() + "'");
}
// TODO: allow parameter injection
ViewFilterProvider provider = evm.createViewFilter(filterMapping.getFilterClass());
provider.apply(cb);
}
}
Aggregations