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

import androidx.lifecycle.LiveData
import androidx.room.*

@Dao
interface DaoPedido {
8 9 10

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

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

    @Delete
    fun delete(pedido: PedidoSave)
17 18


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

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

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