zoukankan      html  css  js  c++  java
  • pagehelper调用mybatis报错java.lang.NoSuchMethodError:org.apache.ibatis.reflection.MetaObject.forObject

    最近在升新的基础框架到spring cloud,启动时pagehelper报错,如下:

    java.lang.NoSuchMethodError:org.apache.ibatis.reflection.MetaObject.forObject(Ljava/lang/Object;Lorg/apache/ibatis/reflection/factory/ObjectFactory;Lorg/apache/ibatis/reflection/wrapper/ObjectWrapperFactory;)Lorg/apache/ibatis/reflection/MetaObject;

           atcom.github.pagehelper.SqlUtil.forObject(SqlUtil.java:78)

           atcom.github.pagehelper.SqlUtil.getsqlSource(SqlUtil.java:521)

           atcom.github.pagehelper.SqlUtil.getMappedStatement(SqlUtil.java:444)

           atcom.github.pagehelper.SqlUtil.processCountMappedStatement(SqlUtil.java:143)

           atcom.github.pagehelper.PageHelper.intercept(PageHelper.java:140)

           atorg.apache.ibatis.plugin.Plugin.invoke(Plugin.java:61)
    经查是pagehelper版本太高,自动引入的是5.x的,将为4.1.8之后,问题解决。

    pagehelper的几个要点:

    1、pagehelper真正改写sql是在最后getBoundSql的时候,而不是提前注入值。

    2、采用的是jsqlparser解析器,它比druid sql弱得多,不过因为是最简单的解析,问题不是很大。

    3、分页的执行是串行的,可以考虑并行。

  • 相关阅读:
    布局-float-margin-padding
    乡镇投票笔记
    Ajax实战
    Form,tagName和nodeName的区别
    Form,选择并转移导航菜单
    如何在ajax请求中设置特殊的RequestHeader
    nginx配置转发详解
    利用循环遍历的方式判断某个对象是否属于这个数组
    几个原生js方法总结
    chrome JS关闭当前页无效问题
  • 原文地址:https://www.cnblogs.com/zhjh256/p/9941012.html
Copyright © 2011-2022 走看看