Mybatis錯誤(一)org.apache.ibatis.exceptions.PersistenceException


在映射文件中,通過parameterType指定輸入參數的類型,類型可以是簡單類型、hashmappojo的包裝類型。在測試包裝類型過程中產生了一個錯誤:org.apache.ibatis.exceptions.PersistenceException、錯誤如下。

 

 

映射文件如下:

 

我們來看着錯誤提示:There is no getter for property named 'UserCustom' in 'class com.murongtech.mybatis.domain.UserQueryVo'  大致意思是在UserQueryVo類中屬性UserCustom 沒有相應的get方法。這里就是問題的所在了,我在SQL中使用#{UserCustom.sex},而我在UserQueryVo定義的屬性是小寫開頭的userCustom。所以換成小寫,問題就解決了。

 


免責聲明!

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



猜您在找 HTTP Status 500 - org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: [mybatis]org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. 異常解決 錯誤信息: Request processing failed; nested exception is org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.PersistenceException: 使用Mybatis連接數據庫時報錯:org.apache.ibatis.exceptions.PersistenceException: ### Error updating database. org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: com.mysql.jdbc.exceptions.jdbc4.CommunicationsException: Communications link failure The last packet sent succ org.apache.ibatis.exceptions.PersistenceException: ### Error querying database. Cause: java.sql.SQLException: The server time zone value 'Öйú±ê׼ʱ¼ä' is unrecognized or represents mor org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 3 org.apache.ibatis.exceptions.TooManyResultsException的異常排查過程 org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.exceptions.TooManyResultsException: Expected one result (or null) to be returned by selectOne(), but found: 2 at org.m mybatis錯誤之org.apache.ibatis.binding.BindingException: Invalid bound statement (not found)
 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM