Created
May 23, 2020 07:06
-
-
Save deepanshu42/0014165b06109b0ebc5c153528af7e13 to your computer and use it in GitHub Desktop.
Returning subsets of an Entity in Room Dao
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
| data class NameTuple( | |
| @ColumnInfo(name = "first_name") val firstName: String?, | |
| @ColumnInfo(name = "last_name") val lastName: String? | |
| ) | |
| @Dao | |
| interface UserDao { | |
| @Query("SELECT first_name, last_name FROM users") | |
| fun loadFullName(): List<NameTuple> | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment