Dao.kt 799 Bytes
Newer Older
1 2 3 4 5 6 7 8
package com.example.ayudapy

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

@Dao
interface DaoPedido {
9 10 11

    @Query("SELECT * FROM pedido_save")
    fun getAll(): LiveData<List<PedidoSave>>
12

Yannine Alvarez committed
13
    @Insert(onConflict = OnConflictStrategy.REPLACE)
14 15 16 17
    fun insert(pedido: PedidoSave)

    @Delete
    fun delete(pedido: PedidoSave)
18 19


20
}
Yannine Alvarez committed
21 22 23 24 25 26 27 28 29
/*
* @Dao
interface studentDao{
    @Query("SELECT * FROM studentTbl")
    fun allStudents():List<Student>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(student:Student)
}*/
30 31 32 33

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