Created
July 4, 2020 22:25
-
-
Save Ahmedgadein/fd5a768e2efd5feb9568b9d1abd49ff4 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| @Dao | |
| interface UserDao{ | |
| @Query("SELECT * FROM users_table") | |
| fun getAll():List<User> | |
| @Query("SELECT * FROM users_table WHERE Id = :Id") | |
| fun getUser(Id:Long): User | |
| @Insert(onConflict = OnConflictStrategy.REPLACE) | |
| fun insert(user: User) | |
| @Delete() | |
| fun delete(user: User) | |
| @Update | |
| fun update(user: User) | |
| @Query("DELETE FROM users_table") | |
| fun deleteAll() | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment