Could not set property 'id' of 'class com.shiyaxin.Bean.Account' with value '1' Cause: org.apache.ib

一时失言乱红尘 2024-04-18 22:56 183阅读 0赞

报错信息:

  1. ### Cause: org.apache.ibatis.reflection.ReflectionException: Could not set property 'id' of 'class com.shiyaxin.Bean.Account' with value '1' Cause: org.apache.ibatis.reflection.ReflectionException: There is no setter for property named 'id' in 'class com.shiyaxin.Bean.Account'

意为:

  1. 原因:org.apache.ibatis.reflectionReflectionException:无法设置com.shiyaxin.Bean类的属性“id”。Account' with value '1原因:org.apache.ibatis.reflectionReflectionException:在“com.shiyaxin.Bean.Account类”中没有为名为“id”的属性设置setter

mybatis里用的是反射关系。orm:对象关系映射
一般,数据库的字段跟表名的字段一定要一样
如果自定义的属性名,要配置对应的数据库列的名字,大小写一定保持一致
属性名是什么:就property=“属性名”
列名数据库一致,就column=“列名”

发表评论

表情:
评论列表 (有 0 条评论,183人围观)

还没有评论,来说两句吧...

相关阅读