Skip to content

Commit efe46f4

Browse files
committed
Improve documentation for Modifying annotation.
Outline that the usage of this annotation leads to calling Results.getRowsUpdated() to obtain the query method result value. Closes #629
1 parent eea838c commit efe46f4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Diff for: src/main/java/org/springframework/data/r2dbc/repository/Modifying.java

+6-3
Original file line numberDiff line numberDiff line change
@@ -22,12 +22,15 @@
2222
import java.lang.annotation.Target;
2323

2424
/**
25-
* Indicates a query method should be considered a modifying query as that changes the way it needs to be executed.
25+
* Indicates a query method should be considered a modifying query that returns nothing or the number of rows affected
26+
* by the query.
2627
* <p>
27-
* Queries that should be annotated with a {@code @Modifying} annotation include {@code INSERT}, {@code UPDATE},
28-
* {@code DELETE}, and DDL statements. The result of these queries can be consumed as affected row count.
28+
* Query methods annotated with {@code @Modifying} are typically {@code INSERT}, {@code UPDATE}, {@code DELETE}, and DDL
29+
* statements that do not return tabular results. This annotation isn't applicable if the query method returns results
30+
* such as {@code INSERT} with generated keys.
2931
*
3032
* @author Mark Paluch
33+
* @see io.r2dbc.spi.Result#getRowsUpdated()
3134
*/
3235
@Retention(RetentionPolicy.RUNTIME)
3336
@Target({ ElementType.METHOD, ElementType.ANNOTATION_TYPE })

0 commit comments

Comments
 (0)