Created
October 22, 2017 10:19
-
-
Save AkshayChordiya/a483b26b8c0cb6dd657d416f7ab45459 to your computer and use it in GitHub Desktop.
User DAO - Room
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
@Dao | |
interface UserDao { | |
@Insert | |
fun insertAll(users: List<User>) | |
@Update | |
fun update(user: User) | |
@Delete | |
fun delete(user: User) | |
@Query("SELECT * FROM users") | |
fun getUsers(): List<User> | |
@Query("SELECT * FROM users WHERE name LIKE :name LIMIT 1") | |
fun getUserByName(name: String): User | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment