在使用mybatis的注解开发,往数据库中插入数据时出现了如下错误:org.mybatis.spring.MyBatisSystemException: nested exception is org.apache.ibatis.reflection.ReflectionException: There is no getter for property named 'xxx' in 'xxx'。看了半天也没发现问题出在哪里,在网上查阅资料后成功解决。
问题代码:
![在这里插入图片描述](https://img-blog.csdnimg.cn/0b697cf987e74cf8ac20b00055be2165.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5oiR6KaB6LW36aOe5oiR5LiN566h,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
修改后代码:
![在这里插入图片描述](https://img-blog.csdnimg.cn/8bc097748b2549dead6b46bdae424a8b.png?x-oss-process=image/watermark,type_d3F5LXplbmhlaQ,shadow_50,text_Q1NETiBA5oiR6KaB6LW36aOe5oiR5LiN566h,size_20,color_FFFFFF,t_70,g_se,x_16#pic_center)
加了一个注解@Param,成功解决问题。
org.apache.ibatis.reflection: There is no getter for property named ‘xxx‘ in ‘class
最新推荐文章于 2024-07-24 22:33:18 发布