使用mybatis的分页插件报错:PageHelper-com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor


问题:在使用mybatis分页插件的时候,出现以下错误:

PageHelper-com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor

问题原因:在mybatis中添加插件时,interceptor属性指定的类与版本不匹配

(1)分页插件版本为4时:

 

1 interceptor="com.github.pagehelper.PageHelper"

(2)分页插件版本为5时:

1 interceptor="com.github.pagehelper.PageInterceptor"

 

参考博客:https://blog.csdn.net/sinat_34104446/article/details/92679046


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM