MyBatis3.4.0以上的分頁插件錯誤:Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.stateme


錯誤:

Could not find method on interface org.apache.ibatis.executor.statement.StatementHandler named prepare. Cause: java.lang.NoSuchMethodException: org.apache.ibatis.executor.statement.StatementHandler.prepare(java.sql.Connection)] with root cause

問題解決:

其實這個是版本更新之后,官方取消了這個函數,轉而升級了兩個參數的方法,改動如下:

@Intercepts({ @Signature(type = StatementHandler.class, method = "prepare", args = { Connection.class, Integer.class }) })

官方的解釋如下:

In 3.4.0, StatementHandler#prepare(Connection) has been changed to StatementHandler#prepare(Connection,Integer).

See https://github.com/mybatis/mybatis-3/blob/master/src/main/java/org/apache/ibatis/executor/statement/StatementHandler.java#L33-L34 .

參考:

https://github.com/mybatis/mybatis-3/issues/645


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM