Skip to content

Commit

Permalink
MID-9625: Fixed inOid and ownedByOid support of expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
tonydamage committed Apr 16, 2024
1 parent f60cdcb commit a8e223f
Showing 1 changed file with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,17 @@ protected ObjectFilter create(QueryParsingContext.Local context, QName matchingR
@Override
protected ObjectFilter create(QueryParsingContext.Local context, QName matchingRule,
SubfilterOrValueContext subfilterOrValue) throws SchemaException {

if (subfilterOrValue.expression() != null) {
var expression = parseExpression(subfilterOrValue.expression());
return InOidFilterImpl.createInOid(false, expression);
}
if (isVariablePath(subfilterOrValue.singleValue())) {
var rightPath = path(context.itemDef(), subfilterOrValue.singleValue().path());
var expression = parseExpression(rightPath);
return InOidFilterImpl.createInOid(false, expression);
}

return InOidFilterImpl.createInOid(requireLiterals(String.class, filterName, subfilterOrValue));
}
})
Expand All @@ -475,6 +486,18 @@ protected ObjectFilter create(QueryParsingContext.Local context, QName matchingR
@Override
protected ObjectFilter create(QueryParsingContext.Local context, QName matchingRule,
SubfilterOrValueContext subfilterOrValue) throws SchemaException {

if (subfilterOrValue.expression() != null) {
var expression = parseExpression(subfilterOrValue.expression());
return InOidFilterImpl.createInOid(true, expression);
}
if (isVariablePath(subfilterOrValue.singleValue())) {
var rightPath = path(context.itemDef(), subfilterOrValue.singleValue().path());
var expression = parseExpression(rightPath);
return InOidFilterImpl.createInOid(true, expression);
}


return InOidFilterImpl.createOwnerHasOidIn(requireLiterals(String.class, filterName, subfilterOrValue));
}
})
Expand Down

0 comments on commit a8e223f

Please sign in to comment.