Skip to content

Ensure that internal database ids are accessed via id(n) in nested, derived query methods. [DATAGRAPH-1231] #1792

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
spring-projects-issues opened this issue Jun 11, 2019 · 1 comment
Assignees
Labels
in: core Issues in core support type: bug A general bug

Comments

@spring-projects-issues
Copy link

Ozgur H opened DATAGRAPH-1231 and commented

When findById() method defined on the repository is used, SDN correctly uses the ID( n ) = \{...} syntax. However, when one tries to access the same logic for a child/field entity, the query is constructed with a format like:

m0.id=\{id_0 }

which of course doesn't work for internal Neo4J ids.

 

If possible, it would be nice to have the framework figure out that the referred object is a graph entity, which requires special ID filtering logic, and creates the query accordingly


Affects: 5.1.8 (Lovelace SR8)

Reference URL: https://docs.spring.io/spring-data/neo4j/docs/5.1.8.RELEASE/reference/html/#repositories.query-methods.query-property-expressions

@spring-projects-issues spring-projects-issues added type: enhancement A general enhancement in: core Issues in core support labels Dec 31, 2020
@michael-simons michael-simons changed the title Derived findById for field entity (property expression) not using ID(n) syntax [DATAGRAPH-1231] Support generated ids in derived finder methods. [DATAGRAPH-1231] Jan 12, 2021
@michael-simons
Copy link
Collaborator

michael-simons commented Jan 12, 2021

Hello @OzgurH this is a duplicate of #504 and has been fixed in 5.2.x and 5.3.x. I'm gonna back port it to 5.1.x but there are no plans of a 5.1.x right now, as it went EOL October 2020.

Find the EOL announcement here: https://spring.io/blog/2020/10/28/spring-data-neumann-sr5-moore-sr11-and-lovelace-sr21-available-now

I'm also gonna add a test for the nested traversal.

Thank you for your contribution in the first place and of course your patience.

@michael-simons michael-simons added type: bug A general bug and removed type: enhancement A general enhancement labels Jan 12, 2021
@michael-simons michael-simons changed the title Support generated ids in derived finder methods. [DATAGRAPH-1231] Ensure that internal database ids are accessed via id(n) in nested, derived query methods. [DATAGRAPH-1231] Jan 12, 2021
michael-simons added a commit that referenced this issue Jan 12, 2021
… nested, derived query methods.

This closes #1792.
michael-simons added a commit that referenced this issue Jan 12, 2021
… nested, derived query methods.

This closes #1792.
michael-simons added a commit that referenced this issue Jan 12, 2021
This introduces NativeIdFilterFunction that is applied when a derived finder method hits a native id property.

This is a backport of c0050a1 into 5.1.x that closes #1792.
michael-simons added a commit that referenced this issue Jan 12, 2021
… nested, derived query methods.

This closes #1792.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
in: core Issues in core support type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants