From 38311c90a9fc882d952e848aa902857e256df81f Mon Sep 17 00:00:00 2001 From: "Greg L. Turnquist" Date: Thu, 4 Mar 2021 15:09:09 -0600 Subject: [PATCH] Polishing. --- src/main/asciidoc/reference/r2dbc-core.adoc | 2 +- .../asciidoc/reference/r2dbc-template.adoc | 25 +++++++++---------- .../data/r2dbc/documentation/Person.java | 2 +- .../data/r2dbc/documentation/R2dbcApp.java | 2 +- .../R2dbcEntityTemplateSnippets.java | 2 +- 5 files changed, 16 insertions(+), 17 deletions(-) diff --git a/src/main/asciidoc/reference/r2dbc-core.adoc b/src/main/asciidoc/reference/r2dbc-core.adoc index fbbb324f..33f80e78 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 cd6251fb..970ae896 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 ac338a3d..7369bff1 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 String toString() { 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 894d75c0..ae47f2ea 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 static void main(String[] args) { .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 af1f649f..0ac5768f 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 @@ void simpleSelect(R2dbcEntityTemplate template) { // tag::simpleSelect[] Flux people = template.select(Person.class) // <1> - .all(); + .all(); // <2> // end::simpleSelect[] }