Fixed
Status Update
Comments
cy...@gmail.com <cy...@gmail.com> #2
Note that having the same option for @Update & @Delete would be probably more accurate. In other word, the idea is really to have an equivalent of applyBatch already available in ContentProvider
yb...@google.com <yb...@google.com> #3
to be clear, you can still run transactions but it makes sense for us to add support for multiple types in these queries.
MyDatabase db = ...; // RoomDatabase instance
db.beginTransaction() ;
try {
db.dao1.insert(foo);
db.dao1.delete(bar);
db.dao2.update(baz);
db.setTransactionSuccessfull();
} finally {
db.endTransaction();
}
MyDatabase db = ...; // RoomDatabase instance
db.beginTransaction() ;
try {
db.dao1.insert(foo);
db.dao1.delete(bar);
db.dao2.update(baz);
db.setTransactionSuccessfull();
} finally {
db.endTransaction();
}
yb...@google.com <yb...@google.com> #4
the only limitation would be, for @Insert queries, we would not allow them to return the inserted row ids.
Description
Version used: 1.0.0-alpha3
Currently it looks like Room doesn't offer "applyBatch"-style insert. In particular, it is not possible to insert several object (of different types) at once in the database in the same transaction. Doing so in the same transaction would be safer and would ideally would generate a single invalidation rather than N for N types