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
The following sections explain how to migrate to a newer version of Spring Data R2DBC.
5
+
6
+
[[upgrading.1.1-1.2]]
7
+
== Upgrading from 1.1.x to 1.2.x
8
+
9
+
Spring Data R2DBC was developed with the intent to evaluate how well R2DBC can integrate with Spring applications.
10
+
One of the main aspects was to move core support into Spring Framework once R2DBC support has proven useful.
11
+
Spring Framework 5.3 ships with a new module: Spring R2DBC.
12
+
13
+
`spring-r2dbc` ships core R2DBC functionality (a slim variant of `DatabaseClient`, Transaction Manager, Connection Factory initialization, Exception translation) that was initially provided by Spring Data R2DBC. The 1.2.0 release aligns with what's provided in Spring R2DBC by making several changes outlined in the following sections.
14
+
15
+
[[upgrading.1.1-1.2.deprecation]]
16
+
=== Deprecations
17
+
18
+
* Deprecation of `o.s.d.r2dbc.core.DatabaseClient` and its support classes `ConnectionAccessor`, `FetchSpec`, `SqlProvider` and a few more.
19
+
Named parameter support classes such as `NamedParameterExpander` are encapsulated by Spring R2DBC's `DatabaseClient` implementation hence we're not providing replacements as this was internal API in the first place.
20
+
Use `o.s.r2dbc.core.DatabaseClient` and their Spring R2DBC replacements available from `org.springframework.r2dbc.core`.
21
+
Entity-based methods (`select`/`insert`/`update`/`delete`) methods are available through `R2dbcEntityTemplate` which was introduced with version 1.1.
22
+
* Deprecation of `o.s.d.r2dbc.connectionfactory`, `o.s.d.r2dbc.connectionfactory.init`, and `o.s.d.r2dbc.connectionfactory.lookup` packages.
23
+
Use Spring R2DBC's variant which you can find at `o.s.r2dbc.connection`.
24
+
* Deprecation of `o.s.d.r2dbc.convert.ColumnMapRowMapper`.
25
+
Use `o.s.r2dbc.core.ColumnMapRowMapper` instead.
26
+
* Deprecation of binding support classes `o.s.d.r2dbc.dialect.Bindings`, `BindMarker`, `BindMarkers`, `BindMarkersFactory` and related types.
27
+
Use replacements from `org.springframework.r2dbc.core.binding`.
28
+
* Deprecation of `BadSqlGrammarException`, `UncategorizedR2dbcException` and exception translation at `o.s.d.r2dbc.support`.
29
+
Spring R2DBC provides a slim exception translation variant without an SPI for now available through `o.s.r2dbc.connection.ConnectionFactoryUtils#convertR2dbcException`.
30
+
31
+
[[upgrading.1.1-1.2.replacements]]
32
+
=== Usage of replacements provided by Spring R2DBC
33
+
34
+
To ease migration, several deprecated types are now subtypes of their replacements provided by Spring R2DBC. Spring Data R2DBC has changes several methods or introduced new methods accepting Spring R2DBC types.
35
+
Specifically the following classes are affected:
36
+
37
+
* `R2dbcEntityTemplate`
38
+
* `R2dbcDialect`
39
+
* Types in `org.springframework.data.r2dbc.query`
40
+
41
+
We recommend that you review your imports if you work with these types directly.
42
+
43
+
[[upgrading.1.1-1.2.dependencies]]
44
+
=== Dependency Changes
45
+
46
+
To make use of Spring R2DBC, make sure to include the following dependency:
Copy file name to clipboardExpand all lines: src/main/java/org/springframework/data/r2dbc/connectionfactory/TransactionAwareConnectionFactoryProxy.java
+2
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,9 @@
60
60
* @see Connection#close
61
61
* @see ConnectionFactoryUtils#doGetConnection
62
62
* @see ConnectionFactoryUtils#doReleaseConnection
63
+
* @deprecated since 1.2 in favor of Spring R2DBC. Use {@link org.springframework.r2dbc.connection} instead.
0 commit comments