21
21
22
22
/**
23
23
* A rendering strategy is used to generate a platform specific binding.
24
- * <p>
25
- * Rendering strategies are used during the rendering phase of statement generation.
24
+ *
25
+ * <p> Rendering strategies are used during the rendering phase of statement generation.
26
26
* All generated SQL statements include the generated statement itself, and a map of parameters that
27
27
* should be bound to the statement at execution time. For example, a generated select statement may
28
28
* look like this when rendered for MyBatis:
29
- * <p>
30
- * <code>select foo from bar where id = #{parameters.p1,jdbcType=INTEGER}</code>
31
- * <p>
32
- * In this case, the binding is <code>#{parameters.p1,jdbcType=INTEGER}</code>. MyBatis knows how to interpret this
29
+ *
30
+ * <p>< code>select foo from bar where id = #{parameters.p1,jdbcType=INTEGER}</code>
31
+ *
32
+ * <p> In this case, the binding is <code>#{parameters.p1,jdbcType=INTEGER}</code>. MyBatis knows how to interpret this
33
33
* binding - it will look for a value in the <code>parameters.p1</code> property of the parameter object
34
34
* passed to the statement and bind it as a prepared statement parameter when executing the statement.
35
35
*/
@@ -42,61 +42,62 @@ public String formatParameterMapKey(AtomicInteger sequence) {
42
42
43
43
/**
44
44
* This method generates a binding for a parameter to a placeholder in a generated SQL statement.
45
- * <p>
46
- * This binding is appropriate when there can be a mapping between a parameter and a known target column,
45
+ *
46
+ * <p> This binding is appropriate when there can be a mapping between a parameter and a known target column,
47
47
* In MyBatis, the binding can specify type information based on the column. The bindings are specific
48
48
* to the target framework.
49
- * <p>
50
- * For MyBatis, a binding looks like this: "#{prefix.parameterName,jdbcType=xxx,typeHandler=xxx,javaType=xxx}"
51
- * <p>
52
- * For Spring, a binding looks like this: ":parameterName"
49
+ *
50
+ * <p> For MyBatis, a binding looks like this: "#{prefix.parameterName,jdbcType=xxx,typeHandler=xxx,javaType=xxx}"
51
+ *
52
+ * <p> For Spring, a binding looks like this: ":parameterName"
53
53
*
54
54
* @param column column definition used for generating type details in a MyBatis binding. Ignored for Spring.
55
55
* @param prefix parameter prefix used for locating the parameters in a SQL provider object. Typically, will be
56
56
* {@link RenderingStrategy#DEFAULT_PARAMETER_PREFIX}. This is ignored for Spring.
57
57
* @param parameterName name of the parameter. Typically generated by calling
58
- * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
58
+ * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
59
59
* @return the generated binding
60
60
*/
61
61
public abstract String getFormattedJdbcPlaceholder (BindableColumn <?> column , String prefix , String parameterName );
62
62
63
63
/**
64
64
* This method generates a binding for a parameter to a placeholder in a generated SQL statement.
65
- * <p>
66
- * This binding is appropriate when the parameter is bound to placeholder that is not a known column (such as
65
+ *
66
+ * <p> This binding is appropriate when the parameter is bound to placeholder that is not a known column (such as
67
67
* a limit or offset parameter). The bindings are specific to the target framework.
68
- * <p>
69
- * For MyBatis, a binding looks like this: "#{prefix.parameterName}"
70
- * <p>
71
- * For Spring, a binding looks like this: ":parameterName"
68
+ *
69
+ * <p> For MyBatis, a binding looks like this: "#{prefix.parameterName}"
70
+ *
71
+ * <p> For Spring, a binding looks like this: ":parameterName"
72
72
*
73
73
* @param prefix parameter prefix used for locating the parameters in a SQL provider object. Typically, will be
74
74
* {@link RenderingStrategy#DEFAULT_PARAMETER_PREFIX}. This is ignored for Spring.
75
75
* @param parameterName name of the parameter. Typically generated by calling
76
- * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
76
+ * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
77
77
* @return the generated binding
78
78
*/
79
79
public abstract String getFormattedJdbcPlaceholder (String prefix , String parameterName );
80
80
81
81
/**
82
- * This method generates a binding for a parameter to a placeholder in a generated multirow insert statement.
83
- * <p>
84
- * This binding is specifically for use with a multirow insert. The Spring implementation changes the binding
85
- * to match values expected for a multirow insert statement. For MyBatis, the binding is the same
82
+ * This method generates a binding for a parameter to a placeholder in a record based insert statement.
83
+ *
84
+ * <p>This binding is specifically for use with insert, batch insert, and multirow insert statements.
85
+ * These statements bind parameters to properties of a row class. The Spring implementation changes the binding
86
+ * to match values expected for a these insert statements. For MyBatis, the binding is the same
86
87
* as {@link RenderingStrategy#getFormattedJdbcPlaceholder(BindableColumn, String, String)}.
87
- * <p>
88
- * For MyBatis, a binding looks like this: "#{prefix.parameterName,jdbcType=xxx,typeHandler=xxx,javaType=xxx}"
89
- * <p>
90
- * For Spring, a binding looks like this: ":prefix.parameterName"
88
+ *
89
+ * <p> For MyBatis, a binding looks like this: "#{prefix.parameterName,jdbcType=xxx,typeHandler=xxx,javaType=xxx}"
90
+ *
91
+ * <p> For Spring, a binding looks like this: ":prefix.parameterName"
91
92
*
92
93
* @param column column definition used for generating type details in a MyBatis binding. Ignored for Spring.
93
94
* @param prefix parameter prefix used for locating the parameters in a SQL provider object. Typically, will be
94
- * {@link RenderingStrategy#DEFAULT_PARAMETER_PREFIX}. This is ignored for Spring.
95
+ * {@link RenderingStrategy#DEFAULT_PARAMETER_PREFIX}. This is ignored for Spring.
95
96
* @param parameterName name of the parameter. Typically generated by calling
96
- * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
97
+ * {@link RenderingStrategy#formatParameterMapKey(AtomicInteger)}
97
98
* @return the generated binding
98
99
*/
99
- public String getMultiRowFormattedJdbcPlaceholder (BindableColumn <?> column , String prefix , String parameterName ) {
100
+ public String getRecordBasedInsertBinding (BindableColumn <?> column , String prefix , String parameterName ) {
100
101
return getFormattedJdbcPlaceholder (column , prefix , parameterName );
101
102
}
102
103
}
0 commit comments