Skip to content

Commit 0ec57fb

Browse files
committed
发布 3.4.6 版本
1 parent 5b5907d commit 0ec57fb

File tree

2 files changed

+32
-2
lines changed

2 files changed

+32
-2
lines changed

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<groupId>tk.mybatis</groupId>
3030
<artifactId>mapper</artifactId>
31-
<version>3.4.6-SNAPSHOT</version>
31+
<version>3.4.6</version>
3232
<packaging>jar</packaging>
3333

3434
<name>mapper</name>

wiki/Changelog.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
11
# 更新日志
22

3-
## 3.4.6-SNAPSHOT
3+
## 3.4.6
44

5+
- `Example` 新增 builder 模式(by [Ngone51](https://github.com/abel533/Mapper/commits?author=Ngone51))。
56
- 设置下划线风格替换为驼峰风格的Pattern为StringUtil的静态变量(by [Ngone51](https://github.com/abel533/Mapper/commits?author=Ngone51))。
67

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) 了解。
737

838
## 3.4.5 - 2017-11-11
939

0 commit comments

Comments
 (0)