There is no getter for property named 'dish_id' in 'class com.sky.entity.DishFlavor'
时间: 2023-11-19 14:54:08 浏览: 196
这个错误提示意味着在类com.sky.entity.DishFlavor中没有名为dish_id的属性的getter方法。这通常是因为实体类中的属性名与数据库表中的列名不匹配,或者是因为实体类中缺少相应的getter方法。解决这个问题的方法是在实体类中添加一个名为getDishId的方法,或者在数据库表中将列名改为与实体类属性名匹配的名称。如果你使用的是Mybatis plus,你可以使用@TableField注解来指定实体类属性与数据库表列名之间的映射关系。例如,你可以在DishFlavor类中添加以下注解:@TableField("dish_id"),这将把dish_id列映射到DishFlavor类的dishId属性上。
相关问题
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属性的值。
阅读全文