I'm currently using SQLiteDatabase.replace
to update certain rows in my database. I'm migrating to a ContentProvider and I'm trying to replace these statements with an equivalent ContentProviderOperation
. There are factory methods for update, delete, and insert, but there's no newReplace
. I'm guessing that's because the documentation says that SQLiteDatabase.replace
is a convenience method which replaces the row only if the primary key matches, else it adds a new one. However, I don't understand what's actually going on under the hood. I assume if I just did a delete
then insert
it would be less efficient than a replace
, is that correct?
How do I mimic the functionality of SQLiteDatabase.replace
using ContentProviderOperation
?