欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

There is no getter for property named 'xxx' in 'class com.ams.ams.entity.xxx'

程序员文章站 2022-07-15 13:45:48
...

这个问题困扰我很久
用springboot和mybtis自动生成代码的时候,编译的insert有时会出现

There was an unexpected error (type=Internal Server Error, status=500).
nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named '_deptName' in 'class com.ams.ams.entity.Depart'

网上很多方法是针对

There is no getter for property named '_deptName' in string

要解决类的问题,我们需要将类中的属性全部做一个替换,一般来说是去掉中中间的短横线就行了