This primary key of “id“ is primitive !不建议如此请使用包装类 in Class

1、原来内容:

@Data
@TableName("db_leads")
public class Leads {

    @TableId(value = "id", type = IdType.AUTO)
    private int id;

    @TableField("leads_name")
    private int leadsName;

    @TableField("name")
    private String name;

    @TableField("address")
    private String address;
}

2、更改内容(int —> Integer):

private int id;
private Integer id;

3、最后结果:

@Data
@TableName("db_leads")
public class Leads {

    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;

    @TableField("leads_name")
    private int leadsName;

    @TableField("name")
    private String name;

    @TableField("address")
    private String address;
}

你可能感兴趣的:(日常Bug,java,int)