Skip to content

Commit

Permalink
style: update queryaql converter
Browse files Browse the repository at this point in the history
Signed-off-by: Otavio Santana <[email protected]>
  • Loading branch information
otaviojava committed Dec 15, 2024
1 parent d49b434 commit 32bc587
Showing 1 changed file with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ private static void definesCondition(CriteriaCondition condition,
char entity, int counter) {

Element document = condition.element();
int localCounter = counter;
switch (condition.condition()) {
case IN:
appendCondition(aql, params, entity, document, IN);
Expand Down Expand Up @@ -157,27 +158,26 @@ private static void definesCondition(CriteriaCondition condition,
for (CriteriaCondition dc : document.get(new TypeReference<List<CriteriaCondition>>() {
})) {

if (isFirstCondition(aql, counter)) {
if (isFirstCondition(aql, localCounter)) {
aql.append(AND);
}
definesCondition(dc, aql, params, entity, ++counter);
definesCondition(dc, aql, params, entity, ++localCounter);
}
return;
case OR:

for (CriteriaCondition dc : document.get(new TypeReference<List<CriteriaCondition>>() {
})) {
if (isFirstCondition(aql, counter)) {
if (isFirstCondition(aql, localCounter)) {
aql.append(OR);
}
definesCondition(dc, aql, params, entity, ++counter);
definesCondition(dc, aql, params, entity, ++localCounter);
}
return;
case NOT:
CriteriaCondition documentCondition = document.get(CriteriaCondition.class);
aql.append(NOT);
aql.append(START_EXPRESSION);
definesCondition(documentCondition, aql, params, entity, ++counter);
aql.append(NOT).append(START_EXPRESSION);
definesCondition(documentCondition, aql, params, entity, ++localCounter);
aql.append(END_EXPRESSION);
return;
default:
Expand Down

0 comments on commit 32bc587

Please sign in to comment.