MP:There is no getter for property named ‘null‘ in ‘class XXX‘异常

在使用主键进行更新或者删除的时候,报下面错误

There is no getter for property named ‘null’ in 'class 。。。

我的代码如下

@Builder
@Data
public class Course implements Serializable {
    private static final long serialVersionUID = -16929324809307129L;
    
    private Long cid;

    private String cname;

    private Integer cstatus;

    private Integer userid;

}

解决办法如下

@TableId
private Long cid;
上一篇:微服务的边界


下一篇:Python周刊486期