Dao.kt 570 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
package com.example.ayudapy

import androidx.lifecycle.LiveData
import androidx.room.*
import androidx.room.OnConflictStrategy.REPLACE

@Dao
interface DaoPedido {
    @Query("SELECT * from pedido_save")
    fun getAll(): List<PedidoSave>

    @Insert(onConflict = REPLACE)
    fun insert(pedido: PedidoSave)

    @Delete
    fun delete(pedido: PedidoSave)
}

   /* @Query("UPDATE pedido_save SET name =:studentName, nim =:studentNim, gender =:studentGen WHERE id =:studentId")
    fun update(studentId: Long, studentName:String, studentNim:String, studentGen:String)*/