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.

First level relationship object is not getting converted with OGM returns null.

See original GitHub issue

Retrieval of the relationship working fine from the chyper query. But the same does not return the object model from the ogm, gives always null. Both http driver and bolt drive are not working. Same code use to work with older versions.

MATCH result = (a)-[r:`HAS_CONNECTION`]-(b) 
  where a.clidUuid = 'ac50203e-4089-40af-9ee1-eb1387801172' 
     and b.clidUuid = '0e7ed0c8-fe75-43d5-b4a4-0b4c09a81b79'
  RETURN result

no logs after this

14:10:10.758 [http-nio-8088-exec-1] INFO  o.n.o.d.http.request.HttpRequest - Thread: 196, url: http://localhost:7474/db/data/transaction/197, request: {"statements":[{"statement":"MATCH result = (a)-[r:`HAS_CONNECTION`]-(b) where a.clidUuid = {`startProfileId`} and b.clidUuid = {`endProfileId`} RETURN result","parameters":{"startProfileId":"ac50203e-4089-40af-9ee1-eb1387801172","endProfileId":"0e7ed0c8-fe75-43d5-b4a4-0b4c09a81b79"},"resultDataContents":["graph"],"includeStats":false}]}

Neo4j version - 3.0.6 neo4j-ogm.version 2.1.1-SNAPSHOT spring boot version : 1.5.0.BUILD-SNAPSHOT

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:10 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
mangrishcommented, Dec 20, 2016

@akandach: Please check out the information box in this section: http://docs.spring.io/spring-data/neo4j/docs/4.2.x/reference/html/#reference_programming_model_annotatedQueries

Custom queries do not support a custom depth. Additionally, @Query does not support mapping a path to domain entities, as such, a path should not be returned from a Cypher query. Instead, return nodes and relationships to have them mapped to domain entities.

To fix this simply return a,r,n and remove the path from the MATCH statement.

0reactions
nmervailliecommented, Feb 3, 2017

@akandach It’s probably because the relationship to ProfileToProfile is not an attribute of your Profile entity.

Having to declare the relationships in your entities is problematic for you ? If so, can you describe a bit more your use case ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Array of relationship entities not populating with zero sized array
I am finding that any query I do to load these User entities gets played_josekis as null if the User has no such...
Read more >
Neo4J OGM MappingException: Field with primary id is null ...
This behavior was a problem with Neo4J OGM itself. A developer answered in this thread, that the issue will be fixed in future...
Read more >
Session - neo4j-ogm-core 4.0.0 javadoc
When loading entities already present in Session following happens: cached instance of the entity is returned; all property fields are set to original...
Read more >
Spring Data Neo4j
An OGM maps nodes and relationships in the graph to objects and references in a domain model. Object instances are mapped to nodes...
Read more >
A Guide to Neo4J with Java - Baeldung
This article is about Neo4j - one of the most mature and full-featured graph databases on the market today.
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