20
20
import org .springframework .context .annotation .Bean ;
21
21
import org .springframework .context .annotation .Configuration ;
22
22
import org .springframework .core .convert .converter .Converter ;
23
- import org .springframework .data .convert .CustomConversions ;
24
23
import org .springframework .data .jdbc .core .convert .JdbcCustomConversions ;
25
24
import org .springframework .data .relational .core .conversion .BasicRelationalConverter ;
26
25
import org .springframework .data .relational .core .conversion .RelationalConverter ;
34
33
* @author Jens Schauder
35
34
* @author Mark Paluch
36
35
* @author Michael Simons
36
+ * @author Christoph Strobl
37
37
*/
38
38
@ Configuration
39
39
public class JdbcConfiguration {
40
40
41
+ /**
42
+ * Register a {@link RelationalMappingContext} and apply an optional {@link NamingStrategy}.
43
+ *
44
+ * @param namingStrategy optional {@link NamingStrategy}. Use {@link NamingStrategy#INSTANCE} as fallback.
45
+ * @return must not be {@literal null}.
46
+ */
41
47
@ Bean
42
48
protected RelationalMappingContext jdbcMappingContext (Optional <NamingStrategy > namingStrategy ) {
43
49
@@ -48,16 +54,23 @@ protected RelationalMappingContext jdbcMappingContext(Optional<NamingStrategy> n
48
54
return mappingContext ;
49
55
}
50
56
57
+ /**
58
+ * Creates a {@link RelationalConverter} using the configured {@link #jdbcMappingContext(Optional)}. Will get
59
+ * {@link #jdbcCustomConversions()} applied.
60
+ *
61
+ * @see #jdbcMappingContext(Optional)
62
+ * @see #jdbcCustomConversions()
63
+ * @return must not be {@literal null}.
64
+ */
51
65
@ Bean
52
66
protected RelationalConverter relationalConverter (RelationalMappingContext mappingContext ) {
53
67
return new BasicRelationalConverter (mappingContext , jdbcCustomConversions ());
54
68
}
55
69
56
70
/**
57
- * Register custom {@link Converter}s in a {@link CustomConversions} object if required. These
58
- * {@link CustomConversions} will be registered with the
59
- * {@link #relationalConverter(RelationalMappingContext)}. Returns an empty
60
- * {@link JdbcCustomConversions} instance by default.
71
+ * Register custom {@link Converter}s in a {@link JdbcCustomConversions} object if required. These
72
+ * {@link JdbcCustomConversions} will be registered with the {@link #relationalConverter(RelationalMappingContext)}.
73
+ * Returns an empty {@link JdbcCustomConversions} instance by default.
61
74
*
62
75
* @return must not be {@literal null}.
63
76
*/
0 commit comments