Skip to content

Commit 39936c6

Browse files
mp911deschauder
authored andcommitted
#59 - Simplify CustomConversions bean construction.
Original pull request: #70.
1 parent 6fab5e6 commit 39936c6

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

src/main/java/org/springframework/data/r2dbc/config/AbstractR2dbcConfiguration.java

+11-2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717

1818
import io.r2dbc.spi.ConnectionFactory;
1919

20+
import java.util.Collections;
2021
import java.util.Optional;
2122

2223
import org.springframework.context.annotation.Bean;
@@ -149,10 +150,18 @@ public ReactiveDataAccessStrategy reactiveDataAccessStrategy(RelationalMappingCo
149150
*/
150151
@Bean
151152
public R2dbcCustomConversions r2dbcCustomConversions() {
153+
return new R2dbcCustomConversions(getStoreConversions(), Collections.emptyList());
154+
}
155+
156+
/**
157+
* Returns the {@link Dialect}-specific {@link StoreConversions}.
158+
*
159+
* @return the {@link Dialect}-specific {@link StoreConversions}.
160+
*/
161+
protected StoreConversions getStoreConversions() {
152162

153163
Dialect dialect = getDialect(connectionFactory());
154-
StoreConversions storeConversions = StoreConversions.of(dialect.getSimpleTypeHolder());
155-
return new R2dbcCustomConversions(storeConversions, R2dbcCustomConversions.STORE_CONVERTERS);
164+
return StoreConversions.of(dialect.getSimpleTypeHolder(), R2dbcCustomConversions.STORE_CONVERTERS);
156165
}
157166

158167
/**

0 commit comments

Comments
 (0)