@@ -130,6 +130,7 @@ private static void definesCondition(CriteriaCondition condition,
130
130
char entity , int counter ) {
131
131
132
132
Element document = condition .element ();
133
+ int localCounter = counter ;
133
134
switch (condition .condition ()) {
134
135
case IN :
135
136
appendCondition (aql , params , entity , document , IN );
@@ -157,27 +158,26 @@ private static void definesCondition(CriteriaCondition condition,
157
158
for (CriteriaCondition dc : document .get (new TypeReference <List <CriteriaCondition >>() {
158
159
})) {
159
160
160
- if (isFirstCondition (aql , counter )) {
161
+ if (isFirstCondition (aql , localCounter )) {
161
162
aql .append (AND );
162
163
}
163
- definesCondition (dc , aql , params , entity , ++counter );
164
+ definesCondition (dc , aql , params , entity , ++localCounter );
164
165
}
165
166
return ;
166
167
case OR :
167
168
168
169
for (CriteriaCondition dc : document .get (new TypeReference <List <CriteriaCondition >>() {
169
170
})) {
170
- if (isFirstCondition (aql , counter )) {
171
+ if (isFirstCondition (aql , localCounter )) {
171
172
aql .append (OR );
172
173
}
173
- definesCondition (dc , aql , params , entity , ++counter );
174
+ definesCondition (dc , aql , params , entity , ++localCounter );
174
175
}
175
176
return ;
176
177
case NOT :
177
178
CriteriaCondition documentCondition = document .get (CriteriaCondition .class );
178
- aql .append (NOT );
179
- aql .append (START_EXPRESSION );
180
- definesCondition (documentCondition , aql , params , entity , ++counter );
179
+ aql .append (NOT ).append (START_EXPRESSION );
180
+ definesCondition (documentCondition , aql , params , entity , ++localCounter );
181
181
aql .append (END_EXPRESSION );
182
182
return ;
183
183
default :
0 commit comments