mybatis分页插件pageHelper的startPage方法查询失效问题

pageHelper插件可在spring配置文件(方式一)或mybatis配置文件(方式二)中配置
方式一:
 1 <bean id="mybatisSqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
 2     <property name="dataSource" ref="dataSource"/>
 3     <property name="configLocation" value="classpath:mybatis-config.xml"/>
 4     <property name="plugins">
 5         <array>
 6             <bean class="com.github.pagehelper.PageInterceptor">
 7                 <property name="properties">
 8                     <!-- config params as the following -->
 9                     <value>
10                         dialect=com.github.pagehelper.dialect.helper.OracleDialect
11                     </value>
12                 </property>
13             </bean>
14         </array>
15     </property>
16 </bean>

方式二:
1 <configuration>
2     ...
3     <plugins>
4         <plugin interceptor="com.github.pagehelper.PageInterceptor">
5             <property name="supportMethodsArguments" value="true"/>
6         </plugin>
7     </plugins>
8 </configuration>

不解的是使用方式一的配置执行startPage静态方法时会查询出所有记录来,startPage方法是失效的;而采用方式二的配置则会正常。
目前使用方式二的配置回避了这个问题,但仍然疑惑……

转载于:https://www.cnblogs.com/qingwufeiyang/p/8471117.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值