I have 2 Entities, Grade
and Student
, Student
is having a foreign key towards the class room. Embedded entity ClassRoom
looks like this,
data class ClassRoom(
@Embedded
val level: ClassLevel
@Relation(
parentColumn = "id",
entityColumn = "ClassLevel"
)
val students: List<Student>,
// val strength: Int ?
)
What I am trying to achieve is, using ClassRoomInstance.strength
to get the count of incoming foreign keys. Than calculating the sizes of students with students.size
What is the way to achieve this?
Thanks