Improved CardCriteria to handle no selected color or card type without exception.

This commit is contained in:
LevelX2 2012-11-27 17:18:53 +01:00
parent 4b2e6a8bc0
commit caa07069b4

View file

@ -256,11 +256,17 @@ public class CardCriteria {
where.and(5);
colorClauses++;
}
where.or(colorClauses);
clausesCount++;
if (colorClauses > 0) {
where.or(colorClauses);
clausesCount++;
}
}
where.and(clausesCount);
if (clausesCount > 0) {
where.and(clausesCount);
} else {
where.eq("cardNumber", new SelectArg(0));
}
if (start != null) {
qb.offset(start);