MyBatis报错:There is no getter for property named 'class_id' in 'class XXX
2019-02-21 23:02
351 查看
今天在持久层查询数据库时遇到一个错误:There is no getter for property named 'class_id' in 'class XXX
[code] org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'class_id' in 'class com.xxx.yyy.zzz'
在网上搜了一下,好多都说
1. 在mapper文件注入参数的时候添加@Param注解
2. 或者把#{xxx}修改为#{_parameter};
反正经我本人测试没啥效果,而且把#{xxx}修改为#{_parameter}之后,系统报错又提示:There is no getter for property named '_parameter' in 'class XXX。。。。。。
个人解决办法:
好好检查一下对应的
xml
文件
检查相应字段在对应
entity实体类属性名称、
xml文件中resultMap定义的property、
sql语句column名称、
数据库column名称是否匹配!!!
这四个地方的定义是否一致。
吃一堑长一智,写代码一定要看仔细。。。
相关文章推荐
- MyBatisSystemException There is no getter for property named 'id' in 'class java.lang.String'
- Mybatis问题:There is no getter for property named 'Id' in 'class java.lang.String'
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
- mybatis出现There is no getter for property named 'Id' in 'class java.lang.Intege
- Mybatis-异常-There is no getter for property named 'VARCHAR' in 'class com.xxx.xxxxx
- Mybatis异常There is no getter for property named 'XXX' in 'class java.lang.String
- Mybatis There is no getter for property named 'XXX' in 'class java.lang.XXX
- MyBatis报错:There is no getter for property named 'xxx' in 'class java.lang.String'
- Mybatis-There is no getter for property named 'id' in 'class java.lang.String'
- 工单系列2 ---- MyBatis 报错 there is no getter for property named “xxx” in "class xxx"
- 解决mybatis异常:There is no getter for property named 'id' in 'class java.lang.Integer'
- mybatis 基本类型的if条件判断问题 There is no getter for property named 'xxx' in 'class Java.lang.Integer'
- Mybatis-There is no getter for property named 'id' in 'class java.lang.String'
- mybatis错误:There is no getter for property named 'xxx' in 'class java.lang.String'
- Mybatis找不到参数错误:There is no getter for property named 'categoryId' in 'class java.lang.Integer'。
- 关于Mybatis "There is no getter for property named 'XXX' in class java.lang.String"的问题
- Mybatis-There is no getter for property named 'XXX' in 'class java.lang.String'解决办法
- 解决mybatis异常:There is no getter for property named 'id' in 'class java.lang.Integer'
- mybatis:There is no getter for property named 'xxx' in 'class java.lang.String'
- mybatis String的if条件判断问题 There is no getter for property named 'xxx' in 'class Java.lang.Integer'