Browse Source

Polishing.

pull/1188/head
Greg L. Turnquist 5 years ago
parent
commit
38311c90a9
No known key found for this signature in database
GPG Key ID: CB2FA4D512B5C413
  1. 2
      src/main/asciidoc/reference/r2dbc-core.adoc
  2. 25
      src/main/asciidoc/reference/r2dbc-template.adoc
  3. 2
      src/test/java/org/springframework/data/r2dbc/documentation/Person.java
  4. 2
      src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java
  5. 2
      src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java

2
src/main/asciidoc/reference/r2dbc-core.adoc

@ -116,7 +116,7 @@ You also need a main application to run, as follows: @@ -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]
----
====

25
src/main/asciidoc/reference/r2dbc-template.adoc

@ -31,7 +31,7 @@ The following example shows how to insert a row and retrieving its contents: @@ -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 <<r2dbc.drivers,`R2dbcDialect` abstractio @@ -56,7 +56,7 @@ This functionality is supported by the <<r2dbc.drivers,`R2dbcDialect` abstractio
====
[source,java,indent=0]
----
include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=select]
include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=select]
----
====
@ -69,10 +69,9 @@ Consider the following simple query: @@ -69,10 +69,9 @@ Consider the following simple query:
====
[source,java,indent=0]
----
include::../{example-root}/R2dbcEntityTemplateSnippets.java[tags=simpleSelect]
include::../{example-root}/R2dbcEntityTemplateSnippets.java[tag=simpleSelect]
----
<1> 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<Person>` without limiting results.
====
@ -81,7 +80,7 @@ The following example declares a more complex query that specifies the table nam @@ -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: @@ -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: @@ -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: @@ -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.
====

2
src/test/java/org/springframework/data/r2dbc/documentation/Person.java

@ -45,4 +45,4 @@ public class Person { @@ -45,4 +45,4 @@ public class Person {
return "Person [id=" + id + ", name=" + name + ", age=" + age + "]";
}
}
// end::class[]}
// end::class[]

2
src/test/java/org/springframework/data/r2dbc/documentation/R2dbcApp.java

@ -57,4 +57,4 @@ public class R2dbcApp { @@ -57,4 +57,4 @@ public class R2dbcApp {
.verifyComplete();
}
}
// tag::class[]
// end::class[]

2
src/test/java/org/springframework/data/r2dbc/documentation/R2dbcEntityTemplateSnippets.java

@ -56,7 +56,7 @@ class R2dbcEntityTemplateSnippets { @@ -56,7 +56,7 @@ class R2dbcEntityTemplateSnippets {
// tag::simpleSelect[]
Flux<Person> people = template.select(Person.class) // <1>
.all();
.all(); // <2>
// end::simpleSelect[]
}

Loading…
Cancel
Save