File tree Expand file tree Collapse file tree 1 file changed +9
-1
lines changed
src/main/java/org/mybatis/dynamic/sql Expand file tree Collapse file tree 1 file changed +9
-1
lines changed Original file line number Diff line number Diff line change 20
20
* during statement rendering before the parameter is placed into the parameter map. This can be used
21
21
* to somewhat mimic the function of a MyBatis type handler for runtimes such as Spring that don't have
22
22
* a corresponding concept.
23
+ *
24
+ * <p>Since Spring does not have the concept of type handlers, it is a best practice to only use
25
+ * Java data types that have a clear correlation to SQL data types (for example Java String correlates
26
+ * automatically with VARCHAR). Using a parameter type converter will allow you to use data types in your
27
+ * model classes that would otherwise be difficult to use with Spring.
23
28
*
24
29
* <p>A parameter type converter is associated with a SqlColumn.
25
30
*
26
31
* <p>A parameter type converter is compatible with Spring's general Converter interface so existing converters
27
- * can be reused here if they are marked with this additional interface.
32
+ * can be reused here if they are marked with this additional interface. The return type is always Object as the
33
+ * converter is called immediately before a value is placed into a parameter Map and there is no longer any need for
34
+ * the actual target type. Having a fixed return type removes quite a few generic hurdles.
28
35
*
29
36
* <p>The converter is only used for parameters - it is not used for result set processing. The converter will be
30
37
* called in the following circumstances:
39
46
*
40
47
* @see SqlColumn
41
48
* @author Jeff Butler
49
+ * @since 1.1.5
42
50
*/
43
51
@ FunctionalInterface
44
52
public interface ParameterTypeConverter <S > {
You can’t perform that action at this time.
0 commit comments