1. 程式人生 > >Invalid bound statement (not found)

Invalid bound statement (not found)

core name 名稱 ron 解決方案 幫我 ret 不知道 type

想必這個問題在網上已經泛濫了,但是他們都是同一個答案,我來copy一下:

1.檢查xml文件所在package名稱是否和Mapper interface所在的包名

<mapper namespace="me.tspace.pm.dao.UserDao">

 mapper的namespace寫的不對!!!註意系修改。

2.UserDao的方法在UserDao.xml中沒有,然後執行UserDao的方法會報此

3. UserDao的方法返回值是List<User>,而select元素沒有正確配置ResultMap,或者只配置ResultType!

4. 如果你確認沒有以上問題,請任意修改下對應的xml文件,比如刪除一個空行,保存.問題解決

5.看下mapper的XML配置路徑是否正確

但是上面那些解決方案對於我遇到的 Invalid bound statement (not found) 錯誤並沒什麽用

經過幾天的反復嘗試,竟然發現就是這樣一行代碼導致的

sqlSessionFactoryBean.getObject().getConfiguration().setMapUnderscoreToCamelCase(true);

就是在配置sqlSessionFactoryBean的時候加了上面的一行代碼,使得總是報錯: Invalid bound statement (not found)

有哪位兄臺能幫我解釋一下嘛,目前還不知道原因,3Q!

Invalid bound statement (not found)