-
Notifications
You must be signed in to change notification settings - Fork 616
Cannot sort by a @CompositeProperty #2884
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 raising this limitation. I am currently trying a few things around this to allow this access to a "unknown" (e.g. key value of a map) Java property while keeping the safety guards for the rest alive. Needs some rearrangement in the code to check for the (composite) property of the entity earlier. |
There is now a
|
Thanks @meistermeier for the update. I tested it (see updated https://github.com/ellebrecht/sdnCompositeIssueReproducer) and it does not yet work. The Cypher query generated is This seems to simply yield the order in which the nodes were inserted. However, the order seems correct if I prepend the composite property key like this |
Thanks for the feedback. You are completely right. I got it working because the test data set "accidentally" had the right order matching my property and inverting the order, inverted the result correctly. |
Glad to hear you could verify it. Will you update your branch accordingly? Just checking if this still fits with our current sprint :) |
Trying to get this in the next patch release (Friday April, 12th). The problem you showed in your updated branch/feedback is not only affecting the composite properties, as far as I can tell yet. Need some more investigation on |
I pushed an update to the branch. (~15 minutes and it will be available) |
There was a problem with a test case. The updated snapshot should be available in a few minutes. |
Works great, thanks! 👍 |
Should work for map projection and node returns now. Closes #2884
Good to hear, thanks for your feedback. It will be in the 7.1.11 patch release and all newer versions. |
Should work for map projection and node returns now. Closes #2884
When using
@Node
s containing a@CompositeProperty
, I'd expect to be able to use the mapped Neo4j node property inNeo4jRepository.findAll(Sort.by("composite.property"))
Affected Versions
SDN 7.2.4 with Spring Boot 3.2.4
Reproduce
Here's a simple class to reproduce (see https://github.com/ellebrecht/sdnCompositeIssueReproducer for a complete repo)
Expected behaviour
I expected the
repo.findAll(Sort.by("composite.c2"))
to work like sorting by any other property, e.g.repo.findAll(Sort.by("name"))
Actual behaviour
Additional info
CypherAdapterUtils.sortAdapterFor():49
tests for the presence of a dot to determine whether the property is qualified with a name. This doesn't work with @CompositeProperty because Java Map keys are mapped to Neo4j node property keys using a dot as well.The text was updated successfully, but these errors were encountered: