2626
2727import  org .springframework .dao .InvalidDataAccessResourceUsageException ;
2828import  org .springframework .data .convert .CustomConversions .StoreConversions ;
29- import  org .springframework .data .domain .Sort ;
30- import  org .springframework .data .domain .Sort .Order ;
3129import  org .springframework .data .mapping .context .MappingContext ;
3230import  org .springframework .data .r2dbc .dialect .ArrayColumns ;
3331import  org .springframework .data .r2dbc .dialect .BindMarkersFactory ;
@@ -62,7 +60,6 @@ public class DefaultReactiveDataAccessStrategy implements ReactiveDataAccessStra
6260private  final  R2dbcConverter  converter ;
6361private  final  UpdateMapper  updateMapper ;
6462private  final  MappingContext <RelationalPersistentEntity <?>, ? extends  RelationalPersistentProperty > mappingContext ;
65- private  final  StatementFactory  statements ;
6663private  final  StatementMapper  statementMapper ;
6764
6865/** 
@@ -127,11 +124,10 @@ public SelectRenderContext getSelect() {
127124}
128125};
129126
130- this .statements  = new  DefaultStatementFactory (this .dialect , renderContext );
131- this .statementMapper  = new  DefaultStatementMapper (dialect , renderContext , updateMapper , mappingContext );
127+ this .statementMapper  = new  DefaultStatementMapper (dialect , renderContext , this .updateMapper , this .mappingContext );
132128}
133129
134- /*   
130+ /* 
135131 * (non-Javadoc) 
136132 * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getAllColumns(java.lang.Class) 
137133 */ 
@@ -152,7 +148,7 @@ public List<String> getAllColumns(Class<?> entityType) {
152148return  columnNames ;
153149}
154150
155- /*   
151+ /* 
156152 * (non-Javadoc) 
157153 * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getIdentifierColumns(java.lang.Class) 
158154 */ 
@@ -182,7 +178,7 @@ public OutboundRow getOutboundRow(Object object) {
182178
183179OutboundRow  row  = new  OutboundRow ();
184180
185- converter .write (object , row );
181+ this . converter .write (object , row );
186182
187183RelationalPersistentEntity <?> entity  = getRequiredPersistentEntity (ClassUtils .getUserClass (object ));
188184
@@ -205,53 +201,25 @@ private boolean shouldConvertArrayValue(RelationalPersistentProperty property, S
205201
206202private  SettableValue  getArrayValue (SettableValue  value , RelationalPersistentProperty  property ) {
207203
208- ArrayColumns  arrayColumns  = dialect .getArraySupport ();
204+ ArrayColumns  arrayColumns  = this . dialect .getArraySupport ();
209205
210206if  (!arrayColumns .isSupported ()) {
211207
212208throw  new  InvalidDataAccessResourceUsageException (
213- "Dialect "  + dialect .getClass ().getName () + " does not support array columns" );
209+ "Dialect "  + this . dialect .getClass ().getName () + " does not support array columns" );
214210}
215211
216- return  SettableValue .fromOrEmpty (converter .getArrayValue (arrayColumns , property , value .getValue ()),
212+ return  SettableValue .fromOrEmpty (this . converter .getArrayValue (arrayColumns , property , value .getValue ()),
217213property .getActualType ());
218214}
219215
220- /* 
221-  * (non-Javadoc) 
222-  * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getMappedSort(java.lang.Class, org.springframework.data.domain.Sort) 
223-  */ 
224- @ Override 
225- public  Sort  getMappedSort (Sort  sort , Class <?> typeToRead ) {
226- 
227- RelationalPersistentEntity <?> entity  = getPersistentEntity (typeToRead );
228- if  (entity  == null ) {
229- return  sort ;
230- }
231- 
232- List <Order > mappedOrder  = new  ArrayList <>();
233- 
234- for  (Order  order  : sort ) {
235- 
236- RelationalPersistentProperty  persistentProperty  = entity .getPersistentProperty (order .getProperty ());
237- if  (persistentProperty  == null ) {
238- mappedOrder .add (order );
239- } else  {
240- mappedOrder 
241- .add (Order .by (persistentProperty .getColumnName ()).with (order .getNullHandling ()).with (order .getDirection ()));
242- }
243- }
244- 
245- return  Sort .by (mappedOrder );
246- }
247- 
248216/* 
249217 * (non-Javadoc) 
250218 * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getRowMapper(java.lang.Class) 
251219 */ 
252220@ Override 
253221public  <T > BiFunction <Row , RowMetadata , T > getRowMapper (Class <T > typeToRead ) {
254- return  new  EntityRowMapper <>(typeToRead , converter );
222+ return  new  EntityRowMapper <>(typeToRead , this . converter );
255223}
256224
257225/* 
@@ -265,13 +233,8 @@ public String getTableName(Class<?> type) {
265233
266234/* 
267235 * (non-Javadoc) 
268-  * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getStatements () 
236+  * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getStatementMapper () 
269237 */ 
270- @ Override 
271- public  StatementFactory  getStatements () {
272- return  this .statements ;
273- }
274- 
275238@ Override 
276239public  StatementMapper  getStatementMapper () {
277240return  this .statementMapper ;
@@ -283,27 +246,27 @@ public StatementMapper getStatementMapper() {
283246 */ 
284247@ Override 
285248public  BindMarkersFactory  getBindMarkersFactory () {
286- return  dialect .getBindMarkersFactory ();
249+ return  this . dialect .getBindMarkersFactory ();
287250}
288251
289252/* 
290253 * (non-Javadoc) 
291254 * @see org.springframework.data.r2dbc.function.ReactiveDataAccessStrategy#getConverter() 
292255 */ 
293256public  R2dbcConverter  getConverter () {
294- return  converter ;
257+ return  this . converter ;
295258}
296259
297260public  MappingContext <RelationalPersistentEntity <?>, ? extends  RelationalPersistentProperty > getMappingContext () {
298- return  mappingContext ;
261+ return  this . mappingContext ;
299262}
300263
301264private  RelationalPersistentEntity <?> getRequiredPersistentEntity (Class <?> typeToRead ) {
302- return  mappingContext .getRequiredPersistentEntity (typeToRead );
265+ return  this . mappingContext .getRequiredPersistentEntity (typeToRead );
303266}
304267
305268@ Nullable 
306269private  RelationalPersistentEntity <?> getPersistentEntity (Class <?> typeToRead ) {
307- return  mappingContext .getPersistentEntity (typeToRead );
270+ return  this . mappingContext .getPersistentEntity (typeToRead );
308271}
309272}
0 commit comments