在使用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所对应的值 要和实体类的字段保持一致。