@Data
@EqualsAndHashCode(callSuper = true)
@TableName("erlang_user_car")
@ApiModel(value="UserCar对象", description="车")
public class UserCar extends BaseExample implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "名称,标题")
@NonNull
private String name;
}
1.此处如果不是类型转换问题,那么就是,@NonNull编译之后生成了有参构造方法,而方法中一定要有一个无参构造方法
2.解决办法,在实体中加入无参构造方法
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("erlang_user_car")
@ApiModel(value="UserCar对象", description="车")
public class UserCar extends BaseExample implements Serializable{
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键id")
@TableId(value = "id", type = IdType.AUTO)
private Long id;
@ApiModelProperty(value = "名称,标题")
@NonNull
private String name;
public UserCar() {}
}