question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Order ToMany objects

See original GitHub issue

i think just like greendao for toMany relation need @OrderBy annotation example :

@Entity
public class Customer {
    @Id private Long id;

    @Backlink(to = "customerId")
    @OrderBy("date ASC")
    private ToMany<Order> orders;
}

Issue Analytics

  • State:open
  • Created 6 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
DJafaricommented, Oct 7, 2017

@greenrobot i found OrderBy annotation in source code, sorting is implement or not yet ?

1reaction
greenrobot-teamcommented, Sep 26, 2017

Since 1.0.1 there is an experimental feature to set a comparator on the ToMany that orders its items:

orders.setComparator(new Comparator<Order>() {
    @Override
    public int compare(Order left, Order right) {
        // TODO
    }
});

Let us know what you think.

edit: Note that support for SQL like order statements (like date ASC) is unlikely, as ObjectBox is not a SQL-based database. It is based on objects. -ut

Read more comments on GitHub >

github_iconTop Results From Across the Web

Too Many Objects (TMO) Episodes: 1-11 - YouTube
Too Many Objects (TMO) Episodes: 1-11. Watch later. Share. Copy link. Info. Shopping. Tap to unmute. If playback doesn't begin shortly, ...
Read more >
django order by count of many to many object - Stack Overflow
Annotate Category objects with the number of questions and then order by this number in descend order: from django.db.models import Count ...
Read more >
Ordering To-Many Associations - ORM - Doctrine
Ordering To-Many Associations · @OrderBy acts as an implicit ORDER BY clause for the given fields, that is appended to all the explicitly...
Read more >
ToMany (ObjectBox Java 3.1.3 API)
Object. io.objectbox.relation.ToMany<TARGET> ... public class ToMany<TARGET> extends java.lang.Object ... Set an comparator to define the order of entities.
Read more >
Many-to-many relationships - Django documentation
To define a many-to-many relationship, use ManyToManyField . In this example, an Article can be published in multiple Publication objects, and a Publication ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found