Clarify documentation for @Modifying.

Modifying queries are executed directly against the database.
No events or callbacks get called.
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.

Closes #970
This commit is contained in:
Jens Schauder
2022-09-08 15:31:17 +02:00
parent 7a4143fb50
commit bf356f561d
2 changed files with 8 additions and 0 deletions

View File

@@ -253,6 +253,10 @@ The result of a modifying query can be:
The `@Modifying` annotation is only relevant in combination with the `@Query` annotation.
Derived custom methods do not require this annotation.
Modifying queries are executed directly against the database.
No events or callbacks get called.
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.
Alternatively, you can add custom modifying behavior by using the facilities described in <<repositories.custom-implementations,Custom Implementations for Spring Data Repositories>>.
[[r2dbc.repositories.queries.spel]]

View File

@@ -700,6 +700,10 @@ You can specify the following return types:
* `int` (updated record count)
* `boolean`(whether a record was updated)
Modifying queries are executed directly against the database.
No events or callbacks get called.
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.
include::{spring-data-commons-docs}/query-by-example.adoc[leveloffset=+1]
include::query-by-example.adoc[leveloffset=+1]