From: Damyan Ivanov Date: Thu, 22 Apr 2021 21:08:20 +0000 (+0300) Subject: rename method to better reflect what it does X-Git-Tag: v0.18.0~49 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=178110fe9e95cff2c1eb91b257f3caf5e0017d5b;p=mobile-ledger.git rename method to better reflect what it does --- diff --git a/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java b/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java index 29fe1c66..882e73a5 100644 --- a/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java +++ b/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java @@ -92,9 +92,8 @@ public abstract class TransactionDAO extends BaseDAO { public abstract TransactionWithAccounts getFirstByDescriptionHavingAccountSync( @NonNull String description, @NonNull String accountTerm); - @Query("SELECT * from transactions WHERE profile_id = :profileId ORDER BY " + - "year desc, month desc, day desc, ledger_id desc") - public abstract List allForProfileSync(long profileId); + @Query("SELECT * from transactions WHERE profile_id = :profileId") + public abstract List getAllForProfileUnorderedSync(long profileId); @Query("SELECT generation FROM transactions WHERE profile_id = :profileId LIMIT 1") protected abstract TransactionGenerationContainer getGenerationPOJOSync(long profileId); diff --git a/app/src/main/java/net/ktnx/mobileledger/db/Profile.java b/app/src/main/java/net/ktnx/mobileledger/db/Profile.java index 4753f311..56155cc6 100644 --- a/app/src/main/java/net/ktnx/mobileledger/db/Profile.java +++ b/app/src/main/java/net/ktnx/mobileledger/db/Profile.java @@ -229,7 +229,7 @@ public class Profile { TransactionDAO trnDao = DB.get() .getTransactionDAO(); - trnDao.deleteSync(trnDao.allForProfileSync(id)); + trnDao.deleteSync(trnDao.getAllForProfileUnorderedSync(id)); DescriptionHistoryDAO descDao = DB.get() .getDescriptionHistoryDAO();