赞
踩
用@bean注入时,以及在双数据源配置那里,配置 PageHelper 分页都是没用的。
1、双数据源如果不这样配置分页,会出现这样的问题,例如:第一次用mysql分页,以后mysql分页都不会有问题,但如果再用oracle来分页,就会出现问题。
sql语句会在oracle最后面拼接上limit,但oracle没有limit,所以会报错。
配置文件:
pagehelper:
#如果确认数据库类型,可以填写,如不能确认,按照最后两项配置来,自动适应数据库
#helperDialect: mysql
reasonable: true
supportMethodsArguments: true
params: count=countSql
pagehelper.auto-dialect: true
pagehelper.auto-runtime-dialect: true
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。