Skip to content

Commit

Permalink
Example.Builder 增加类似 Weekend 中 Java8 方法引用的用法,该功能由 [chinaerserver](h…
Browse files Browse the repository at this point in the history
  • Loading branch information
abel533 committed Jan 22, 2018
1 parent 4f410bd commit 7afd35d
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions wiki/Changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,29 @@ DEBUG [main] - <== Updates: 1

#### 3. `SimpleTypeUtil` 增加对 java8 中的日期类型的支持。

#### 4. `Example.Builder` 增加类似 `Weekend` 中 Java8 方法引用的用法,该功能由 [chinaerserver](https://github.com/chinaerserver) 提交([#pr207](https://github.com/abel533/Mapper/pull/207))

示例如下:
```java
@Test
public void testWeekend() {
SqlSession sqlSession = MybatisHelper.getSqlSession();
try {
CountryMapper mapper = sqlSession.getMapper(CountryMapper.class);
//普通方式
List<Country> selectByExample = mapper.selectByExample(
new Example.Builder(Country.class).where(Sqls.custom().andLike("countryname", "China")).build());
//Java8 方式
List<Country> selectByWeekendSql = mapper.selectByExample(new Example.Builder(Country.class)
.where(WeekendSqls.<Country>custom().andLike(Country::getCountryname, "China")).build());
// 判断两个结果数组内容是否相同
Assert.assertArrayEquals(selectByExample.toArray(), selectByWeekendSql.toArray());
} finally {
sqlSession.close();
}
}
```

## 3.5.0 - 2018-01-08

- 兼容 mbg 1.3.6 版本。
Expand Down

0 comments on commit 7afd35d

Please sign in to comment.