From: Damyan Ivanov Date: Thu, 22 Apr 2021 21:09:25 +0000 (+0300) Subject: additional transaction deletion methods X-Git-Tag: v0.18.0~47 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=f2a76bb5342416143b39d58f9c90909307767a99;p=mobile-ledger.git additional transaction deletion methods --- 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();