package com.uas.search.console.b2b.model;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Table;

@Table(name = "purc$forecastitems")
@Entity
public class PurchaseForecastItemSimpleInfo {

	@Id
	@Column(name = "pfd_id")
	private Long id;

	/**
	 * 采购预测企业
	 */
	@OneToOne
	@JoinColumn(name = "pfd_venduu", insertable = false, updatable = false)
	private EnterpriseSimpleInfo enterprise;

	/**
	 * 产品
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pfd_prid", insertable = false, updatable = false)
	private ProductSimpleInfo product;

	/**
	 * 供应商
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pfd_venduu", insertable = false, updatable = false)
	private EnterpriseSimpleInfo vend;

	public Long getId() {
		return id;
	}

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

	public ProductSimpleInfo getProduct() {
		return product;
	}

	public void setProduct(ProductSimpleInfo product) {
		this.product = product;
	}

	public EnterpriseSimpleInfo getVend() {
		return vend;
	}

	public void setVend(EnterpriseSimpleInfo vend) {
		this.vend = vend;
	}

	public EnterpriseSimpleInfo getEnterprise() {
		return enterprise;
	}

	public void setEnterprise(EnterpriseSimpleInfo enterprise) {
		this.enterprise = enterprise;
	}

	@Override
	public String toString() {
		return "PurchaseForecastItemSimpleInfo [id=" + id + ", enterprise=" + enterprise + ", product=" + product
				+ ", vend=" + vend + "]";
	}
}