You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/main/asciidoc/reference/r2dbc-core.adoc
+13-79
Original file line number
Diff line number
Diff line change
@@ -1,14 +1,13 @@
1
1
R2DBC contains a wide range of features:
2
2
3
3
* Spring configuration support with Java-based `@Configuration` classes for an R2DBC driver instance.
4
-
* A `DatabaseClient` helper class that increases productivity when performing common R2DBC operations with integrated object mapping between rows and POJOs.
5
-
* Exception translation into Spring's portable Data Access Exception hierarchy.
4
+
* `R2dbcEntityTemplate` as central class for entity-bound operations that increases productivity when performing common R2DBC operations with integrated object mapping between rows and POJOs.
6
5
* Feature-rich object mapping integrated with Spring's Conversion Service.
7
6
* Annotation-based mapping metadata that is extensible to support other metadata formats.
8
7
* Automatic implementation of Repository interfaces, including support for custom query methods.
9
8
10
-
For most tasks, you should use `DatabaseClient` or the repository support, which both use the rich mapping functionality.
11
-
`DatabaseClient` is the place to look for accessing functionality such as ad-hoc CRUD operations.
9
+
For most tasks, you should use `R2dbcEntityTemplate` or the repository support, which both use the rich mapping functionality.
10
+
`R2dbcEntityTemplate` is the place to look for accessing functionality such as ad-hoc CRUD operations.
2018-11-28 10:47:04,074 DEBUG ata.r2dbc.function.DefaultDatabaseClient: 908 - Executing SQL statement [INSERT INTO person (id, name, age) VALUES($1, $2, $3)]
198
-
2018-11-28 10:47:04,092 DEBUG ata.r2dbc.function.DefaultDatabaseClient: 575 - Executing SQL statement [SELECT id, name, age FROM person]
131
+
2018-11-28 10:47:04,074 DEBUG amework.core.r2dbc.DefaultDatabaseClient: 908 - Executing SQL statement [INSERT INTO person (id, name, age) VALUES($1, $2, $3)]
132
+
2018-11-28 10:47:04,092 DEBUG amework.core.r2dbc.DefaultDatabaseClient: 575 - Executing SQL statement [SELECT id, name, age FROM person]
199
133
2018-11-28 10:47:04,436 INFO org.spring.r2dbc.example.R2dbcApp: 43 - Person [id='joe', name='Joe', age=34]
200
134
----
201
135
====
202
136
203
137
Even in this simple example, there are few things to notice:
204
138
205
-
* You can create an instance of the central helper class in Spring Data R2DBC (<<r2dbc.datbaseclient,`DatabaseClient`>>) by using a standard `io.r2dbc.spi.ConnectionFactory` object.
139
+
* You can create an instance of the central helper class in Spring Data R2DBC (`R2dbcEntityTemplate`) by using a standard `io.r2dbc.spi.ConnectionFactory` object.
206
140
* The mapper works against standard POJO objects without the need for any additional metadata (though you can, optionally, provide that information -- see <<mapping,here>>.).
207
141
* Mapping conventions can use field access. Notice that the `Person` class has only getters.
208
142
* If the constructor argument names match the column names of the stored row, they are used to instantiate the object.
@@ -232,7 +166,7 @@ public class ApplicationConfiguration extends AbstractR2dbcConfiguration {
0 commit comments