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); where.and(5);
colorClauses++; colorClauses++;
} }
if (colorClauses > 0) {
where.or(colorClauses); where.or(colorClauses);
clausesCount++; clausesCount++;
} }
}
if (clausesCount > 0) {
where.and(clausesCount); where.and(clausesCount);
} else {
where.eq("cardNumber", new SelectArg(0));
}
if (start != null) { if (start != null) {
qb.offset(start); qb.offset(start);