mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 13:02:06 -08:00
Repository objects refactoring
SQL query is limited by 1, so there will be two cases - whether collection is empty or not. We should user convenient shortcut for checking emptiness of collection
This commit is contained in:
parent
a5b2c9f8c0
commit
e22951c68e
2 changed files with 4 additions and 4 deletions
|
|
@ -115,7 +115,7 @@ public enum ExpansionRepository {
|
|||
QueryBuilder<ExpansionInfo, Object> qb = expansionDao.queryBuilder();
|
||||
qb.limit(1L).where().eq("code", new SelectArg(setCode));
|
||||
List<ExpansionInfo> expansions = expansionDao.query(qb.prepare());
|
||||
if (expansions.size() > 0) {
|
||||
if (!expansions.isEmpty()) {
|
||||
set = expansions.get(0);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
|
|
@ -129,7 +129,7 @@ public enum ExpansionRepository {
|
|||
QueryBuilder<ExpansionInfo, Object> qb = expansionDao.queryBuilder();
|
||||
qb.limit(1L).where().eq("name", new SelectArg(setName));
|
||||
List<ExpansionInfo> expansions = expansionDao.query(qb.prepare());
|
||||
if (expansions.size() > 0) {
|
||||
if (!expansions.isEmpty()) {
|
||||
set = expansions.get(0);
|
||||
}
|
||||
} catch (SQLException ex) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue