package com.uas.eis.entity;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

/**
 * Created by luhg on 2018/4/26.
 * 销售退货单
 */
@Entity
@Table(name = "edi_salereturn")
@JsonIgnoreProperties(ignoreUnknown = true)
public class SaleReturn implements Serializable {
    private static final long serialVersionUID = 1L;

    @Id
    @SequenceGenerator(name="EDI_SALERETURN_GENERATOR", sequenceName="EDI_SALERETURN_SEQ", allocationSize=1)
    @GeneratedValue(strategy=GenerationType.SEQUENCE, generator="EDI_SALERETURN_GENERATOR")
    @Column(name = "id_")
    private Long id;

    @Column(name = "refund_no")
    private String refund_no;

    @Column(name = "warehouse_no")
    private String warehouse_no;

    @Column(name = "shop_no")
    private String shop_no;

    @Column(name = "sales_tid")
    private String sales_tid;

    @Column(name = "date_")
    private Date date = new Date();

    /**
     * 销售退货单明细.
     */
    @OneToMany(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
    @JoinColumn(name = "mainid_")
    private List<SaleReturnDetail> refund_orders_list;

    public SaleReturn(){}

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getRefund_no() {
        return refund_no;
    }

    public void setRefund_no(String refund_no) {
        this.refund_no = refund_no;
    }

    public String getWarehouse_no() {
        return warehouse_no;
    }

    public void setWarehouse_no(String warehouse_no) {
        this.warehouse_no = warehouse_no;
    }

    public String getShop_no() {
        return shop_no;
    }

    public void setShop_no(String shop_no) {
        this.shop_no = shop_no;
    }

    public String getSales_tid() {
        return sales_tid;
    }

    public void setSales_tid(String sales_tid) {
        this.sales_tid = sales_tid;
    }

    public Date getDate() {
        return date;
    }

    public void setDate(Date date) {
        this.date = date;
    }

    public List<SaleReturnDetail> getRefund_orders_list() {
        return refund_orders_list;
    }

    public void setRefund_orders_list(List<SaleReturnDetail> refund_orders_list) {
        this.refund_orders_list = refund_orders_list;
    }

}
