Queries and Relationships
Query data and relate entities.
Beyond a Single Table
Real apps have related data: a user has many posts, an order has many items. Room models these with foreign keys and the @Relation annotation.
Parameterized Queries
Pass arguments into a @Query with a colon prefix.
@Query("SELECT * FROM users WHERE name LIKE :search")
suspend fun search(search: String): List<User>All lessons in this course
- Entities and DAOs
- The Room Database Class
- Queries and Relationships
- Observing Data with Flow