Skip to content

ToMany is automatically sorted by Entity id #431

@zoltish

Description

@zoltish

Issue Basics

  • ObjectBox version (are using the latest version?): 1.4.4
  • Reproducibility: Always

Reproducing the bug

Description

I have an Entity ExerciseEntity that contains a ToMany of BodypartEntity.

When creating a new ExerciseEntity, bodyparts are specified as A,B,C. Their ordering is important.

After inserting the entity into the Box, later on it will contain the bodyparts with a completely different order (e.g. B,A,C). From what I can tell theyre always sorted by their id annotated value.

Code

ExerciseEntity has lateinit var bodyparts: ToMany<BodypartEntity>
When creating a new one its assigned as entity.bodyparts.addAll(bodyparts)

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