-
Notifications
You must be signed in to change notification settings - Fork 161
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
Direct Relationship Persistence Issue #951
Comments
For more context:
|
You are not loading the What worked for me:
as you can see, I removed the With a test
I get |
Thank you for the response! This seems to be working. Could you elaborate on why we should reference My guess is, it needs to trace from |
First of all I somehow came to the conclusion that the |
Thanks! So I guess the key is "what is being annotated with @relationship" |
Yes, that is 100% correct. In your case this will solve the problem. If you don't need the properties on a relationship, you could also just remove the whole definition of the It is just the definition for the |
Got it, thanks! Closing this issue |
If the source model has a relationship of a specific type defined that is also covered by a relationship entity, Neo4j-OGM would eagerly try to map everything to this entity before it notices that the source is not using the entity and does not put in the related node because the types are mismatching. This commit will fix this behaviour while keeping already existing functionality in place as it is.
There is now a fix for this in place in 3.2.41: https://github.com/neo4j/neo4j-ogm/releases/tag/v3.2.41 |
Great, thanks! So now having the following would work?
(instead of EDIT: looks like yes, just upgraded and tested. This is great |
Thanks for the fast feedback on this. Faster than I could reply to the question. |
Say I have nodes of types A, B and C, and I have the following graph:
My goal is to load the node A, together with the connected B and C nodes.
Currently (in Kotlin code) I am doing
session.load(A::class.java, "a1", -1)
, which uses this implementation:<T,ID extends Serializable> T load(Class<T> type, ID id, int depth)
from https://javadoc.io/static/org.neo4j/neo4j-ogm-core/3.2.3/org/neo4j/ogm/session/Session.htmlAccording to https://neo4j.com/docs/ogm-manual/current/reference/#reference:session:loading-entities:load-depth , providing depth = -1 should make it load the node A together with all its connected nodes. However, it seems to only load the node A.
What is the correct method I should be using to achieve my goal here? I have tried looking into the neo4j OGM documentation, but have not found more information.
Expected Behavior
Expected load to load connected nodes
Current Behavior
Load only loads the initial node but not its connected nodes
Context
Your Environment
Steps to Reproduce
The text was updated successfully, but these errors were encountered: