]> git.ktnx.net Git - mobile-ledger.git/commitdiff
rename method to better reflect what it does
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:08:20 +0000 (00:08 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:08:20 +0000 (00:08 +0300)
app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java
app/src/main/java/net/ktnx/mobileledger/db/Profile.java

index 29fe1c66fcbe1888165ec6aba80f89c607cef0ef..882e73a5f1514b389c612d63b8249e4f354ef804 100644 (file)
@@ -92,9 +92,8 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
     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<Transaction> allForProfileSync(long profileId);
+    @Query("SELECT * from transactions WHERE profile_id = :profileId")
+    public abstract List<Transaction> getAllForProfileUnorderedSync(long profileId);
 
     @Query("SELECT generation FROM transactions WHERE profile_id = :profileId LIMIT 1")
     protected abstract TransactionGenerationContainer getGenerationPOJOSync(long profileId);
index 4753f311c4d4baf2af3376414a8ac97a5b03cf72..56155cc6480c19bd6635a6785dff6029036b25e9 100644 (file)
@@ -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();