Skip to content

Commit

Permalink
sqale: RefFilter(values = null) is NOT exists filter according to old…
Browse files Browse the repository at this point in the history
… repo
  • Loading branch information
tonydamage committed Sep 29, 2021
1 parent 4f953ed commit 76ce05d
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,15 @@ public Predicate process(RefFilter filter) {
SqlQueryContext<?, Q, R> refContext = context.subquery(referenceMapping);
SQLQuery<?> subquery = refContext.sqlQuery();
Q ref = refContext.path();
return subquery
subquery = subquery
.where(referenceMapping.correlationPredicate().apply(context.path(), ref))
.where(new RefItemFilterProcessor(
context, ref.targetOid, ref.targetType, ref.relationId, null)
.process(filter))
.exists();
.process(filter));
if (filter.getValues() == null) {
// If values == null, we search for all items without reference
return subquery.notExists();
}
return subquery.exists();
}
}

0 comments on commit 76ce05d

Please sign in to comment.