@Override public SearchCond visitNOT_EXPR(final SCIMFilterParser.NOT_EXPRContext ctx) { SearchCond cond = visit(ctx.expression()); if (cond.getAttributeCond() != null) { if (cond.getAttributeCond().getType() == AttributeCond.Type.ISNULL) { cond.getAttributeCond().setType(AttributeCond.Type.ISNOTNULL); } else if (cond.getAttributeCond().getType() == AttributeCond.Type.ISNOTNULL) { cond.getAttributeCond().setType(AttributeCond.Type.ISNULL); } } else if (cond.getAnyCond() != null) { if (cond.getAnyCond().getType() == AnyCond.Type.ISNULL) { cond.getAnyCond().setType(AnyCond.Type.ISNOTNULL); } else if (cond.getAnyCond().getType() == AnyCond.Type.ISNOTNULL) { cond.getAnyCond().setType(AnyCond.Type.ISNULL); } } else { cond = SearchCond.getNotLeafCond(cond); } return cond; }
query.append(getQuery(cond.getResourceCond(), cond.getType() == SearchCond.Type.NOT_LEAF, parameters, svs)); } else if (cond.getAttributeCond() != null) { query.append(getQuery(cond.getAttributeCond(), cond.getType() == SearchCond.Type.NOT_LEAF, parameters, svs)); try { involvedPlainAttrs.add(check(cond.getAttributeCond(), svs.anyTypeKind).getLeft().getKey()); } catch (IllegalArgumentException e) {
if (leaf.getAttributeCond() != null && leaf.getAttributeCond().getType() == AttributeCond.Type.ISNULL) { leaf.getAttributeCond().setType(AttributeCond.Type.ISNOTNULL); } else if (leaf.getAnyCond() != null && leaf.getAnyCond().getType() == AttributeCond.Type.ISNULL) { if (leaf.getAttributeCond() != null && "token".equals(leaf.getAttributeCond().getSchema()) && (leaf.getAttributeCond().getType() == AttributeCond.Type.ISNULL || leaf.getAttributeCond().getType() == AttributeCond.Type.ISNOTNULL) && leaf.getAttributeCond().getExpression() == null) { tokenCond.setSchema(leaf.getAttributeCond().getSchema()); tokenCond.setType(leaf.getAttributeCond().getType()); tokenCond.setExpression(null); leaf = SearchCond.getLeafCond(tokenCond);