How can I do a room transaction across 2 different DAOs usin rxjava?
I have this code that I would like to use with Rxjava but I need it to return some kind of observable
@Transaction
fun insertStoreWithPictures(store: Store, pictures: List<StorePicture>) {
insertStore(store)
insertPictures(pictures)
}
The store DAO
@Dao
abstract public class store {
@Insert
Single<Long> insert(store entity);
}
The storePicture DAO
@Dao
abstract public class storePicture {
@Insert
Completable insert(storePicture... entity);
}