Fixed bug of Council of the Absolute allowing to select all card nymes instead the correct not land and not creature names.

This commit is contained in:
LevelX2 2013-05-15 00:46:38 +02:00
parent 514a57904f
commit 579951ee36

View file

@ -32,6 +32,7 @@ import com.j256.ormlite.dao.DaoManager;
import com.j256.ormlite.jdbc.JdbcConnectionSource;
import com.j256.ormlite.stmt.QueryBuilder;
import com.j256.ormlite.stmt.SelectArg;
import com.j256.ormlite.stmt.Where;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;
import java.io.File;
@ -170,7 +171,8 @@ public enum CardRepository {
try {
QueryBuilder<CardInfo, Object> qb = cardDao.queryBuilder();
qb.distinct().selectColumns("name");
qb.where().not().in("types", CardType.LAND.name(), CardType.CREATURE.name());
Where where = qb.where();
where.and(where.not().like("types", '%' + CardType.CREATURE.name() +'%'),where.not().like("types", '%' + CardType.LAND.name() + '%'));
List<CardInfo> results = cardDao.query(qb.prepare());
for (CardInfo card : results) {
names.add(card.getName());