From f2a76bb5342416143b39d58f9c90909307767a99 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Fri, 23 Apr 2021 00:09:25 +0300 Subject: [PATCH] additional transaction deletion methods --- .../main/java/net/ktnx/mobileledger/dao/TransactionDAO.java | 5 +++++ 1 file changed, 5 insertions(+) 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 882e73a5..9c3f21f2 100644 --- a/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java +++ b/app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java @@ -56,6 +56,9 @@ public abstract class TransactionDAO extends BaseDAO { @Delete public abstract void deleteSync(Transaction item); + @Delete + public abstract void deleteSync(Transaction... items); + @Delete public abstract void deleteSync(List items); @@ -144,6 +147,8 @@ public abstract class TransactionDAO extends BaseDAO { 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(); -- 2.39.5