You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
|`org.mybatis.dynamic.sql.BasicColumn`| Use this interface if you want to add capabilities to a SELECT list or a GROUP BY expression. For example, creating a calculated column. |
17
-
|`org.mybatis.dynamic.sql.BindableColumn`| Use this interface if you want to add capabilities to a WHERE clause. For example, creating a custom condition. |
|`org.mybatis.dynamic.sql.BasicColumn`| Use this interface if you want to add capabilities to a SELECT list or a GROUP BY expression. For example, using a database function. |
17
+
|`org.mybatis.dynamic.sql.BindableColumn`| Use this interface if you want to add capabilities to a WHERE clause. For example, creating a custom condition. |
18
+
19
+
Rendering is the process of generating an appropriate SQL fragment to implement the function or calculated column.
20
+
The library will call a method `render(RenderingContext)` in your implementation. This method should return an
21
+
instance of `FragmentAndParameters` containing your desired SQL fragment and any bind parameters needed. Bind
22
+
parameter markers can be calculated by calling the `RenderingContext.calculateParameterInfo()` method. That method will
23
+
return a properly formatted bind marker for the SQL string, and a matching Map key you should use in your parameter map.
24
+
In general, you do not need to worry about adding spacing, commas, etc. before or after your fragment - the library
25
+
will properly format the final statement from all the different fragments.
18
26
19
27
See the following sections for examples.
20
28
@@ -166,6 +174,37 @@ public class Upper extends AbstractUniTypeFunction<String, Upper> {
166
174
}
167
175
```
168
176
177
+
Note that `FragmentAndParameters` has a utility method that can simplify the implementation if you do not need to
178
+
add any new parameters to the resulting fragment. For example, the UPPER function can be simplified as follows:
0 commit comments