File tree Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Expand file tree Collapse file tree 2 files changed +32
-2
lines changed Original file line number Diff line number Diff line change 28
28
29
29
<groupId >tk.mybatis</groupId >
30
30
<artifactId >mapper</artifactId >
31
- <version >3.4.6-SNAPSHOT </version >
31
+ <version >3.4.6</version >
32
32
<packaging >jar</packaging >
33
33
34
34
<name >mapper</name >
Original file line number Diff line number Diff line change 1
1
# 更新日志
2
2
3
- ## 3.4.6-SNAPSHOT
3
+ ## 3.4.6
4
4
5
+ - ` Example ` 新增 builder 模式(by [ Ngone51] ( https://github.com/abel533/Mapper/commits?author=Ngone51 ) )。
5
6
- 设置下划线风格替换为驼峰风格的Pattern为StringUtil的静态变量(by [ Ngone51] ( https://github.com/abel533/Mapper/commits?author=Ngone51 ) )。
6
7
8
+ 一个简单的 builder 用法示例:
9
+ ``` java
10
+ /*
11
+ * @description: 多个where连接的查询语句测试
12
+ *
13
+ */
14
+ @Test
15
+ public void testWhereAndWhereCompound() {
16
+ SqlSession sqlSession = MybatisHelper . getSqlSession();
17
+ try {
18
+ CountryMapper mapper = sqlSession. getMapper(CountryMapper . class);
19
+ Example example = Example . builder(Country . class)
20
+ .where(Sqls . custom()
21
+ .andEqualTo(" countryname" , " China" )
22
+ .andEqualTo(" id" , 35 )
23
+ )
24
+ .andWhere(Sqls . custom()
25
+ .andEqualTo(" id" , 183 )
26
+ )
27
+ .build();
28
+ List<Country > countries = mapper. selectByExample(example);
29
+ Assert . assertEquals(0 , countries. size());
30
+
31
+ } finally {
32
+ sqlSession. close();
33
+ }
34
+ }
35
+ ```
36
+ 更多用法可以通过测试 [ ` TestExampleBuilder ` ] ( https://github.com/abel533/Mapper/blob/master/src/test/java/tk/mybatis/mapper/test/example/TestExampleBuilder.java ) 了解。
7
37
8
38
## 3.4.5 - 2017-11-11
9
39
You can’t perform that action at this time.
0 commit comments