Skip to content
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

Ambiguity around @Modifying within documentation [DATAJPA-1485]

Closed
spring-projects-issues opened this issue Dec 19, 2018 · 1 comment
Closed
Assignees
Labels
type: bug type: documentation

Comments

@spring-projects-issues
Copy link

spring-projects-issues commented Dec 19, 2018

Arnold Galovics opened DATAJPA-1485 and commented

The documentation currently mentions @Modifying annotation as a requirement for repository methods which are not querying data (i.e. INSERT/UPDATE/DELETE)

By applying the annotation, according to the docs:

Doing so triggers the query annotated to the method as an updating query instead of a selecting one. 

The examples in the reference also applies the @Query annotation along with @Modifying which is perfectly fine.

However, when a derived query is used for data manipulation, the @Modifying annotation is not needed (at least this was the case last time I tested it). There is nothing mentioned in the docs about this behavior which might lead to confusions


Backported to: 2.1.4 (Lovelace SR4), 2.0.13 (Kay SR13), 1.11.18 (Ingalls SR18)

@spring-projects-issues
Copy link
Author

spring-projects-issues commented Dec 19, 2018

Oliver Drotbohm commented

I guess the reason it reads as it currently reads is that we assume you either use annotations to define queries or don't. If you're using query derivation, the method signature is what defines what gets executed. I guess that could be more prominently mentioned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug type: documentation
Projects
None yet
Development

No branches or pull requests

2 participants