44
44
import org .springframework .data .r2dbc .support .SqlStateR2dbcExceptionTranslator ;
45
45
import org .springframework .data .relational .core .conversion .BasicRelationalConverter ;
46
46
import org .springframework .data .relational .core .mapping .NamingStrategy ;
47
- import org .springframework .data .relational .core .mapping .RelationalMappingContext ;
48
47
import org .springframework .lang .Nullable ;
49
48
import org .springframework .util .Assert ;
50
49
@@ -95,7 +94,7 @@ public R2dbcDialect getDialect(ConnectionFactory connectionFactory) {
95
94
}
96
95
97
96
/**
98
- * Register a {@link DatabaseClient} using {@link #connectionFactory()} and {@link RelationalMappingContext }.
97
+ * Register a {@link DatabaseClient} using {@link #connectionFactory()} and {@link ReactiveDataAccessStrategy }.
99
98
*
100
99
* @return must not be {@literal null}.
101
100
* @throws IllegalArgumentException if any of the required args is {@literal null}.
@@ -122,39 +121,38 @@ public DatabaseClient databaseClient(ReactiveDataAccessStrategy dataAccessStrate
122
121
}
123
122
124
123
/**
125
- * Register a {@link RelationalMappingContext } and apply an optional {@link NamingStrategy}.
124
+ * Register a {@link R2dbcMappingContext } and apply an optional {@link NamingStrategy}.
126
125
*
127
126
* @param namingStrategy optional {@link NamingStrategy}. Use {@link NamingStrategy#INSTANCE} as fallback.
128
127
* @param r2dbcCustomConversions customized R2DBC conversions.
129
128
* @return must not be {@literal null}.
130
129
* @throws IllegalArgumentException if any of the required args is {@literal null}.
131
130
*/
132
131
@ Bean
133
- public RelationalMappingContext r2dbcMappingContext (Optional <NamingStrategy > namingStrategy ,
132
+ public R2dbcMappingContext r2dbcMappingContext (Optional <NamingStrategy > namingStrategy ,
134
133
R2dbcCustomConversions r2dbcCustomConversions ) {
135
134
136
135
Assert .notNull (namingStrategy , "NamingStrategy must not be null!" );
137
136
138
- R2dbcMappingContext relationalMappingContext = new R2dbcMappingContext (
139
- namingStrategy .orElse (NamingStrategy .INSTANCE ));
140
- relationalMappingContext .setSimpleTypeHolder (r2dbcCustomConversions .getSimpleTypeHolder ());
137
+ R2dbcMappingContext context = new R2dbcMappingContext (namingStrategy .orElse (NamingStrategy .INSTANCE ));
138
+ context .setSimpleTypeHolder (r2dbcCustomConversions .getSimpleTypeHolder ());
141
139
142
- return relationalMappingContext ;
140
+ return context ;
143
141
}
144
142
145
143
/**
146
144
* Creates a {@link ReactiveDataAccessStrategy} using the configured
147
- * {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions)} RelationalMappingContext }.
145
+ * {@link #r2dbcMappingContext(Optional, R2dbcCustomConversions)} R2dbcMappingContext }.
148
146
*
149
- * @param mappingContext the configured {@link RelationalMappingContext }.
147
+ * @param mappingContext the configured {@link R2dbcMappingContext }.
150
148
* @param r2dbcCustomConversions customized R2DBC conversions.
151
149
* @return must not be {@literal null}.
152
150
* @see #r2dbcMappingContext(Optional, R2dbcCustomConversions)
153
151
* @see #getDialect(ConnectionFactory)
154
152
* @throws IllegalArgumentException if any of the {@literal mappingContext} is {@literal null}.
155
153
*/
156
154
@ Bean
157
- public ReactiveDataAccessStrategy reactiveDataAccessStrategy (RelationalMappingContext mappingContext ,
155
+ public ReactiveDataAccessStrategy reactiveDataAccessStrategy (R2dbcMappingContext mappingContext ,
158
156
R2dbcCustomConversions r2dbcCustomConversions ) {
159
157
160
158
Assert .notNull (mappingContext , "MappingContext must not be null!" );
0 commit comments