Dao.kt 797 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 18
    fun insert(pedido: PedidoSave)

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

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

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