1. 程式人生 > >使用實體類的時候給預設值

使用實體類的時候給預設值

@Entity
@Table(name="destockings")
@Data
public class Destocking extends AbstractAuditing  {
    @Id
    private String id;
    @NotNull
    private String client;
    @NotNull
    private String country;
    private String boardSize;
    private String boardHeight;
    private Integer boardQuantity;
    private Date expectedArrivalDate;
    private Integer packageQuantity;
    private Integer parcelQuantity;
    private Double weight;
    private Date stockOutAt;
    @Enumerated(EnumType.STRING)
    private Status status = Status.STOCK_IN;
    private String comment;
    @ApiModelProperty(value = "幹線費用", readOnly = true)
    private Double deliveryFee = 0d;
}