There is no getter for property named 'cancel_reason' in 'class com.sky.entity.Orders'
时间: 2023-11-19 18:42:13 浏览: 148
引用:问题的原因是因为在实体类com.sky.entity.Orders中没有名为cancel_reason的属性的get方法。根据您提供的修复示范,您修改了实体类中的属性名字为cityEn,并将<if test=>中的city修改为cityEn,问题得到了解决。引用:关于Mybatis单个参数的if判断报异常There is no getter for property named 'xxx' in 'class java.lang.Integer'的解决方案,建议将<if test =>中的字段名字与对应实体类的字段名字相同。引用:在mybatis动态查询中,<if test=>中的字段应该与对应实体类的字段名字相同,而不是数据库的字段名字。一般情况下,数据库字段和实体类的字段是相同的,这可能导致您误以为<if test=>中的字段应该是数据库字段。对于您的问题,根据错误信息,可以看出在com.sky.entity.Orders类中缺少了名为cancel_reason的属性的get方法。您可以根据实际情况添加该方法来解决问题。
相关问题
There is no getter for property named 'update_time' in 'class com.sky.entity.Dish'
The 'update_time' property is not accessible through a getter in the 'Dish' class of the 'com.sky.entity' package. To access this property, you would need to implement a getter method for it in the 'Dish' class. Here's an example of how you can add a getter for the 'update_time' property in Java:
```java
package com.sky.entity;
public class Dish {
private String update_time;
// Other properties and methods
public String getUpdate_time() {
return update_time;
}
public void setUpdate_time(String update_time) {
this.update_time = update_time;
}
}
```
By adding the `getUpdate_time()` method to the 'Dish' class, you can now retrieve the value of the 'update_time' property using this getter method.
There is no getter for property named 'id_number' in 'class com.sky.entity.Employee'
There is no getter for property named 'id_number' in 'class com.sky.entity.Employee'的错误是因为在com.sky.entity.Employee类中没有名为id_number的属性的get方法。解决这个问题的方法是在Employee类中添加一个名为getId_number的方法,以获取id_number属性的值。
阅读全文