]> git.ktnx.net Git - mobile-ledger.git/commitdiff
additional transaction deletion methods
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:09:25 +0000 (00:09 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 21:09:25 +0000 (00:09 +0300)
app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java

index 882e73a5f1514b389c612d63b8249e4f354ef804..9c3f21f2b3540f880d7aba7f391dddec615a1da3 100644 (file)
@@ -56,6 +56,9 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
     @Delete
     public abstract void deleteSync(Transaction item);
 
+    @Delete
+    public abstract void deleteSync(Transaction... items);
+
     @Delete
     public abstract void deleteSync(List<Transaction> items);
 
@@ -144,6 +147,8 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
         Logger.debug("Transaction",
                 String.format(Locale.ROOT, "Purged %d transaction accounts", removed));
     }
+    @Query("DELETE FROM transactions WHERE profile_id = :profileId")
+    public abstract int deleteAllSync(long profileId);
     private void storeSync(TransactionWithAccounts rec) {
         TransactionAccountDAO trAccDao = DB.get()
                                            .getTransactionAccountDAO();