项目使用Spring4.1.2.RELEASE + SpringMVC4.1.2.RELEASE + Mybatis3.3.0
项目集成了Mybatis分页插件和通用Mapper插件
项目使用的mysql数据库,根据需要可以切换为其他数据库
集成分页插件 5.0.0 版本,注意配置变化:
<beanid="sqlSessionFactory"class="org.mybatis.spring.SqlSessionFactoryBean">
<propertyname="dataSource"ref="dataSource"/>
<propertyname="mapperLocations">
<array>
<value>classpath:mapper/*.xml</value>
</array>
</property>
<propertyname="typeAliasesPackage"value="com.isea533.mybatis.model"/>
<propertyname="plugins">
<array>
<beanclass="com.github.pagehelper.PageInterceptor">
<!-- 这里的几个配置主要演示如何使用,如果不理解,一定要去掉下面的配置 -->
<propertyname="properties">
<value>
helperDialect=mysql
reasonable=true
supportMethodsArguments=true
params=count=countSql
autoRuntimeDialect=true
</value>
</property>
</bean>
</array>
</property>
</bean>- 拦截器
com.github.pagehelper.PageInterceptor - 原来的
dialect变成了helperDialect,这是基于 PageHelper 方式的分页 - 具体变化看文档
CSDN博客:http://blog.csdn.net/isea533/article/details/73555400
GitHub项目:https://github.com/mybatis-book/book
作者邮箱:abel533@gmail.com
如需加群,请通过 http://mybatis.tk 首页按钮加群。
