实体上使用了lombok的@Builder注解,如果不select所有字段,就会报错。
解决方法:使用lombok的@Builder注解的时候必须必须同时在pojo对象中使用注解@Tolerate添加一个无参构造。如下:
package org.tangxz.modules.logistics.manage.sj_info.entity;import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Builder;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import lombok.experimental.Tolerate;
import org.tangxz.modules.logistics.manage.wljd_info.entity.WljdInfo;
import org.tangxz.modules.logistics.table.cl.entity.Cl;
import org.tangxz.modules.logistics.table.hfqz.entity.Hfqz;
import org.tangxz.modules.logistics.table.ht.entity.Ht;
import org.tangxz.modules.logistics.table.hz_sj_pj.entity.HzSjPj;
import org.tangxz.modules.logistics.table.pltz.entity.Pltz;
import org.tangxz.modules.logistics.table.sj_hz_pj.entity.SjHzPj;
import org.tangxz.modules.logistics.table.tlht.entity.Tlht;
import org.tangxz.modules.logistics.table.tz.entity.Tz;
import org.tangxz.modules.logistics.table.user.entity.User;
import org.tangxz.modules.logistics.table.wljd.entity.Wljd;import java.util.List;
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@ApiModel(value="司机全部信息关联表", description="司机信息")
@Builder
public class SjInfo {@ApiModelProperty(value = "司机基本信息")private User sjUser;@ApiModelProperty(value = "司机接单数")private Integer sjJdNum;@ApiModelProperty(value = "司机好评数pj_fs>=6")private Integer sjHpNum;@ApiModelProperty(value = "司机差评数pj_fs<6")private Integer sjCpNum;@ApiModelProperty(value = "司机车辆")private List<Cl> sjClList;@ApiModelProperty(value = "司机接单信息")private List<WljdInfo> sjWljdInfoList;@ApiModelProperty(value = "司机发表的帖子")private List<Tz> sjTzList;@ApiModelProperty(value = "司机评论帖子")private List<Pltz> sjPltzList;@ApiModelProperty(value = "司机发表的话题")private List<Ht> sjHtList;@ApiModelProperty(value = "司机发表的讨论")private List<Tlht> sjTlhtList;@ApiModelProperty(value = "司机发表的求助")private List<QzAll> sjQzList;@ApiModelProperty(value = "司机回复的求助")private List<Hfqz> sjHfqzList;@ApiModelProperty(value = "货主被评价")private List<HzSjPj> sjBeiPj;@ApiModelProperty(value = "司机评价")private List<SjHzPj> sjPj;@Toleratepublic SjInfo(){ }
}