Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

loadAll(Collection<T> objects, int depth); does not maintain input collection's sequence #196

Closed
jonathanhandoyo opened this issue Jul 18, 2016 · 4 comments

Comments

@jonathanhandoyo
Copy link

when calling <T> Collection<T> loadAll(Collection<T> objects, int depth);, given a collection input, the resulted collection does not maintain the original sequence.

@jonathanhandoyo jonathanhandoyo changed the title <T> Collection<T> loadAll(Collection<T> objects, int depth); does not maintain input collection's sequence loadAll(Collection<T> objects, int depth); does not maintain input collection's sequence Jul 18, 2016
@mangrish
Copy link
Contributor

mangrish commented Aug 2, 2016

Hi Jonation,

List order is arbitrary unless you do a query which specifies order. If you try doing a simple query in Neo4j itself you will not necessarily get a list back in a repeatable order.

You can get around this by doing a custom query and specifying an order by clause. This way you should always get the list back the way you want.

Let me know how you get on.

@luanne
Copy link
Contributor

luanne commented Aug 2, 2016

@mangrish this applies when a collection of objects is supplied. If the collection preserves ordering, the OGM can do so too. But all bets are off if the collection supplied does not preserve insert order.

@jonathanhandoyo
Copy link
Author

Hi Mark,

Luanne said it. Basically in my case: I did a query returning whatever is
bare minimum (definitely without adjacent nodes projected). This query was
paged and sorted. While continuing with the logic I wanted to re-hydrate
the objects (depth = 1). I tried to pass the previous (sorted) result to
OGM for re-hydration, But the resulted (and hydrated) collection no longer
maintains the ordering.

Jonathan.

On Wed, Aug 3, 2016 at 3:03 AM, Luanne Misquitta notifications@github.com
wrote:

@mangrish https://github.com/mangrish this applies when a collection of
objects is supplied. If the collection preserves ordering, the OGM can do
so too. But all bets are off if the collection supplied does not preserve
insert order.


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#196 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AEOm5gdIr630ngx9FELNjIWPbKkVll1zks5qb5RsgaJpZM4JOrw8
.

@hoestreich
Copy link

Hey there,
any chance, this feature will be implemented in the near future?
Would be quite helpful!
Thanks in advance,
Hendrik

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants