From: Damyan Ivanov Date: Thu, 13 May 2021 04:57:12 +0000 (+0300) Subject: annotate a data retrieval method with @Transaction as suggested X-Git-Tag: v0.19.1~10 X-Git-Url: https://git.ktnx.net/?a=commitdiff_plain;h=05b38a3497aa098a5164d1ae85b13a6f08bf85a2;p=mobile-ledger.git annotate a data retrieval method with @Transaction as suggested --- 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 " +