Skip to content

Transient Annotation on LinkingObjects returns null #5064

@NitroG42

Description

@NitroG42

I just discovered what I think is an issue, here is a default model:

@RealmClass
open class World(@PrimaryKey var id: String = "",
    var trees: RealmList<Tree> = RealmList()) : RealmModel

@RealmClass
open class Tree(@PrimaryKey var id: String = "") : RealmModel {
    @LinkingObjects("trees")
    @Transient
    val worlds: RealmResults<World>? = null
}

I'm using transient on the field worlds because I don't want it to be serialized by gson (nor deserialized).
Unfortunatelly, by doing so the linkingObjects doesn't work anymore (it returns null).

Do you think is a fixable bug or do you know a workaround ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions