package safeluck.drive.evaluation.DB;
|
|
import androidx.lifecycle.LiveData;
|
import androidx.room.Dao;
|
import androidx.room.Delete;
|
import androidx.room.Insert;
|
import androidx.room.OnConflictStrategy;
|
import androidx.room.Query;
|
|
import java.util.List;
|
|
/**
|
* MyApplication2
|
* Created by lzw on 2019/11/25. 10:51:02
|
* 邮箱:632393724@qq.com
|
* All Rights Saved! Chongqing AnYun Tech co. LTD
|
*/
|
@Dao
|
public interface StudentDao {
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
void insert(Student student);
|
|
|
@Query("SELECT * from student_table")
|
LiveData<List<Student>> getAllStudents();
|
|
@Delete
|
void deleteStu(Student student);
|
|
@Insert(onConflict = OnConflictStrategy.REPLACE)
|
void insertAll(List<Student> students);
|
|
@Query("update student_table set begin_time =:beginTime where stu_id=1001")
|
void updateBeginTime(long beginTime);
|
}
|