Commit b0102f523ff946ef0779aae696c8130db6d971a7

Authored by Andrii Shvaika
1 parent 225682f6

Complex predicate fix

... ... @@ -426,11 +426,15 @@ public class EntityKeyMapping {
426 426
427 427 private String buildComplexPredicateQuery(QueryContext ctx, String alias, EntityKey key,
428 428 ComplexFilterPredicate predicate, EntityFilterType filterType) {
429   - return predicate.getPredicates().stream()
  429 + String result = predicate.getPredicates().stream()
430 430 .map(keyFilterPredicate -> this.buildPredicateQuery(ctx, alias, key, keyFilterPredicate, filterType))
431 431 .filter(Objects::nonNull).collect(Collectors.joining(
432 432 " " + predicate.getOperation().name() + " "
433 433 ));
  434 + if (!result.trim().isEmpty()) {
  435 + result = "( " + result + " )";
  436 + }
  437 + return result;
434 438 }
435 439
436 440 private String buildSimplePredicateQuery(QueryContext ctx, String alias, EntityKey key,
... ...