I have my DAO set up as follows:
public interface AllocationDao {
@Query("SELECT * from allocation")
LiveData<List<Allocation>> getAllocations();
@Query("SELECT * from allocation where id = :id")
Allocation getAllocationForId(int id);
@Query("SELECT * from lineitem where allocation_id = :id")
List<LineItem> getLineItemsForId(int id);
@Insert
void insertAll(Allocation... allocations);
@Insert
void insertAll(LineItem... lineItems);
}
Is it possible to trigger the observer for getAllocations()
when I do an insertAll(LineItem... lineItems)
? What is happening now is when I do an insert to LineItem, I need the Allocation query to run, but since the query is unmodified, it's not running.