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

Paging with session.loadAll(User.class, filter, pagination) does not work correctly when filtering on relationship #384

Closed
frant-hartm opened this issue Jul 8, 2017 · 0 comments
Labels

Comments

@frant-hartm
Copy link
Contributor

Following query:

Filter filter = new Filter("stars", ComparisonOperator.EQUALS, 3);
filter.setNestedPropertyName("ratings");
filter.setNestedPropertyType(Rating.class);
filter.setNestedRelationshipEntity(true);
Collection<User> users = session.loadAll(User.class, filter, new Pagination(0, 1));

will do paging using n,r0, instead of just n:

MATCH (n:User) MATCH (n)-[r0:RATED]->(m0) WHERE r0.stars = { ratings_stars_0 } WITH n,r0 SKIP 0 LIMIT 1 MATCH p=(n)-[*0..1]-(m) RETURN p, ID(n) with params {ratings_stars_0=3}

if there are multiple matching relationships it may return incorrect number of results (less) because rows with n are repeated.

@frant-hartm frant-hartm added the bug label Jul 8, 2017
espiegelberg pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Aug 30, 2017
espiegelberg pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Aug 30, 2017
Replace "with n" for "with distinct n" when filtering on a relationship property.
espiegelberg pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Aug 30, 2017
Replace "n,r0" with "distinct n" when filtering on a relationship property.
frant-hartm added a commit to espiegelberg/neo4j-ogm that referenced this issue Sep 4, 2017
frant-hartm pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Sep 4, 2017
Replace "with n" for "with distinct n" when filtering on a relationship property.
frant-hartm added a commit to espiegelberg/neo4j-ogm that referenced this issue Sep 5, 2017
frant-hartm pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Sep 5, 2017
…erty

Replace "with n" for "with distinct n" when filtering on a relationship property.
Fixes neo4j#384
frant-hartm pushed a commit to espiegelberg/neo4j-ogm that referenced this issue Sep 5, 2017
…erty

Replace "n,r0" with "distinct n" when filtering on a relationship property.
Fixes neo4j#384
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant