如何获得房间数据库中数据成功更新的结果。
我的查询示例:
@Query("UPDATE Cohort SET isSelectedCTypeCoh = 'false'")
fun clearAllSelectedHoldingTypeDB()
答案 0 :(得分:1)
您可以修改更新函数,以返回一个int值,该值指示数据库中已更新的行数。
科特琳:
try {
//your code that is throwing this error
}catch (Exception e){
//handle the exception thrown
}
Java:
@Update
fun updateUser(user: User):Int