10000 升级分页插件 5.0.0 · coderhxt/Mybatis-Spring@95a3676 · GitHub
[go: up one dir, main page]

Skip to content

Commit 95a3676

Browse files
committed
升级分页插件 5.0.0
1 parent cacaf8a commit 95a3676

File tree

3 files changed

+35
-3
lines changed

3 files changed

+35
-3
lines changed

README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,38 @@
1010

1111
项目使用的mysql数据库,根据需要可以切换为其他数据库
1212

13+
集成分页插件 5.0.0 版本,注意配置变化:
14+
```xml
15+
<bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
16+
<property name="dataSource" ref="dataSource"/>
17+
<property name="mapperLocations">
18+
<array>
19+
<value>classpath:mapper/*.xml</value>
20+
</array>
21+
</property>
22+
<property name="typeAliasesPackage" value="com.isea533.mybatis.model"/>
23+
<property name="plugins">
24+
<array>
25+
<bean class="com.github.pagehelper.PageInterceptor">
26+
<!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 -->
27+
<property name="properties">
28+
<value>
29+
helperDialect=mysql
30+
reasonable=true
31+
supportMethodsArguments=true
32+
params=count=countSql
33+
autoRuntimeDialect=true
34+
</value>
35+
</property>
36+
</bean>
37+
</array>
38+
</property>
39+
</bean>
40+
```
41+
- 拦截器 `com.github.pagehelper.PageInterceptor`
42+
- 原来的 `dialect` 变成了 `helperDialect`,这是基于 PageHelper 方式的分页
43+
- 具体变化看文档
44+
1345
##Spring Boot集成MyBatis的基础项目
1446

1547
###https://github.com/abel533/MyBatis-Spring-Boot

pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<!-- 依赖版本 -->
2525
<mybatis.version>3.3.1</mybatis.version>
2626
<mapper.version>3.3.6</mapper.version>
27-
<pagehelper.version>4.2.1</pagehelper.version>
27+
<pagehelper.version>5.0.0</pagehelper.version>
2828
<mysql.version>5.1.29</mysql.version>
2929
<spring.version>4.1.2.RELEASE</spring.version>
3030
<mybatis.spring.version>1.2.4</mybatis.spring.version>

src/main/resources/applicationContext.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,11 +73,11 @@
7373
<property name="typeAliasesPackage" value="com.isea533.mybatis.model"/>
7474
<property name="plugins">
7575
<array>
76-
<bean class="com.github.pagehelper.PageHelper">
76+
<bean class="com.github.pagehelper.PageInterceptor">
7777
<!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 -->
7878
<property name="properties">
7979
<value>
80-
dialect=mysql
80+
helperDialect=mysql
8181
reasonable=true
8282
supportMethodsArguments=true
8383
params=count=countSql

0 commit comments

Comments
 (0)
0