diff --git a/src/main/asciidoc/reference/r2dbc-core.adoc b/src/main/asciidoc/reference/r2dbc-core.adoc index fbbb324..33f80e7 100644 --- a/src/main/asciidoc/reference/r2dbc-core.adoc +++ b/src/main/asciidoc/reference/r2dbc-core.adoc @@ -116,7 +116,7 @@ You also need a main application to run, as follows: ==== [source,java,indent=0] ---- -include::../{example-root}/R2dbcApp.java[tags=class] +include::../{example-root}/R2dbcApp.java[tag=class] ---- ==== diff --git a/src/main/asciidoc/reference/r2dbc-template.adoc b/src/main/asciidoc/reference/r2dbc-template.adoc index cd6251f..970ae89 100644 --- a/src/main/asciidoc/reference/r2dbc-template.adoc +++ b/src/main/asciidoc/reference/r2dbc-template.adoc @@ -31,7 +31,7 @@ The following example shows how to insert a row and retrieving its contents: ==== [source,java,indent=0] ---- -include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=insertAndSelect] +include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=insertAndSelect] ---- ==== @@ -56,7 +56,7 @@ This functionality is supported by the < Using `Person` with the `from(…)` method sets the `FROM` table based on mapping metadata. -It also maps tabular results on `Person` result objects. +<1> Using `Person` with the `select(…)` method maps tabular results on `Person` result objects. <2> Fetching `all()` rows returns a `Flux` without limiting results. ==== @@ -81,7 +80,7 @@ The following example declares a more complex query that specifies the table nam ==== [source,java,indent=0] ---- -include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=fullSelect] +include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=fullSelect] ---- <1> Selecting from a table by name returns row results using the given domain type. <2> The issued query declares a `WHERE` condition on `firstname` and `lastname` columns to filter results. @@ -142,7 +141,7 @@ Consider the following simple typed insert operation: ==== [source,java,indent=0] ---- -include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=insert] +include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=insert] ---- <1> Using `Person` with the `into(…)` method sets the `INTO` table, based on mapping metadata. It also prepares the insert statement to accept `Person` objects for inserting. @@ -165,12 +164,12 @@ Consider the following simple typed update operation: ---- Person modified = … -include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=update] +include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=update] ---- <1> Update `Person` objects and apply mapping based on mapping metadata. <2> Set a different table name by calling the `inTable(…)` method. -<2> Specify a query that translates into a `WHERE` clause. -<3> Apply the `Update` object. +<3> Specify a query that translates into a `WHERE` clause. +<4> Apply the `Update` object. Set in this case `age` to `42` and return the number of affected rows. ==== @@ -185,10 +184,10 @@ Consider the following simple insert operation: ==== [source,java] ---- -include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=delete] +include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=delete] ---- <1> Delete `Person` objects and apply mapping based on mapping metadata. <2> Set a different table name by calling the `from(…)` method. -<2> Specify a query that translates into a `WHERE` clause. -<3> Apply the delete operation and return the number of affected rows. +<3> Specify a query that translates into a `WHERE` clause. +<4> Apply the delete operation and return the number of affected rows. ==== diff --git a/src/test/java/org/springframework/data/r2dbc/documentation/Person.java b/src/test/java/org/springframework/data/r2dbc/documentation/Person.java index ac338a3..7369bff 100644 --- a/src/test/java/org/springframework/data/r2dbc/documentation/Person.java +++ b/src/test/java/org/springframework/data/r2dbc/documentation/Person.java @@ -45,4 +45,4 @@ public class Person { return "Person [id=" + id + ", name=" + name + ", age=" + age + "]"; } } -// end::class[]} +// end::class[] diff --git a/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java b/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java index 894d75c..ae47f2e 100644 --- a/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java +++ b/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java @@ -57,4 +57,4 @@ public class R2dbcApp { .verifyComplete(); } } -// tag::class[] +// end::class[] diff --git a/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java b/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java index af1f649..0ac5768 100644 --- a/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java +++ b/src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java @@ -56,7 +56,7 @@ class R2dbcEntityTemplateSnippets { // tag::simpleSelect[] Flux people = template.select(Person.class) // <1> - .all(); + .all(); // <2> // end::simpleSelect[] }