Skip to content

Commit bf356f5

Browse files
committed
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
1 parent 7a4143f commit bf356f5

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

spring-data-r2dbc/src/main/asciidoc/reference/r2dbc-repositories.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -253,6 +253,10 @@ The result of a modifying query can be:
253253
The `@Modifying` annotation is only relevant in combination with the `@Query` annotation.
254254
Derived custom methods do not require this annotation.
255255

256+
Modifying queries are executed directly against the database.
257+
No events or callbacks get called.
258+
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.
259+
256260
Alternatively, you can add custom modifying behavior by using the facilities described in <<repositories.custom-implementations,Custom Implementations for Spring Data Repositories>>.
257261

258262
[[r2dbc.repositories.queries.spel]]

src/main/asciidoc/jdbc.adoc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -700,6 +700,10 @@ You can specify the following return types:
700700
* `int` (updated record count)
701701
* `boolean`(whether a record was updated)
702702

703+
Modifying queries are executed directly against the database.
704+
No events or callbacks get called.
705+
Therefore also fields with auditing annotations do not get updated if they don't get updated in the annotated query.
706+
703707
include::{spring-data-commons-docs}/query-by-example.adoc[leveloffset=+1]
704708
include::query-by-example.adoc[leveloffset=+1]
705709

0 commit comments

Comments
 (0)