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;

/**
 * StockItem 库存明细.
 * 
 * @author Lingo
 */
@Entity
@Table(name = "STOCK_ITEM")
public class StockItem implements java.io.Serializable {
    private static final long serialVersionUID = 0L;

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

    /** null. */
    private StockInfo stockInfo;

    /** null. */
    private StockItem stockItem;

    /** null. */
    private String code;

    /** null. */
    private String sn;

    /** null. */
    private Integer usingCount;

    /** null. */
    private String userId;

    /** null. */
    private String status;

    /** null. */
    private String description;

    /** null. */
    private String tenantId;

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

    public StockItem() {
    }

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

    public StockItem(Long id, StockInfo stockInfo, StockItem stockItem,
            String code, String sn, Integer usingCount, String userId,
            String status, String description, String tenantId,
            Set<StockItem> stockItems) {
        this.id = id;
        this.stockInfo = stockInfo;
        this.stockItem = stockItem;
        this.code = code;
        this.sn = sn;
        this.usingCount = usingCount;
        this.userId = userId;
        this.status = status;
        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 = "INFO_ID")
    public StockInfo getStockInfo() {
        return this.stockInfo;
    }

    /**
     * @param stockInfo
     *            null.
     */
    public void setStockInfo(StockInfo stockInfo) {
        this.stockInfo = stockInfo;
    }

    /** @return null. */
    @ManyToOne(fetch = FetchType.LAZY)
    @JoinColumn(name = "ITEM_ID")
    public StockItem getStockItem() {
        return this.stockItem;
    }

    /**
     * @param stockItem
     *            null.
     */
    public void setStockItem(StockItem stockItem) {
        this.stockItem = stockItem;
    }

    /** @return null. */
    @Column(name = "CODE", length = 50)
    public String getCode() {
        return this.code;
    }

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

    /** @return null. */
    @Column(name = "SN", length = 50)
    public String getSn() {
        return this.sn;
    }

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

    /** @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 = "USER_ID", length = 64)
    public String getUserId() {
        return this.userId;
    }

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

    /** @return null. */
    @Column(name = "STATUS", length = 50)
    public String getStatus() {
        return this.status;
    }

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

    /** @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 = "stockItem")
    public Set<StockItem> getStockItems() {
        return this.stockItems;
    }

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