8000 update 5.0.0 · coder-zhw/Mybatis-PageHelper@e7d5af0 · GitHub
[go: up one dir, main page]

Skip to content

Commit e7d5af0

Browse files
committed
update 5.0.0
1 parent 4cbb7fa commit e7d5af0

File tree

5 files changed

+82
-53
lines changed

5 files changed

+82
-53
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ If you are using Maven just add the following dependency to your pom.xml:
4343
<dependency>
4444
<groupId>com.github.pagehelper</groupId>
4545
<artifactId>pagehelper</artifactId>
46-
<version>5.0.0-rc</version>
46+
<version>5.0.0</version>
4747
</dependency>
4848
```
4949

README_zh.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
<dependency>
4242
<groupId>com.github.pagehelper</groupId>
4343
<artifactId>pagehelper</artifactId>
44-
<version>5.0.0-rc</version>
44+
<version>5.0.0</version>
4545
</dependency>
4646
```
4747

pom.xml

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

2929
<groupId>com.github.pagehelper</groupId>
3030
<artifactId>pagehelper</artifactId>
31-
<version>5.0.0-rc</version>
31+
<version>5.0.0</version>
3232
<packaging>jar</packaging>
3333

3434
<name>pagehelper 5</name>

wikis/en/Changelog.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,21 @@
1-
##Changelog
1+
## Changelog
22

3-
###5.0.0
3+
### 5.0.0 - 2017-01-02
44

