问:
org.apache.ibatis.reflection.ReflectionException: There is no getter for property named ‘stu_sno’ in ‘class com.geekmice.springbootrequestparam.pojo.Student’
答:动态SQL写错 if标签
错误的
正确的
mybatisUserMapper.xml 文件 相应的实体类 字段 没有getter方法 There is no getter for property
最新推荐文章于 2024-07-18 17:57:12 发布
在使用MyBatis进行动态SQL编程时,可能会遇到`ReflectionException`,提示在`Student`类中找不到属性'stu_sno'的getter方法。这通常是由于在if标签中的条件表达式写错导致的。确保在映射文件中正确引用了实体类的属性,并检查所有的动态SQL标签语法是否正确。修正此类错误通常涉及检查字段名拼写、大小写和对应的getter/setter方法。
摘要由CSDN通过智能技术生成