From 90987d74118b93637c568c73d747233861b2bd9b Mon Sep 17 00:00:00 2001 From: Yuriy M <95305560+yuremm@users.noreply.github.com> Date: Mon, 5 Sep 2022 19:32:34 +0300 Subject: [PATCH] fix: fix search with % (#2307) Co-authored-by: Yuriy Movchan --- .../orm/couchbase/impl/CouchbaseFilterConverter.java | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java b/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java index 7aaf8b9af8d..e914f7f4056 100644 --- a/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java +++ b/jans-orm/couchbase/src/main/java/io/jans/orm/couchbase/impl/CouchbaseFilterConverter.java @@ -241,16 +241,17 @@ public ConvertedExpression convertToCouchbaseFilter(Filter genericFilter, Map 0)) { + StringBuilder anyBuilder = new StringBuilder("%"); for (String any : subAny) { - String variableExpressionAny = buildVariableExpression(internalAttribute + "_any", multiValued, any, queryParameters); - filterParameters.add(variableExpressionAny); - like.append("$" + variableExpressionAny); - like.append("%"); + anyBuilder.append(any); + anyBuilder.append("%"); } + String variableExpressionAny = buildVariableExpression(internalAttribute + "_any", multiValued, anyBuilder.toString(), queryParameters); + like.append("$" + variableExpressionAny); + filterParameters.add(variableExpressionAny); } if (currentGenericFilter.getSubFinal() != null) {