Skip to content

Commit be7c04c

Browse files
michael-simonsmp911de
authored andcommitted
DATAJDBC-267 - Explicitly use the own custom conversions bean.
Original pull request: #89.
1 parent 84de41a commit be7c04c

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/main/java/org/springframework/data/jdbc/repository/config/JdbcConfiguration.java

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,31 +33,30 @@
3333
* @author Greg Turnquist
3434
* @author Jens Schauder
3535
* @author Mark Paluch
36+
* @author Michael Simons
3637
*/
3738
@Configuration
3839
public class JdbcConfiguration {
3940

4041
@Bean
41-
protected RelationalMappingContext jdbcMappingContext(Optional<NamingStrategy> namingStrategy,
42-
CustomConversions customConversions) {
42+
protected RelationalMappingContext jdbcMappingContext(Optional<NamingStrategy> namingStrategy) {
4343

4444
RelationalMappingContext mappingContext = new RelationalMappingContext(
4545
namingStrategy.orElse(NamingStrategy.INSTANCE));
46-
mappingContext.setSimpleTypeHolder(customConversions.getSimpleTypeHolder());
46+
mappingContext.setSimpleTypeHolder(jdbcCustomConversions().getSimpleTypeHolder());
4747

4848
return mappingContext;
4949
}
5050

5151
@Bean
52-
protected RelationalConverter relationalConverter(RelationalMappingContext mappingContext,
53-
CustomConversions customConversions) {
54-
return new BasicRelationalConverter(mappingContext, customConversions);
52+
protected RelationalConverter relationalConverter(RelationalMappingContext mappingContext) {
53+
return new BasicRelationalConverter(mappingContext, jdbcCustomConversions());
5554
}
5655

5756
/**
5857
* Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
5958
* {@link CustomConversions} will be registered with the
60-
* {@link #relationalConverter(RelationalMappingContext, CustomConversions)}. Returns an empty
59+
* {@link #relationalConverter(RelationalMappingContext)}. Returns an empty
6160
* {@link JdbcCustomConversions} instance by default.
6261
*
6362
* @return must not be {@literal null}.

0 commit comments

Comments
 (0)