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
Copy file name to clipboardExpand all lines: src/site/markdown/docs/mybatis3.md
+63-7Lines changed: 63 additions & 7 deletions
Original file line number
Diff line number
Diff line change
@@ -1,9 +1,68 @@
1
1
# Specialized Support for MyBatis3
2
-
Most of the examples shown on this site are for usage with MyBatis3. But the library does have some additional support for MyBatis3 beyond what is shown in the other examples.
2
+
Most of the examples shown on this site are for usage with MyBatis3 - even though the library does support other SQL runtimes like Spring JDBC templates. But the library does have some additional specialized support for MyBatis3 beyond what is shown in the other examples.
3
3
4
4
This support is added to the DELETE, SELECT, and UPDATE statement generators and enables the creating of reusable "by example" methods as delivered in MyBatis Generator. These methods can provide some boilerplate code for the setup of the statement (a column list and table name for example), and allow the user to specify a where clause.
5
5
6
-
For example, it is possible to write a mapper like this:
6
+
With version 1.1.3, specialized interfaces were added that can further simplify client code.
7
+
8
+
For example, it is possible to write a mapper interface like this:
Notice the `selectByExample` method - it specifies the column list and table name and accepts a lambda expression that can be used to build the WHERE clause. It also reuses the `selectMany` mapper method.
0 commit comments