package com.mossle.asset.persistence.domain;

// Generated by Hibernate Tools
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * StockInfo 库存总数.
 * 
 * @author Lingo
 */
@Entity
@Table(name = "STOCK_INFO")
public class StockInfo implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

    /** 主键. */
    private Long id;

    /** null. */
    private SkuInfo skuInfo;

    /** null. */
    private Integer storeCount;

    /** null. */
    private Integer usingCount;

    /** null. */
    private String description;

    /** null. */
    private String tenantId;

    /** . */
    private Set<StockItem> stockItems = new HashSet<StockItem>(0);

    public StockInfo() {
    }

    public StockInfo(Long id) {
        this.id = id;
    }

    public StockInfo(Long id, SkuInfo skuInfo, Integer storeCount,
            Integer usingCount, String description, String tenantId,
            Set<StockItem> stockItems) {
        this.id = id;
        this.skuInfo = skuInfo;
        this.storeCount = storeCount;
        this.usingCount = usingCount;
        this.description = description;
        this.tenantId = tenantId;
        this.stockItems = stockItems;
    }

    /** @return 主键. */
    @Id
    @Column(name = "ID", unique = true, nullable = false)
    public Long getId() {
        return this.id;
    }

    /**
     * @param id
     *            主键.
     */
    public void setId(Long id) {
        this.id = id;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "SKU_ID")
    public SkuInfo getSkuInfo() {
        return this.skuInfo;
    }

    /**
     * @param skuInfo
     *            null.
     */
    public void setSkuInfo(SkuInfo skuInfo) {
        this.skuInfo = skuInfo;
    }

    /** @return null. */
    @Column(name = "STORE_COUNT")
    public Integer getStoreCount() {
        return this.storeCount;
    }

    /**
     * @param storeCount
     *            null.
     */
    public void setStoreCount(Integer storeCount) {
        this.storeCount = storeCount;
    }

    /** @return null. */
    @Column(name = "USING_COUNT")
    public Integer getUsingCount() {
        return this.usingCount;
    }

    /**
     * @param usingCount
     *            null.
     */
    public void setUsingCount(Integer usingCount) {
        this.usingCount = usingCount;
    }

    /** @return null. */
    @Column(name = "DESCRIPTION", length = 200)
    public String getDescription() {
        return this.description;
    }

    /**
     * @param description
     *            null.
     */
    public void setDescription(String description) {
        this.description = description;
    }

    /** @return null. */
    @Column(name = "TENANT_ID", length = 64)
    public String getTenantId() {
        return this.tenantId;
    }

    /**
     * @param tenantId
     *            null.
     */
    public void setTenantId(String tenantId) {
        this.tenantId = tenantId;
    }

    /** @return . */
    @OneToMany(fetch = FetchType.LAZY, mappedBy = "stockInfo")
    public Set<StockItem> getStockItems() {
        return this.stockItems;
    }

    /**
     * @param stockItems
     *            .
     */
    public void setStockItems(Set<StockItem> stockItems) {
        this.stockItems = stockItems;
    }
}
