Custom class types permitted?


I recently tried something like this:

open class Prize : RealmObject() {
    var prizeId: String = "" 
    var description : String = ""
    var cashValue : Float = 0.0f
    var raffleDateAndTime: Date = Date()

In another RealmObject I tried to use prize. Like this…

open class Event : RealmObject() {
    var eventId: String = "" //Needs to be unique given it's a primary key
    var location: String = ""
    var description : String = ""
    var eventStart: Date = Date()
    var eventEnd: Date = Date()
    var prizes : List<Prize> = mutableListOf<Prize>()

When I go to run it, I get “these types will not undergo annotation processing”

Is there a way to get Realm to understand custom build classes like Prize?


Here is the solution…use RealmList


var prizes : List = mutableListOf()


var prizes : RealmList = RealmList()