在使用mybatis框架進行后台數據查詢時,控制台報Could not set property 'xxx' of 'class 'xxx' with value 'xxx',看到數據已經查出來了,但是轉為實體類型時出錯了。本人的報錯信息附上:
Could not set property 'accoutId' of 'class com.vg.entity.Account' with value '4' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'accoutId' in 'class com.vg.entity.Account'
主要原因:
resultMap返回結果類型寫錯
property所對應的值 要和實體類的字段保持一致。