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、分页的执行是串行的,可以考虑并行。

  • 相关阅读:
    shell 时间循环
    t
    IntelliJ IDEA For Mac 快捷键
    JVM的默认参数
    qt不同模块使用多语言
    cocos2dx 实现gpu instancing
    so so.*.*
    Android开发-解决 AIDL 中找不到couldn't find import for class错误
    Android Watchdog源码简析--Based on Android 6.0.1
    View绘制流程--Based on kitkat
  • 原文地址:https://www.cnblogs.com/zhjh256/p/9941012.html
Copyright © 2011-2022 走看看