How to observe livedata of nested relation pojo android room
The schema of my Database has 4 tables Server, Sites, Groups and Messages. Every Server has many Sites and every Site has many Groups.
There is a POJO called GroupItem that holds the Group and the unreadMessages of the Group.
data class GroupItem(
@Embedded
val group: Group,
@ColumnInfo(name = "unreadCounter")
val unreadCounter: Int
)
The unReadCounter field can be found only with a join with the Messages table.
I also have a POJO that holds a Site with its GroupItems...