Skip to content

Commit

Permalink
fix: fix OR filters join when sub-filters uses lower (#2850)
Browse files Browse the repository at this point in the history
Co-authored-by: Yuriy Movchan <Yuriy.Movchan@gmail.com>
  • Loading branch information
yuremm and yurem authored Nov 2, 2022
1 parent 42ec86d commit 3dc6b32
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 15 deletions.
6 changes: 6 additions & 0 deletions jans-orm/couchbase-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<artifactId>slf4j-simple</artifactId>
</dependency>

<!-- Couchbase -->
<dependency>
<groupId>com.couchbase.client</groupId>
<artifactId>java-client</artifactId>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -97,16 +97,16 @@ public ConvertedExpression convertToCouchbaseFilter(Filter genericFilter, Map<St
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)) {
Expand Down
6 changes: 6 additions & 0 deletions jans-orm/spanner-sample/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@
<artifactId>slf4j-simple</artifactId>
</dependency>

<!-- Cloud Spanner -->
<dependency>
<groupId>com.google.cloud</groupId>
<artifactId>google-cloud-spanner</artifactId>
</dependency>

<!-- Logging -->
<dependency>
<groupId>org.apache.logging.log4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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())) {
Expand Down

0 comments on commit 3dc6b32

Please sign in to comment.