-
Notifications
You must be signed in to change notification settings - Fork 617
Target of relationship property entities is serialised into properties and not as a separate property. #2537
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
Comments
Thanks for the feedback @venkat125 They are actually serialized but not into the correct bucket. Will be fixed, and you'll find an example in the linked test class |
I also changed the title: The target entity is in fact not correctly serialised, the properties are. I didn't run you code because APOC and also I don't have time to debug the query, but things on the properties side are working correctly. |
…ty entities. This should have gone into a separate field in parallel to properties, not into the properties itself. Fixes #2537 and also adds a test for the specific question asked in the ticket.
…ty entities. This should have gone into a separate field in parallel to properties, not into the properties itself. Fixes #2537 and also adds a test for the specific question asked in the ticket.
…ty entities. This should have gone into a separate field in parallel to properties, not into the properties itself. Fixes #2537 and also adds a test for the specific question asked in the ticket.
Thanks that worked @michael-simons. so in addition to existing model added
Relationship Entity
in this testcase with following
throws error as follows: (not sure why it got parsed as List(Map) instead of Map as its 1-1 relationship)
Is that something has to be modified in the query on accessing target field? @michael-simons |
Hi. Thanks for your feedback (again) @venkat125 . The error your observing results from the fact that we serialize 1:1 relationships like 1:many (as a list of things). This is not intuitive, but it is the way it is right now and I can't change it in 6.x branch. Your workaround in the above query is would be
See the difference in that Btw, the hint about all relationships being lists of maps is in the docs:
But I will clarify that. |
# Conflicts: # src/test/java/org/springframework/data/neo4j/integration/issues/IssuesIT.java # src/test/java/org/springframework/data/neo4j/integration/issues/gh2323/PersonRepository.java # src/test/java/org/springframework/data/neo4j/integration/issues/gh2323/PersonService.java
# Conflicts: # src/test/java/org/springframework/data/neo4j/integration/issues/IssuesIT.java # src/test/java/org/springframework/data/neo4j/integration/issues/gh2323/PersonRepository.java # src/test/java/org/springframework/data/neo4j/integration/issues/gh2323/PersonService.java
Please take a look on test case. Below is the follow up of the reference test case.
case 1 :
It updates
department
andage
property inPerson
Entity, but not updating relationships between person and languages. Thus returning empty / null like in original post. (knows) arraylist of relationship is not serialized it seems.Case 2 :
But, it works fine when passed collection and first level property separately in parameters like below (updates the DB)
Seems the collection property inside the Entity is not getting serialized or not accessible. but other first level properties are accessible in query.
Note: spring-boot-starter-data-neo4j version: 2.6.7 used
Is there a way to use the
Person
Entity alone to construct whole query?Originally posted by @michael-simons in #2292 (comment)
The text was updated successfully, but these errors were encountered: