Created
May 23, 2020 07:05
-
-
Save deepanshu42/1fed7a4f6ec1d7c4ee21b68175252030 to your computer and use it in GitHub Desktop.
Parameter passing in Room Dao Example
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 WHERE age BETWEEN :minAge AND :maxAge") | |
fun loadAllUsersBetweenAges(minAge: Int, maxAge: Int): Array<User> | |
@Query("SELECT * FROM users WHERE first_name LIKE :search " + | |
"OR last_name LIKE :search") | |
fun findUserWithName(search: String): List<User> | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment