File tree Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Expand file tree Collapse file tree 3 files changed +40
-4
lines changed Original file line number Diff line number Diff line change 10
10
11
11
项目使用的hsqldb内存数据库,根据需要可以切换为其他支持的数据库
12
12
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
+
13
45
##MyBatis工具
14
46
15
47
###http://www.mybatis.tk
Original file line number Diff line number Diff line change 14
14
<targetProject >${basedir}/src/main/java</targetProject >
15
15
<!-- 依赖版本 -->
16
16
<mybatis .version>3.3.0</mybatis .version>
17
- <mapper .version>3.3.0 </mapper .version>
18
- <pagehelper .version>4 .0.3 </pagehelper .version>
17
+ <mapper .version>3.3.9 </mapper .version>
18
+ <pagehelper .version>5 .0.0 </pagehelper .version>
19
19
<spring .version>3.2.12.RELEASE</spring .version>
20
20
</properties >
21
21
Original file line number Diff line number Diff line change 34
34
<property name =" typeAliasesPackage" value =" com.isea533.mybatis.model" />
35
35
<property name =" plugins" >
36
36
<array >
37
- <bean class =" com.github.pagehelper.PageHelper" >
37
+ <bean class =" com.github.pagehelper.PageInterceptor" >
38
+ <!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 -->
38
39
<property name =" properties" >
39
40
<value >
40
- dialect=hsqldb
41
+ helperDialect=mysql
41
42
reasonable=true
43
+ supportMethodsArguments=true
44
+ params=count=countSql
45
+ autoRuntimeDialect=true
42
46
</value >
43
47
</property >
44
48
</bean >
You can’t perform that action at this time.
0 commit comments