From 05b38a3497aa098a5164d1ae85b13a6f08bf85a2 Mon Sep 17 00:00:00 2001 From: Damyan Ivanov Date: Thu, 13 May 2021 07:57:12 +0300 Subject: [PATCH] annotate a data retrieval method with @Transaction as suggested --- app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java b/app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java index 0cfed1b6..677fa81e 100644 --- a/app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java +++ b/app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java @@ -119,6 +119,7 @@ public abstract class AccountDAO extends BaseDAO { public abstract List lookupNamesInProfileByNameSync(long profileId, @NonNull String term); + @Transaction @Query("SELECT * FROM accounts " + "WHERE profile_id=:profileId AND name_upper LIKE '%%'||:term||'%%' " + "ORDER BY CASE WHEN name_upper LIKE :term||'%%' THEN 1 " + @@ -126,8 +127,7 @@ public abstract class AccountDAO extends BaseDAO { " WHEN name_upper LIKE '%% '||:term||'%%' THEN 3 " + " ELSE 9 END, name_upper, rowid ") public abstract List lookupWithAmountsInProfileByNameSync(long profileId, - @NonNull - String term); + @NonNull String term); @Query("SELECT DISTINCT name, CASE WHEN name_upper LIKE :term||'%%' THEN 1 " + " WHEN name_upper LIKE '%%:'||:term||'%%' THEN 2 " + -- 2.39.5