Skip to content

Instantly share code, notes, and snippets.

@vprabhu
Created May 18, 2018 07:42
Show Gist options
  • Save vprabhu/04acbc4675b17f5d556ed7dae3d3c8d6 to your computer and use it in GitHub Desktop.
Save vprabhu/04acbc4675b17f5d556ed7dae3d3c8d6 to your computer and use it in GitHub Desktop.
@Dao
interface TodoTaskDao {
@Query("select * from todotasks order by id")
fun getallTasks(): List<TodoTask>
@Insert
fun insertTodoTask(todoTask: TodoTask)
@Update(onConflict = OnConflictStrategy.REPLACE)
fun updateTodoTask(todoTask: TodoTask)
@Delete
fun deleteTodoTask()
@Query("Select * from todotasks where id = :id")
fun getTaskbyId(id: Int): List<TodoTask>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment