Mybatis报错:nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ not found
生活随笔
收集整理的這篇文章主要介紹了
Mybatis报错:nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ not found
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
問題
使用Mybatis過程中報錯
nested exception is org.apache.ibatis.binding.BindingException: Parameter 'XXX' not found原因
mapper.xml映射沒有得到傳入的參數,當 SQL語句中只有一個參數時,mybatis可以正確傳參,而如果由多個參數,需要在Dao接口上加上@Param("參數名") 否則會導致無法傳參,報找不到參數的異常。
解決
Dao接口錯誤代碼(報找不到參數的異常):
void removeOperator(String operatorId, String companyId);正確代碼:
void removeOperator(@Param("operatorId")String operatorId, @Param("companyId")String companyId);參考:
nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX’ not found報錯
總結
以上是生活随笔為你收集整理的Mybatis报错:nested exception is org.apache.ibatis.binding.BindingException: Parameter ‘XXX‘ not found的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 金蝶kis专业版打印核算科目(金蝶kis
- 下一篇: dv数码摄像机(dv数码摄像机永久删除软