Mybatis的巨坑 Caused by: java.sql.SQLSyntaxErrorException: Unknown column ‘name’ in ‘field list’
- 数据库字段
- mybatisplus代码自动生成后的字段
由于数字 1 不能大写,其他阿拉伯数字也是一样的,导致报错,实体类无法对应数据库
···java
@ApiModelProperty(value = “预留字段”)
private String x1;
@ApiModelProperty(value = "预留字段")
private String x2;
@ApiModelProperty(value = "预留字段")
private String x3;
@ApiModelProperty(value = "预留字段")
private String x4;
@ApiModelProperty(value = "预留字段")
private String x5;
···
- 正确的姿势
···java
@ApiModelProperty(value = “预留字段”)
private String x_1;
@ApiModelProperty(value = "预留字段")
private String x_2;
@ApiModelProperty(value = "预留字段")
private String x_3;
@ApiModelProperty(value = "预留字段")
private String x_4;
@ApiModelProperty(value = "预留字段")
private String x_5;
···