use of org.hibernate.query.criteria.internal.PathImplementor in project CzechIdMng by bcvsolutions.
the class AbstractReadDtoService method checkFilterSizeExceeded.
/**
* Check limit of values given for IN predicates.
*
* @param predicate start predicate
* @since 10.6.0
*/
private void checkFilterSizeExceeded(Predicate predicate) {
if (predicate instanceof InPredicate) {
InPredicate<?> in = (InPredicate<?>) predicate;
// common property name => attribute is optional
String propertyName = "filter";
if (in.getExpression() instanceof PathImplementor) {
// TODO: remove root path as 'null', but it is not fit to filter property name anyway => hidden in UI message
propertyName = ((PathImplementor<?>) in.getExpression()).getPathIdentifier();
}
getFilterManager().checkFilterSizeExceeded(new FilterKey(getEntityClass(), propertyName), in.getValues());
}
if (predicate instanceof ExistsPredicate) {
checkFilterSizeExceeded(((ExistsPredicate) predicate).getSubquery().getRestriction());
}
predicate.getExpressions().forEach(expression -> {
if (expression instanceof Predicate) {
checkFilterSizeExceeded((Predicate) expression);
}
});
}
Aggregations