Skip to content

[1.2.0] [Kotlin] Having TWO ToOne<> relations in one Entity Class. - cannot read back second one. #244

@KishoreBabuIN

Description

@KishoreBabuIN

Issue Basics

  • ObjectBox version (are using the latest version?): 1.2.0
  • Reproducibility: always

Reproducing the bug

Description

If I have an entity with 2 ToOne<> relation fields, one of these fields is not retrieved while reading from boxstore.

@Entity
data class EntityWord(
        @Id var id: Long = 0,
        var wordId: Int? = 0,
        var annotationDetails: ToOne<EntityAnnotation>? = null,
        var lineNo: Int? = 0,
        var wordNo: Int? = 0,
        var audioStart: String? = null,
        var audioEnd: String? = null,
        var mistakes: ToOne<EntityMistakes>? = null
)

EntityAnnotiation is an entity with primitive fields.
EntityMistakes is further an Entity with 3 ToMany<> relations.

In this entity, I can retrieve annotationDetails but never mistakes.

I commented annotationDetails just to check, and THEN I can retrieve mistakes.

I've used the ObjectBox viewer to verify that the mistakes data does in fact exist in the boxstore.

I cant for the life of me figure out what am i missing in this. Surely, an Entity should be able to support more than ONE ToOne<> relations.

Metadata

Metadata

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