* Council of the Absolute - Fixed IllegalStateException (fixes #297) .

This commit is contained in:
LevelX2 2013-07-25 18:53:58 +02:00
parent 271e4b61ba
commit 655dcea56d

View file

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