mybatis配置pagehelper分页插件

一早搭建项目,发现这个分页插件一直出错,查了下资料发现,新版本有一点不一样。
com.github.pagehelper.PageHelper cannot be cast to org.apache.ibatis.plugin.Interceptor

pom引入

    
      com.github.pagehelper
      pagehelper
      5.2.0
    

然后mybatis配置文件,新版的

    
    
        
            
            
        
    

旧版的预计是5.0一下的


    
        
                
        
    

查询前使用

  PageHelper.startPage(1, 2);

OK记录一下以防忘记了

你可能感兴趣的:(mybatis配置pagehelper分页插件)