package com.liangjian.dataplatform.member.entity.po.secondary;

import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Date;
import java.util.List;
import java.util.Set;


@Entity
@Table(name = "mem_ingProduct")
public class MemIngProduct {
    @Id
    @JsonProperty(value="ProductCode")
    @Column(name = "ProductCode")
    private String productCode;

    @JsonProperty(value="ProductObject")
    @Column(name = "ProductObject")
    @ApiModelProperty("1实物2虚拟")
    private Integer productObject;

    @JsonProperty(value="ProductName")
    @Column(name = "ProductName")
    @ApiModelProperty("商品名")
    private String productName;

    @JsonProperty(value="ProductDesc")
    @Column(name = "ProductDesc")
    @ApiModelProperty("描述")
    private String productDesc;

    @JsonProperty(value="Manufacturer")
    @Column(name = "Manufacturer")
    @ApiModelProperty("供应商")
    private String manufacturer;

    @JsonProperty(value="ProductType")
    @Column(name = "ProductType")
    private String productType;

    @JsonProperty(value="PurchasePrice")
    @Column(name = "PurchasePrice")
    private Integer purchasePrice;

    @JsonProperty(value="Amount")
    @Column(name = "Amount")
    @ApiModelProperty("库存")
    private Integer amount;

    @JsonProperty(value="State")
    @Column(name = "State",insertable = false)
    private Integer state;

    @JsonProperty(value="IsDelete")
    @Column(name = "IsDelete")
    private Integer isDelete;

    @JsonProperty(value="CreationDate")
    @Column(name = "CreationDate",insertable = false)
    private Date creationDate;

    @JsonProperty(value="LastModified")
    @Column(name = "LastModified")
    private Date lastModified;

    @JsonProperty(value="ProductText")
    @Column(name = "ProductText")
    @ApiModelProperty("商品详情")
    private String productText;

    @JsonProperty(value="MarketPrice")
    @Column(name = "MarketPrice")
    @ApiModelProperty("默认价格(分)")
    private Integer marketPrice;

    @JsonProperty(value="MarketIng")
    @Column(name = "MarketIng")
    @ApiModelProperty("默认积分")
    private Integer marketIng;

    @OneToMany(fetch = FetchType.EAGER)
    @JoinColumn(name = "ProductCode", referencedColumnName = "ProductCode",  //关联信息
            insertable=false, updatable = false,
            foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) //不自动建外键
    private Set<MemIngProductLevel> productLevel;

    @OneToMany(fetch = FetchType.EAGER)
    @JoinColumn(name = "ProductCode", referencedColumnName = "ProductCode",  //关联信息
            insertable=false, updatable = false,
            foreignKey = @ForeignKey(name = "none", value = ConstraintMode.NO_CONSTRAINT)) //不自动建外键
    private List<MemIngProductPic> pics;

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public Integer getProductObject() {
        return productObject;
    }

    public void setProductObject(Integer productObject) {
        this.productObject = productObject;
    }

    public String getProductName() {
        return productName;
    }

    public void setProductName(String productName) {
        this.productName = productName;
    }

    public String getProductDesc() {
        return productDesc;
    }

    public void setProductDesc(String productDesc) {
        this.productDesc = productDesc;
    }

    public String getManufacturer() {
        return manufacturer;
    }

    public void setManufacturer(String manufacturer) {
        this.manufacturer = manufacturer;
    }

    public String getProductType() {
        return productType;
    }

    public void setProductType(String productType) {
        this.productType = productType;
    }

    public Integer getPurchasePrice() {
        return purchasePrice;
    }

    public void setPurchasePrice(Integer purchasePrice) {
        this.purchasePrice = purchasePrice;
    }

    public Integer getAmount() {
        return amount;
    }

    public void setAmount(Integer amount) {
        this.amount = amount;
    }

    public Integer getState() {
        return state;
    }

    public void setState(Integer state) {
        this.state = state;
    }

    public Integer getIsDelete() {
        return isDelete;
    }

    public void setIsDelete(Integer isDelete) {
        this.isDelete = isDelete;
    }

    public Date getCreationDate() {
        return creationDate;
    }

    public void setCreationDate(Date creationDate) {
        this.creationDate = creationDate;
    }

    public Date getLastModified() {
        return lastModified;
    }

    public void setLastModified(Date lastModified) {
        this.lastModified = lastModified;
    }

    public String getProductText() {
        return productText;
    }

    public void setProductText(String productText) {
        this.productText = productText;
    }

    public Integer getMarketPrice() {
        return marketPrice;
    }

    public void setMarketPrice(Integer marketPrice) {
        this.marketPrice = marketPrice;
    }

    public Integer getMarketIng() {
        return marketIng;
    }

    public void setMarketIng(Integer marketIng) {
        this.marketIng = marketIng;
    }

    public Set<MemIngProductLevel> getProductLevel() {
        return productLevel;
    }

    public void setProductLevel(Set<MemIngProductLevel> productLevel) {
        this.productLevel = productLevel;
    }

    public List<MemIngProductPic> getPics() {
        return pics;
    }

    public void setPics(List<MemIngProductPic> pics) {
        this.pics = pics;
    }
}
