I'm trying to work with Room database & LiveData.
I have ViewModels which holds LiveData they got from dao.
If I update a Transaction
, then LiveData<List<Transaction>>
is observed ok, but LiveData<Transaction>
is not observed at all. How is that possible? What am i doing wrong?
public abstract class Dao {
@Query("SELECT * FROM transact WHERE deleted = :value")
public abstract LiveData<List<Transaction>> allTransactions(boolean value);
@Query("SELECT * FROM transact WHERE guid = :guid AND deleted = :value ")
public abstract LiveData<Transaction> getTransaction(String guid, boolean value);
@Update(onConflict = OnConflictStrategy.REPLACE)
protected abstract void updateTransaction(Transaction transaction);
}
There is similar issue, which mentions Dagger complications when non @Singleton
annotated class was used, that's unfortunately not my problem, even if i use Dagger.