Last active
July 16, 2019 12:31
-
-
Save ankitdubey021/cbe133968a48be9b8c09188e97f057c6 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package dao; | |
import java.util.List; | |
import androidx.room.Dao; | |
import androidx.room.Delete; | |
import androidx.room.Insert; | |
import androidx.room.OnConflictStrategy; | |
import androidx.room.Query; | |
import androidx.room.Update; | |
@Dao | |
public interface StudentDAO{ | |
@Query("SELECT * FROM student_master ORDER BY name") | |
List<Student> getAllStudents(); | |
@Insert | |
void insertStudent(Student student); | |
@Update(onConflict = OnConflictStrategy.REPLACE) | |
void updateStudent(Student student); | |
@Delete | |
void deleteStudent(Student st); | |
@Query("SELECT * FROM student_master WHERE sno= :id") | |
Student getStudentById(int id); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment