I\'m have a method annotated with @Transaction in my DAO class, which is causing the following error:
A DAO method can be annotated with only one of the f
According to the transaction documentation
Marks a method in an abstract Dao class as a transaction method.
Change your class to:
@Dao abstract class Dao {
@Insert(onConflict = REPLACE) abstract fun insertList(chacaras: List)
@Query("SELECT * FROM chacara WHERE cityId = :cityId")
abstract fun getListOfCity(cityId: String): LiveData>
@Delete abstract fun deleteList(chacaraList: List)
@Transaction
open fun updateList(list: List){
deleteList(list)
insertList(list)
}
}