You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
SDN will fail the correctly map the Collection of Dog for the getDogsForPerson method due to the dog node coming back as null. This did work correctly in OGM.
If you do the following, this does appear to make it work, though this seems not to be the expected behavior with the root node being returned from Neo4J and it may also cause unintended issues:
… `OPTIONAL` returns.
This fixes#2572 and is a tough call: The query presented there is totally valid but returns not an empty result but a record containing only one `null` element due to the way the Cyper `OPTIONAL` keyword works. We could try parsing the query, but this will be an endless rabbit whole in the future to come.
The approach here is to check now whether a result contains exactly one record with one `NULL` value. If that is the case, no exception is thrown but `null` returned, which is later filtered on the clients.
That however drops the checking for non-null values there, so that methods don’t throw in those cases but returns empty optionals or empty / smaller lists.
… `OPTIONAL` returns.
This fixes#2572 and is a tough call: The query presented there is totally valid but returns not an empty result but a record containing only one `null` element due to the way the Cyper `OPTIONAL` keyword works. We could try parsing the query, but this will be an endless rabbit whole in the future to come.
The approach here is to check now whether a result contains exactly one record with one `NULL` value. If that is the case, no exception is thrown but `null` returned, which is later filtered on the clients.
That however drops the checking for non-null values there, so that methods don’t throw in those cases but returns empty optionals or empty / smaller lists.
Thanks @aemonalgizlg for reporting this here and taking the effort to strip down the domain model, much appreciated. This will be fixed within the next releases.
Take not however that the owner property of the instances will be null when fetched that way, as your query doesn't contain the person.
Correct way would be:
MATCH(person:GH2572Parent {id: $id})
OPTIONAL MATCH (person)<-[r:IS_PET]-(dog:GH2572Child)
RETURN person, r, dog
In SDN, if you have the following nodes and relationships:
If a person has no pets directed towards it and you have the following pet repository:
SDN will fail the correctly map the
Collection
ofDog
for thegetDogsForPerson
method due to the dog node coming back asnull
. This did work correctly in OGM.If you do the following, this does appear to make it work, though this seems not to be the expected behavior with the root node being returned from Neo4J and it may also cause unintended issues:
The text was updated successfully, but these errors were encountered: