I have just started working with Room and although everything seems to be pretty intuitive I currently don't really understand how exactly I could handle relationships.
Because SQLite is a relational database, you can specify relationships between objects. Even though most ORM libraries allow entity objects to reference each other, Room explicitly forbids this. Even though you cannot use direct relationships, Room still allows you to define Foreign Key constraints between entities.(Source: https://developer.android.com/topic/libraries/architecture/room.html#no-object-references)
- How should you model a Many to Many or One to Many Relationship?
- What would this look like in practice (example DAOs + Entities)?
You can use
@Relationannotation to handle relations at Room.See document.
(Google's document has confusing examples. I have written the steps and some basic explanation at my another answer. You can check it out)