From 178110fe9e95cff2c1eb91b257f3caf5e0017d5b Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 23 Apr 2021 00:08:20 +0300 Subject: [PATCH] rename method to better reflect what it does --- .../main/java/net/ktnx/mobileledger/dao/TransactionDAO.java | 5 ++--- app/src/main/java/net/ktnx/mobileledger/db/Profile.java | 2 +- 2 files changed, 3 insertions(+), 4 deletions(-) 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(); -- 2.39.5