-
Notifications
You must be signed in to change notification settings - Fork 618
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
Nested object mapping for custom CYPHER query cut off since SDN 7.3.2 #2963
Comments
Hello @ruempel Thanks a lot for your report. This is a regression directly related to #2918 The fixed by @ma-ku adds the direction to the collection name, and I didn't spot the use case of custom queries when merging it, my bad, sorry. I am working on a fix that does not require changes on your side. Until this is available, you would be able to fix it by adding public interface MyRepository extends CrudRepository<MyModel, String> {
@Query("""
MATCH (root:MyModel {uuid: $uuid})
RETURN root {
.*, MyModel_REL_TO_MY_NESTED_MODEL_MyModel_true: [
(root)-[:REL_TO_MY_NESTED_MODEL]->(nested:MyModel) | nested {. *}
]
}
""")
Optional<MyModel> getByUuidCustomQuery(String uuid);
} or |
(Excellent reproducer and bisection, thank you for that!) |
…ut directional prefix. This is a direct follow up on #2918, in which we added the suffix to the collection names. That change didn’t take custom queries into account and people are most likely still using the known pattern of `source_REL_target` and I would like to not break them. Therefor, we check now in the values list if a collection without suffix exists if we didn’t find one with and if so, use that. This fixes #2963.
…ut directional prefix. This is a direct follow up on #2918, in which we added the suffix to the collection names. That change didn’t take custom queries into account and people are most likely still using the known pattern of `source_REL_target` and I would like to not break them. Therefor, we check now in the values list if a collection without suffix exists if we didn’t find one with and if so, use that. This fixes #2963.
We are heavily using custom CYPHER queries in CRUD repositories for performance reasons.
Since SDN
7.3.2
, nested objects queried by relations are not mapped anymore. It worked until SDN7.3.1
.If you use this custom query, the
nested
object isnull
now:For your convenience, I prepared a minimum example Git repo with a test case, where you can try it out: https://github.com/planyverse/sdn-example
The text was updated successfully, but these errors were encountered: