From 3dc6b329aacbb6958efd834c85143231595b0d99 Mon Sep 17 00:00:00 2001 From: Yuriy M <95305560+yuremm@users.noreply.github.com> Date: Wed, 2 Nov 2022 19:08:11 +0300 Subject: [PATCH] fix: fix OR filters join when sub-filters uses lower (#2850) Co-authored-by: Yuriy Movchan --- jans-orm/couchbase-sample/pom.xml | 6 ++++++ .../orm/couchbase/impl/CouchbaseFilterConverter.java | 10 +++++----- jans-orm/spanner-sample/pom.xml | 6 ++++++ .../orm/cloud/spanner/impl/SpannerFilterConverter.java | 10 +++++----- .../java/io/jans/orm/sql/impl/SqlFilterConverter.java | 10 +++++----- 5 files changed, 27 insertions(+), 15 deletions(-) diff --git a/jans-orm/couchbase-sample/pom.xml b/jans-orm/couchbase-sample/pom.xml index bd7126a4c47..3bbb35ffadd 100644 --- a/jans-orm/couchbase-sample/pom.xml +++ b/jans-orm/couchbase-sample/pom.xml @@ -43,6 +43,12 @@ slf4j-simple + + + com.couchbase.client + java-client + + org.apache.logging.log4j 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 5dad87f4896..8e81fe82603 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 @@ -97,16 +97,16 @@ public ConvertedExpression convertToCouchbaseFilter(Filter genericFilter, Mapslf4j-simple + + + com.google.cloud + google-cloud-spanner + + org.apache.logging.log4j diff --git a/jans-orm/spanner/src/main/java/io/jans/orm/cloud/spanner/impl/SpannerFilterConverter.java b/jans-orm/spanner/src/main/java/io/jans/orm/cloud/spanner/impl/SpannerFilterConverter.java index f6713230df3..6fba6e35c84 100644 --- a/jans-orm/spanner/src/main/java/io/jans/orm/cloud/spanner/impl/SpannerFilterConverter.java +++ b/jans-orm/spanner/src/main/java/io/jans/orm/cloud/spanner/impl/SpannerFilterConverter.java @@ -129,16 +129,16 @@ private ConvertedExpression convertToSqlFilterImpl(TableMapping tableMapping, Fi if (!canJoinOrFilters) { continue; } - - if (tmpFilter.getMultiValued() != null) { - canJoinOrFilters = false; - continue; - } if ((FilterType.EQUALITY != tmpFilter.getType()) || (tmpFilter.getFilters() != null)) { canJoinOrFilters = false; continue; } + + if (tmpFilter.getMultiValued() != null) { + canJoinOrFilters = false; + continue; + } Boolean isMultiValuedDetected = determineMultiValuedByType(tmpFilter.getAttributeName(), propertiesAnnotationsMap); if (!Boolean.FALSE.equals(isMultiValuedDetected)) { diff --git a/jans-orm/sql/src/main/java/io/jans/orm/sql/impl/SqlFilterConverter.java b/jans-orm/sql/src/main/java/io/jans/orm/sql/impl/SqlFilterConverter.java index 52d83db3f01..7b81eb92316 100644 --- a/jans-orm/sql/src/main/java/io/jans/orm/sql/impl/SqlFilterConverter.java +++ b/jans-orm/sql/src/main/java/io/jans/orm/sql/impl/SqlFilterConverter.java @@ -123,17 +123,17 @@ private ConvertedExpression convertToSqlFilterImpl(TableMapping tableMapping, Fi if (!canJoinOrFilters) { continue; } - - if (tmpFilter.getMultiValued() != null) { - canJoinOrFilters = false; - continue; - } if ((FilterType.EQUALITY != tmpFilter.getType()) || (tmpFilter.getFilters() != null)) { canJoinOrFilters = false; continue; } + if (tmpFilter.getMultiValued() != null) { + canJoinOrFilters = false; + continue; + } + Boolean isMultiValuedDetected = determineMultiValuedByType(tmpFilter.getAttributeName(), propertiesAnnotationsMap); if (!Boolean.FALSE.equals(isMultiValuedDetected)) { if (!Boolean.FALSE.equals(currentGenericFilter.getMultiValued())) {