mirror of
https://github.com/magefree/mage.git
synced 2025-12-26 21:42:07 -08:00
* Card editor - Done some code cleanup, done some speed up for card loading time.
This commit is contained in:
parent
0caa1d568f
commit
893a3acb65
8 changed files with 277 additions and 173 deletions
|
|
@ -204,12 +204,15 @@ public class CardCriteria {
|
|||
clausesCount++;
|
||||
}
|
||||
|
||||
for (CardType type : types) {
|
||||
where.like("types", new SelectArg('%' + type.name() + '%'));
|
||||
}
|
||||
if (!types.isEmpty()) {
|
||||
where.or(types.size());
|
||||
clausesCount++;
|
||||
|
||||
if (types.size() != 7) { //if all types selected - no selection needed
|
||||
for (CardType type : types) {
|
||||
where.like("types", new SelectArg('%' + type.name() + '%'));
|
||||
}
|
||||
if (!types.isEmpty()) {
|
||||
where.or(types.size());
|
||||
clausesCount++;
|
||||
}
|
||||
}
|
||||
|
||||
for (CardType type : notTypes) {
|
||||
|
|
@ -277,6 +280,6 @@ public class CardCriteria {
|
|||
qb.limit(count);
|
||||
}
|
||||
|
||||
qb.orderBy("cardNumber", true);
|
||||
// qb.orderBy("cardNumber", true);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@ import java.util.Set;
|
|||
import java.util.TreeSet;
|
||||
import java.util.concurrent.Callable;
|
||||
import mage.constants.CardType;
|
||||
import org.apache.log4j.Logger;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -265,7 +266,7 @@ public enum CardRepository {
|
|||
try {
|
||||
QueryBuilder<CardInfo, Object> queryBuilder = cardDao.queryBuilder();
|
||||
criteria.buildQuery(queryBuilder);
|
||||
|
||||
|
||||
return cardDao.query(queryBuilder.prepare());
|
||||
} catch (SQLException ex) {
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue