Ernestas
12/06/2021, 12:01 PMrudolf.hladik
12/06/2021, 12:45 PMhfhbd
12/06/2021, 12:49 PMjoin
for exampleErnestas
12/06/2021, 12:50 PMviews
seem exactly what I need. Thank you!kpgalligan
12/06/2021, 5:07 PMOrder
and OrderItems
have a container data class OrderData(val order:Order, val items:List<OrderItem>)
. That involves 2 queries internally, and you need to handle it yourself, but it's not super difficult. I haven't been using Room much since 2018 or so, but prior to that, all Android ORM's were relatively unsophisticated when compared with something like Hibernate. The latter was smart enough to inflate a single join into table-specific POJOs in the right circumstances at least. All Android ORMs with referenced collections would trigger a second query to grab them, and if you weren't careful, do so in the main thread. Some would do so eager, and could be a real problem. Yada yada, I could spend hours on that. In any case, it's more explicit in sqldelight, but views or queries will create flattened data classes from table joins.