]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java
fix looking up old transactions with non-ASCII names (broken in 0.18.0)
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / dao / TransactionDAO.java
index 12a27e14f36173c644e0534013fa8e302f6e4fd2..d7e8e16f3a55a14ad22b9a8b22bd20530c515c54 100644 (file)
@@ -79,11 +79,11 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
     @Query("SELECT * FROM transactions WHERE id = :transactionId")
     public abstract TransactionWithAccounts getByIdWithAccountsSync(long transactionId);
 
-    @Query("SELECT DISTINCT description, CASE WHEN description LIKE :term||'%%' THEN 1 " +
-           "               WHEN description LIKE '%%:'||:term||'%%' THEN 2 " +
-           "               WHEN description LIKE '%% '||:term||'%%' THEN 3 " +
+    @Query("SELECT DISTINCT description, CASE WHEN description_uc LIKE :term||'%%' THEN 1 " +
+           "               WHEN description_uc LIKE '%%:'||:term||'%%' THEN 2 " +
+           "               WHEN description_uc LIKE '%% '||:term||'%%' THEN 3 " +
            "               ELSE 9 END AS ordering FROM transactions " +
-           "WHERE description LIKE '%%'||:term||'%%' ORDER BY ordering, description, rowid ")
+           "WHERE description_uc LIKE '%%'||:term||'%%' ORDER BY ordering, description_uc, rowid ")
     public abstract List<DescriptionContainer> lookupDescriptionSync(@NonNull String term);
 
     @androidx.room.Transaction