]> git.ktnx.net Git - mobile-ledger.git/commitdiff
annotate a data retrieval method with @Transaction as suggested
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 13 May 2021 04:57:12 +0000 (07:57 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 13 May 2021 04:57:12 +0000 (07:57 +0300)
app/src/main/java/net/ktnx/mobileledger/dao/AccountDAO.java

index 0cfed1b64c2e5ad4d13845197839069356a54c80..677fa81e0080631e9dcb730b32add5ca0056b7ab 100644 (file)
@@ -119,6 +119,7 @@ public abstract class AccountDAO extends BaseDAO<Account> {
     public abstract List<AccountNameContainer> 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<Account> {
            "               WHEN name_upper LIKE '%% '||:term||'%%' THEN 3 " +
            "               ELSE 9 END, name_upper, rowid ")
     public abstract List<AccountWithAmounts> 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 " +