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

OGM returns empty result if query results contains nodes and rels with same native id #952

Closed
nioertel opened this issue Jul 25, 2023 · 5 comments

Comments

@nioertel
Copy link
Contributor

Current Behavior

When using session.query(SomeRelationship.class, "MATCH ... RETURN ...", Map.of()), and the query returns rows which contain nodes and relationships which have the same native ids, OGM does not map them because GraphRowModelMapper passes an additionalNodeFilter which considers all relationships nodes if there is a node in the result with the same native id.
The problem actually only occurs if the node with the clashing native id was returned using pattern comprehension because only then the filter filters it out.

Your Environment

Tested with current state of 3.2.x branch. I have a unit test + fix candidate ready. PR will follow.

@nioertel
Copy link
Contributor Author

Just adding extract from official Neo4j docs:

The function id() returns a node or a relationship identifier, unique by an object type and a database. Therefore, it is perfectly allowable for id() to return the same value for both nodes and relationships in the same database.

nioertel added a commit to nioertel/neo4j-ogm that referenced this issue Jul 26, 2023
nioertel added a commit to nioertel/neo4j-ogm that referenced this issue Jul 26, 2023
nioertel added a commit to nioertel/neo4j-ogm that referenced this issue Jul 26, 2023
@nioertel
Copy link
Contributor Author

PR is ready and test is finally also green in the GH actions build. Please let me know when you can release a new OGM verison.

The fix will also have to be merged to the master (4.x).

@nioertel
Copy link
Contributor Author

Thanks @michael-simons for the super fast reaction. Already found the new release on Maven Central :).

@nioertel
Copy link
Contributor Author

#953 was merged

@michael-simons
Copy link
Collaborator

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

No branches or pull requests

2 participants