package zone.yue.jvtc.android.exp12

import androidx.room.Dao
import androidx.room.Delete
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update

@Dao
interface ContactDao {
    @Insert
    fun insert(entity: ContactEntity)

    @Delete
    fun delete(entity: ContactEntity): Int

    @Query("delete from contact where name = :name")
    fun deleteByName(name: String): Int

    @Update
    fun update(entity: ContactEntity): Int

    @Query("select * from contact;")
    fun queryAll(): List<ContactEntity>
}