ToMany is automatically sorted by Entity id
See original GitHub issueIssue 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)
Issue Analytics
- State:
- Created 5 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Automatically set related entity id in one to many relationship ...
I have a many to one related entities and everytime I create a new comment which is related to Project, I want to...
Read more >Ordering vs Sorting with Hibernate - What should you use?
When use sorting, Hibernate will load the associated Book entities from the ... AUTO). @Column (name = "id" , updatable = false ,...
Read more >Many-to-one / one-to-many relations - typeorm - GitBook
Where you set @ManyToOne - its related entity will have "relation id" and foreign key. This example will produce following tables:.
Read more >Collections | MikroORM
This will give us the entity instances managed by the identity map. ... Since v3 many to many collections does not require having...
Read more >XML Mapping - Doctrine Object Relational Mapper (ORM)
In order to tell the XmlDriver where to look for your mapping documents, supply an ... is only used for primitive types that...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
PS.: There’s also an experimental
setComparator(c)
method inToMany
class, which you could set before the list is loaded.Closing this then.
Edit: this is also a duplicate of #243 and #154. -ut