在使用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返回结果类型写错

Could not set property 'xxx' of 'class 'xxx' with value 'xxx'

property所对应的值 要和实体类的字段保持一致。

相关文章:

  • 2022-12-23
  • 2021-07-28
  • 2022-12-23
  • 2022-12-23
  • 2021-04-06
  • 2021-07-14
  • 2021-11-25
猜你喜欢
  • 2022-01-07
  • 2022-12-23
  • 2022-12-23
  • 2021-07-17
  • 2021-11-12
  • 2021-12-24
相关资源
相似解决方案