Dao.kt 786 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
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>

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

    @Delete
    fun delete(pedido: PedidoSave)
}
Yannine Alvarez committed
18 19 20 21 22 23 24 25 26
/*
* @Dao
interface studentDao{
    @Query("SELECT * FROM studentTbl")
    fun allStudents():List<Student>

    @Insert(onConflict = OnConflictStrategy.REPLACE)
    fun insert(student:Student)
}*/
27 28 29 30

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