@buider加在父类和子类上,可能不生效,或者会造成错误,可以使用@superBuilder,子类父类都要加。方可让子类使用父类的属性
父类
@Data
@SuperBuilder
public class Person
{
@Tolerate
public Person() {
}
private Long id;
private String phone;
private Integer status;
}
子类
@Data
@SuperBuilder
public class FirmUser extends Person
{
@Tolerate
public FirmUser(){}
private String code;
private String name;
}