Skip to content

Support derived deleteBy methods. #2281

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

Closed
alex-warres opened this issue Jun 8, 2021 · 1 comment
Closed

Support derived deleteBy methods. #2281

alex-warres opened this issue Jun 8, 2021 · 1 comment
Assignees
Labels
type: bug A general bug

Comments

@alex-warres
Copy link

In Spring Data Neo4j 6.1.1 (and probably earlier), I noticed that the derived "deleteByX" queries actually don't delete; they do a find instead.
While it's easy enough to just write a custom delete query, I point this out because it's explicitly a feature in the documentation:
https://docs.spring.io/spring-data/neo4j/docs/current/reference/html/#repositories.core-concepts

Thanks!

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Jun 8, 2021
@michael-simons michael-simons self-assigned this Jun 8, 2021
@michael-simons michael-simons changed the title Derived Delete Queries Don't Delete Support derived deleteBy methods. Jun 8, 2021
@michael-simons michael-simons added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Jun 8, 2021
@michael-simons
Copy link
Collaborator

Great catch! I labelled this as a bug as I think a find should not happen. Rather an exception or actually do what's promised. Thank you, will be fixed in 6.0.10.

@michael-simons michael-simons added this to the 6.0.10 (2020.0.10) milestone Jun 8, 2021
michael-simons added a commit that referenced this issue Jun 8, 2021
This changes adds support for the derived delete by supports.
To make this possible, both clients (imperative and reactive) needs to be a bit more lenient about what happens when they receive a `null` on `one`: Technically, when there has been a result but the mapping function was asked to return a `void`, this is correct.

Apart from that, the same `detach delete` logic like in `deleteById` is applied.

Valid return types for `deleteBy` are `void` or `long` or wrappers. We don’t match and return.

This closes #2281.
michael-simons added a commit that referenced this issue Jun 8, 2021
This changes adds support for the derived delete by supports.
To make this possible, both clients (imperative and reactive) needs to be a bit more lenient about what happens when they receive a `null` on `one`: Technically, when there has been a result but the mapping function was asked to return a `void`, this is correct.

Apart from that, the same `detach delete` logic like in `deleteById` is applied.

Valid return types for `deleteBy` are `void` or `long` or wrappers. We don’t match and return.

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

No branches or pull requests

3 participants