I want to delete a row (object) from my SQLite db
if the attribute lessonId
match with one of the object in my db
.
I'm using Room
.
I don't know which Query I should put.
NotificationDao:
@Dao
interface NotificationDao {
@Query("SELECT * FROM notifications")
fun getNotifications(): Single<List<Notification>>
@Insert(onConflict = OnConflictStrategy.REPLACE)
fun updateNotification(notification: Notification): Completable
@Query("DELETE")
fun clearNotification(notification: Notification): Completable
}
Notification class:
@Entity(tableName = "notifications")
data class Notification(
@PrimaryKey
var lessonId: String = "",
var count: Int = 0)