Commit 4574138493c9dd96532a5ceb11c519547a44132d
Committed by
Andrew Shvayka
1 parent
8036b1b1
Fix for Entity type filtering
Showing
1 changed file
with
5 additions
and
1 deletions
@@ -425,7 +425,11 @@ public class EntityKeyMapping { | @@ -425,7 +425,11 @@ public class EntityKeyMapping { | ||
425 | if (predicate.getType().equals(FilterPredicateType.NUMERIC)) { | 425 | if (predicate.getType().equals(FilterPredicateType.NUMERIC)) { |
426 | return this.buildNumericPredicateQuery(ctx, field, (NumericFilterPredicate) predicate); | 426 | return this.buildNumericPredicateQuery(ctx, field, (NumericFilterPredicate) predicate); |
427 | } else if (predicate.getType().equals(FilterPredicateType.STRING)) { | 427 | } else if (predicate.getType().equals(FilterPredicateType.STRING)) { |
428 | - return this.buildStringPredicateQuery(ctx, field, (StringFilterPredicate) predicate); | 428 | + if (key.getKey().equals("entityType") && !filterType.equals(EntityFilterType.RELATIONS_QUERY)){ |
429 | + field = ctx.getEntityType().toString(); | ||
430 | + } | ||
431 | + return this.buildStringPredicateQuery(ctx, field, (StringFilterPredicate) predicate) | ||
432 | + .replace(field + " ","'" + field + "' "); | ||
429 | } else { | 433 | } else { |
430 | return this.buildBooleanPredicateQuery(ctx, field, (BooleanFilterPredicate) predicate); | 434 | return this.buildBooleanPredicateQuery(ctx, field, (BooleanFilterPredicate) predicate); |
431 | } | 435 | } |