Reputation: 1838
How can I get a result of when my data has been updated successfully in my Room database.
My Query Sample:
@Query("UPDATE Cohort SET isSelectedCTypeCoh = 'false'")
fun clearAllSelectedHoldingTypeDB()
Upvotes: 1
Views: 765
Reputation: 4508
You can modify your update function to return an int indicating the number of rows updated in the database.
Kotlin:
@Update
fun updateUser(user: User):Int
Java:
@Update
public int updateUser(User user);
Upvotes: 2