5-
Release soon.
5+
- Use Use [QueryInterceptor spec](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/src/main/java/com/github/pagehelper/QueryInterceptor.java) to handle paging logic
6+
- New pagination plugin interceptor `com.github. A92E pagehelper.PageInterceptor`
7+
- New `Dialect` `PageHelper` is a special implementation class, the previous function is implemented in more user-friendly ways
8+
- New pagination plugin only a `dialect` parameter, the default `dialect` is `PageHelper`
9+
- `PageHelper` continue to support previously provided parameters, Among the latest to use the document has been fully updated
10+
- `PageHelper` has a `helperDialect` parameter which is the same functional as the previous `dialect`
11+
- Added paging implementation based on pure `RowBounds` and `PageRowBounds`,
12+
in `com.github. pagehelper. dialect. rowbounds` package, it is used as `dialect` Parameter sample implementation, more detailed documentation will be added later
13+
- Removed inappropriate orderby functions that appear in pagination plugin. It will provide a separate sort plug-ins in the future
14+
- Remove `PageHelper` are less commonly used methods
15+
- A new document, an important part of the update has been mentioned in the changelog, provides the English version of this document
16+
- fix bug [#149](http://git.oschina.net/free/Mybatis_PageHelper/issues/149)
17+
- renamed Db2RowDialect to Db2RowBoundsDialect
18+
- All thrown exceptions being replaced by PageException
619

7-
##Older Changelogs are written in Chinese
20+
## Older Changelogs are written in Chinese
821
You can [view here](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/Changelog.md)

wikis/zh/Changelog.md

Lines changed: 62 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,26 @@
1-
##更新日志
2-
3-
##4.2.1 - 2016-12-11
1+
## 更新日志
2+
3+
### 5.0.0 - 2017-01-02
4+
5+
- 使用 [QueryInterceptor 规范](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/src/main/java/com/github/pagehelper/QueryInterceptor.java) 处理分页逻辑
6+
- 新的分页插件拦截器为 `com.github.pagehelper.PageInterceptor`
7+
- 新的 `PageHelper` 是一个特殊的 `Dialect` 实现类,以更友好的方式实现了以前的功能
8+
- 新的分页插件仅有 `dialect` 一个参数,默认的 `dialect` 实现类为 `PageHelper`
9+
- `PageHelper` 仍然支持以前提供的参数,在最新的使用文档中已经全部更新
10+
- `PageHelper``helperDialect` 参数和以前的 `dialect` 功能一样,具体可以看文档的参数说明
11+
- 增加了基于纯 `RowBounds``PageRowBounds` 的分页实现,在 `com.github.pagehelper.dialect.rowbounds` 包中,这是用于作为 `dialect` 参数示例的实现,后面会补充更详细的文档
12+
- 去掉了不适合出现在分页插件中的 orderby 功能,以后会提供单独的排序插件
13+
- 去掉了 `PageHelper` 中不常用的方法
14+
- 新的文档,更新历来更新日志中提到的重要内容,提供英文版本文档
15+
- 解决 bug [#149](http://git.oschina.net/free/Mybatis_PageHelper/issues/149)
16+
- 将 Db2RowDialect 改为 Db2RowBoundsDialect
17+
- 所有分页插件抛出的异常改为 PageException
18+
19+
### 4.2.1 - 2016-12-11
420

521
- 解决`SimpleCache`类遗留问题导致的错误 [#143](http://git.oschina.net/free/Mybatis_PageHelper/issues/143) fix by [dhhua](https://github.com/dhhua)
622

7-
###4.2.0 - 2016-12-09
23+
### 4.2.0 - 2016-12-09
824

925
- 使用新的方式进行分页,4.2版本是从5.0版本分离出来的一个特殊版本,这个版本兼容4.x的所有功能,5.0版本时为了简化分页逻辑,会去掉部分功能,所以4.2是4.x的最后一个版本。
1026
- 支持 MyBatis 3.1.0+ 版本
@@ -19,45 +35,45 @@
1935
- 解决#135,增加/*keep orderby*/注解,SQL中包含该注释时,count查询时不会移出order by
2036
- sqlserver没有orderby时,使用`order by rand()` #82 #118
2137

22-
###4.1.6 - 2016-06-05
38+
### 4.1.6 - 2016-06-05
2339

2440
- 通过间接处理字符串解决SqlServer中不支持`with(nolock)`的问题#86,详情可以看`SqlServerParser``SqlServer2012Dialect`
2541

26-
###4.1.5 - 2016-05-29
42+
### 4.1.5 - 2016-05-29
2743

2844
- 更新`PageProviderSqlSource`,支持3.4.0版本的`Provider`注解方式的分页#102
2945
- 解决`SqlUtil`未初始化`PARAMS`属性导致的错误
3046

31-
###4.1.4 - 2016-05-12
47+
### 4.1.4 - 2016-05-12
3248

3349
- 解决`closeConn`未设置时,默认值被覆盖变成`false`的问题#97
3450
- `closeConn`不只对动态数据源有效,当没有设置`dialect`属性自动获取数据库类型的时候同样有效
3551
- 解决关闭tomcat的时候提示线程安全问题#98,这个问题不会导致内存溢出,已经增加处理
3652

37-
###4.1.3 - 2016-03-31
53+
### 4.1.3 - 2016-03-31
3854

3955
- 解决反射类没有完全捕获异常的问题#94
4056
- 把SqlServer类所有private都改成了protected,方便继承修改#93
4157

42-
###4.1.2 - 2016-03-06
58+
### 4.1.2 - 2016-03-06
4359

4460
- 增加可配参数`closeConn`,当使用动态数据源时,分页插件获取jdbcUrl后,控制是否关闭当前连接,默认`true`关闭
4561
- count查询改为`count(0)`,分库分表情况下的效率可能更高
4662

47-
###4.1.1 - 2016-01-05:
63+
### 4.1.1 - 2016-01-05:
4864

4965
- 解决动态数据源时获取连接后未关闭的严重bug#80
5066
- 解决动态数据源时SqlSource和parser绑定导致不能切换方言的问题
5167

52-
###4.1.0 - 2015-12-30:
68+
### 4.1.0 - 2015-12-30:
5369

5470
- 增加`autoRuntimeDialect`参数,允许在运行时根据多数据源自动识别对应方言的分页(暂时不支持自动选择`sqlserver2012`,只能使用`sqlserver`)。
5571
- 去掉了4.0.3版本增加的`returnPageInfo`参数,接口返回值不支持`PageInfo`类型,可以使用下面`ISelect`中演示的方法获取
5672
- 增加对`SqlServer2012`的支持,需要手动指定`dialect=sqlserver2012`,否则会使用2005的方式进行分页
5773
- jsqlparser升级到0.9.4版本,使用jar包时必须用最新的0.9.4版本,使用Maven会自动依赖0.9.4
5874
- 增加`ISelect`接口,方便调用,使用方法可以参考`src/test/java/com.github.pagehelper.test.basic.TestISelect`测试。
5975

60-
###使用该接口可以参考如下用法(返回值为`Page``PageInfo`):
76+
### 使用该接口可以参考如下用法(返回值为`Page``PageInfo`):
6177

6278
```java
6379
//jdk6,7用法,创建接口
@@ -93,13 +109,13 @@ long total = PageHelper.count(new ISelect() {
93109
total = PageHelper.count(()->countryMapper.selectLike(country));
94110
```
95111

96-
###4.0.3 - 2015-11-09:
112+
### 4.0.3 - 2015-11-09:
97113

98114
- `PageHelper`新增3个`offsetPage`方法,参数主要是`offset``limit`,允许不规则分页
99115

100116
- 新增两个可配参数`supportMethodsArguments``returnPageInfo`(该参数在4.1.0版本去掉),具体含义和用法请看[如何使用分页插件](https://github.com/pagehelper/Mybatis-PageHelper/blob/master/wikis/zh/HowToUse.md)中的参数介绍
101117

102-
###4.0.2 - 2015-11-02
118+
### 4.0.2 - 2015-11-02
103119

104120
- 简化`Page<E>`类,包含排序条件`orderBy`
105121

@@ -113,13 +129,13 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
113129

114130
- 该版本调整比较大,但对开发人员影响较小,为以后扩展和完善提供方便
115131

116-
###4.0.1 -2015-09-10
132+
### 4.0.1 -2015-09-10
117133

118134
- 解决[#60 -使用RPC时,因Page类引用了RowBounds,导致反序列化失败](http://git.oschina.net/free/Mybatis_PageHelper/issues/60) by [马金凯](http://git.oschina.net/mxb)
119135

120136
- 这个改动主要是去掉了`Page<E>`构造方法中的`RowBounds`,用`int[]`数组替换了`RowBounds`
121137

122-
###4.0.0 - 2015-07-13
138+
### 4.0.0 - 2015-07-13
123139

124140
- 配置属性`dialect`不在强制要求,可以不写,分页插件会自动判断
125141

@@ -135,19 +151,19 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
135151

136152
- 修改分页查询的处理逻辑,主要是将原`sqlSource`包装成可以分页和排序的`sqlSource`
137153

138-
###3.7.5 - 2015-06-12
154+
### 3.7.5 - 2015-06-12
139155

140156
- 增加对MyBatis3.2.0以上版本的校验,如果是不是3.2.0以上版本,会抛出异常提示
141157

142158
- 解决3.7.1更新中实际没有解决的入参为不可变`Map`类型时的错误
143159

144-
###3.7.4 - 2015-05-26
160+
### 3.7.4 - 2015-05-26
145161

146162
- 为了支持`3.3.0`去掉了分页插件自带的`SytemObjectMetaObject`类(该类在早期版本为了支持3.2.0以前的MyBatis)
147163

148164
- 最新支持MyBatis - 3.2.0到最新3.3.0版本
149165

150-
###3.7.3 - 2015-05-22
166+
### 3.7.3 - 2015-05-22
151167

152168
- `Page`继承的`ArrayList`,会根据`pageSize`初始化大小,这就导致当`pageSize`过大(如`Integer.MAX_VALUE`),实际数据量很小时的内存溢出,此处改为初始化大小为0的`List`
153169

@@ -157,16 +173,16 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
157173

158174
- 针对`RowBounds(0, Integer.MAX_VALUE)`优化,会取消分页,直接查询全部数据(能起到`pageSizeZero`参数所起的作用)。
159175

160-
###3.7.2 - 2015-05-13
176+
### 3.7.2 - 2015-05-13
161177

162178
- jsqlparser解析sql会抛出Error异常,由于只捕获Exception,所以导致部分解析失败的sql无法使用嵌套方式处理,所以修改为捕获`Throwable`
163179

164-
###3.7.1 - 2015-05-05
180+
### 3.7.1 - 2015-05-05
165181

166182
- 增加`Infomix`数据库支持,设置`dialect`值为`infomix`即可
167183
- 解决入参为不可变`Map`类型时的错误
168184

169-
###3.7.0 - 2015-04-21
185+
### 3.7.0 - 2015-04-21
170186

171187
- 由于`orderby`参数经常被错误认为的使用,因此该版本全面移除了`orderby`
172188
- `Page<E>`移除`orderby`属性
@@ -175,7 +191,7 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
175191
-`offsetAsPageNum=false`的时候,由于PageNum问题,`RowBounds`查询的时候`reasonable`会强制为false,已解决
176192
- 少数情况下的select中包含单个函数查询时,会使用嵌套的count查询
177193

178-
###3.6.4 - 2015-04-05
194+
### 3.6.4 - 2015-04-05
179195

180196
- 重构,将原来的内部类全部独立出来,尤其是`Parser`接口以及全部实现。
181197
现在可以直接使用`Parser`,使用方法如下:
@@ -194,23 +210,23 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
194210
pageSql = sqlServer.convertToPageSql(originalSql, 1, 10);
195211
```
196212

197-
###3.6.3 - 2015-03-10
213+
### 3.6.3 - 2015-03-10
198214

199215
- 解决了一个潜在的bug,对[通用Mapper](http://git.oschina.net/free/Mapper)中的`SqlMapper`进行分页时,需要使用这个版本
200216

201-
###3.6.2 - 2015-03-09
217+
### 3.6.2 - 2015-03-09
202218

203219
- 本次更新只是增加了一个异常提示,当错误的配置了多个分页插件时,会有更友好的错误提示:
204220

205221
>分页插件配置错误:请不要在系统中配置多个分页插件(使用Spring时,mybatis-config.xml和Spring<bean>配置方式,请选择其中一种,不要同时配置多个分页插件)!
206222
207-
###3.6.1 - 2015-02-28
223+
### 3.6.1 - 2015-02-28
208224

209225
- 解决select distinct导致count查询结果不正确的bug#35
210226

211227
- 完善测试
212228

213-
###3.6.0 - 2015-02-03
229+
### 3.6.0 - 2015-02-03
214230

215231
- 支持db2数据库
216232

@@ -235,13 +251,13 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
235251

236252
- `PageHelper`增加了`startPage(int pageNum, int pageSize,String orderBy)`方法(<b>3.7.0版本以后,移除了该方法</b>),针对sqlserver
237253

238-
###3.5.1 - 2015-01-20
254+
### 3.5.1 - 2015-01-20
239255

240256
- 解决[bug#25](http://git.oschina.net/free/Mybatis_PageHelper/issues/25),当参数是null并且是动态查询时,由于加入分页参数,导致参数不在是null,因而会导致部分判断出错,导致异常。
241257

242258
- 上面这个bug会影响使用了动态标签并且允许入参为null的所有查询,虽然并不常见,但是建议各位使用最新版本
243259

244-
###3.5.0 - 2015-01-11
260+
### 3.5.0 - 2015-01-11
245261

246262
- 增加更丰富的调用方法[#23](http://git.oschina.net/free/Mybatis_PageHelper/issues/23)
247263
- `startPage(int pageNum, int pageSize)`
@@ -256,7 +272,7 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
256272

257273
- 解决一个`<foreach>`标签使用对象内部属性循环时的bug[#24](http://git.oschina.net/free/Mybatis_PageHelper/issues/24)
258274

259-
###3.4.2 - 2014-12-27
275+
### 3.4.2 - 2014-12-27
260276

261277
- `PageInfo`中的`judgePageBoudary`方法修改:
262278
```java
@@ -265,29 +281,29 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
265281
isLastPage = pageNum == pages;
266282
```
267283

268-
###3.4.1 - 2014-12-24
284+
### 3.4.1 - 2014-12-24
269285

270286
- 重大bug修复,`SqlParser`解析sql失败的时候返回了不带`count(*)`的sql,导致查询失败。
271287

272288
- 产生原因,由于`SqlParser`在系统中出现的位置修改后,导致这里出现错误。
273289

274290
- 强烈推荐各位更新到最新版本。
275291

276-
###v3.4.0 - 2014-12-18
292+
### v3.4.0 - 2014-12-18
277293

278294
- 增加了对`@SelectProvider`注解方法的支持,不使用这种方式的不影响
279295

280296
- 对基本逻辑进行修改,减少反射调用和获取`BoundSql`次数
281297

282-
###v3.3.2 - 2014-12-10
298+
### v3.3.2 - 2014-12-10
283299

284300
- `PageInfo` 增加序列化。
285301

286-
###v3.3.1bug修复 - 2014-12-07
302+
### v3.3.1bug修复 - 2014-12-07
287303

288304
- 动态sql时,判断条件不会出现在ParameterMappings中,会导致获取不到属性。通常是因为判断条件中的属性没有出现在`#{}`中。
289305

290-
###v3.3.0
306+
### v3.3.0
291307

292308
1.`MappedStatement`对象进行缓存,包括count查询的`MappedStatement`以及分页查询的`MappedStatement`,分页查询改为预编译查询。
293309

@@ -301,7 +317,7 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
301317

302318
5. 增加对`PostgreSQL`,`MariaDB`,`SQLite`支持。其中`MariaDB`,`SQLite``Mysql`分页一样。
303319

304-
###v3.2.3
320+
### v3.2.3
305321

306322
1. 解决`mysql`带有`for update`时分页错误的问题。
307323

@@ -314,43 +330,43 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
314330
5. 为了便于本项目的统一管理和发布,本项目会和github上面同步,项目会改为Maven管理的结构。
315331

316332

317-
###v3.2.2
333+
### v3.2.2
318334

319335
1. 简单重构优化代码。
320336

321337
2. 新增`PageInfo`包装类,对分页结果Page<E>进行封装,方便EL使用。
322338

323339
3.`SystemMetaObject`类的`fromObject`方法内置到分页插件中,方便低版本的Mybatis使用该插件。
324340

325-
###v3.2.1
341+
### v3.2.1
326342

327343
1. 新增`offsetAsPageNum`参数,用来控制`RowBounds`中的`offset`是否作为`pageNum`使用,`pageNum``startPage`中的含义相同,`pageNum`是页码。该参数默认为`false`,使用默认值时,不需要配置该参数。
328344

329345
2. 新增`rowBoundsWithCount`参数,用来控制使用`RowBounds`时是否执行`count`查询。该参数默认为`false`,使用默认值时,不需要配置该参数。
330346

331-
###v3.2.0
347+
### v3.2.0
332348

333349
1. 增加了对`Hsqldb`的支持,主要目的是为了方便测试使用`Hsqldb`
334350

335351
2. 增加了该项目的一个测试项目[Mybatis-Sample](http://git.oschina.net/free/Mybatis-Sample),测试项目数据库使用`Hsqldb`
336352

337353
3. 增加MIT协议
338354

339-
###v3.1.2
355+
### v3.1.2
340356

341357
1. 解决count sql在`oracle`中的错误
342358

343-
###v3.1.1
359+
### v3.1.1
344360

345361
1. 统一返回值为`Page<E>`(可以直接按`List`使用),方便在页面使用EL表达式,如`${page.pageNum}`,`${page.total}`
346362

347-
###v3.1.0
363+
### v3.1.0
348364

349365
1. 解决了`RowBounds`分页的严重BUG,原先会在物理分页基础上进行内存分页导致严重错误,已修复
350366

351367
2. 增加对MySql的支持,该支持由[鲁家宁](http://my.oschina.net/lujianing)增加。
352368

353-
###v3.0
369+
### v3.0
354370

355371
1. 现在支持两种形式的分页,使用`PageHelper.startPage`方法或者使用`RowBounds`参数
356372

@@ -362,21 +378,21 @@ total = PageHelper.count(()->countryMapper.selectLike(country));
362378

363379
5. 关于两种形式的调用,请看示例代码
364380

365-
###v2.1
381+
### v2.1
366382

367383
1. 解决并发异常
368384

369385
2. 分页sql改为直接拼sql
370386

371-
###v2.0
387+
### v2.0
372388

373389
1. 支持Mybatis缓存,count和分页同时支持(二者同步)
374390

375391
2. 修改拦截器签名,拦截`Executor`
376392

377393
3.`Page<E>`类移到外面,方便调用
378394

379-
###v1.0
395+
### v1.0
380396

381397
1. 支持`<foreach>`等标签的分页查询
382398

0 commit comments

Comments
 (0)
0