]> git.ktnx.net Git - mobile-ledger.git/commitdiff
selects from joined tables need explicit column list :(
authorDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 20:44:28 +0000 (23:44 +0300)
committerDamyan Ivanov <dam+mobileledger@ktnx.net>
Thu, 22 Apr 2021 20:44:28 +0000 (23:44 +0300)
app/src/main/java/net/ktnx/mobileledger/dao/TransactionDAO.java

index 7d91728fe59ebbbd71e4e4651e475e0a870421d1..29fe1c66fcbe1888165ec6aba80f89c607cef0ef 100644 (file)
@@ -84,10 +84,11 @@ public abstract class TransactionDAO extends BaseDAO<Transaction> {
     public abstract TransactionWithAccounts getFirstByDescriptionSync(@NonNull String description);
 
     @androidx.room.Transaction
-    @Query("SELECT * from transactions tr JOIN transaction_accounts t_a ON t_a.transaction_id = " +
-           "tr.id WHERE tr.description = :description AND t_a.account_name LIKE " +
-           "'%'||:accountTerm||'%' ORDER BY year desc, month desc, day desc, tr.ledger_id desc " +
-           "LIMIT 1")
+    @Query("SELECT tr.id, tr.profile_id, tr.ledger_id, tr.description, tr.data_hash, tr.comment, " +
+           "tr.year, tr.month, tr.day, tr.generation from transactions tr JOIN " +
+           "transaction_accounts t_a ON t_a.transaction_id = tr.id WHERE tr.description = " +
+           ":description AND t_a.account_name LIKE '%'||:accountTerm||'%' ORDER BY year desc, " +
+           "month desc, day desc, tr.ledger_id desc LIMIT 1")
     public abstract TransactionWithAccounts getFirstByDescriptionHavingAccountSync(
             @NonNull String description, @NonNull String accountTerm);