https://kotlinlang.org logo
#android
Title
# android
a

amrita

12/04/2023, 7:03 PM
Hello everyone, I am new to programming. Can someone help me? I have similar class. What am I doing wrong here?
Copy code
open class A(
    open val classId: String,
        @Relation(
        parentColumn = "classId",
        entityColumn = "classId"
    )
    open val student: StudentEntity?,
)

class B(
    override val classId: String,
    val reasonForPending: String?,
        @Relation(
        parentColumn = "classId",
        entityColumn = "classId"
    )
    val notes: List<NoteEntity>?,
    override val student: StudentEntity?
) : A(
    classId,
    student,
)

class C(
    override val classId: String,
    val courseName: String,
    val dueToday: Boolean,
    @Relation(
    parentColumn = "courseName",
    entityColumn = "courseName"
    )
    val course: CourseEntity?,
    override val student: StudentEntity?
) : A(
    classId,
    student,
)
I have separate table for class B and class C. There are a lot of common data between class B and C. Why is not able to retrieve the student entity data? What am I doing wrong here? even though I have student entity data and the column names matches, it is not returning anything..
3 Views