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;

/**
 * 采购单明细
 * 
 * @author sunyj
 * @since 2016年11月9日 下午2:51:26
 */
@Entity
@Table(name = "purc$orderitems")
public class PurchaseOrderItemSimpleInfo {

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

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

	/**
	 * 采购单
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pd_puid", insertable = false, updatable = false)
	private PurchaseOrderSimpleInfo2 purchaseOrder;

	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 PurchaseOrderSimpleInfo2 getPurchaseOrder() {
		return purchaseOrder;
	}

	public void setPurchaseOrder(PurchaseOrderSimpleInfo2 purchaseOrder) {
		this.purchaseOrder = purchaseOrder;
	}

	@Override
	public String toString() {
		return "PurchaseOrderItemSimpleInfo [id=" + id + ", product=" + product + ", purchaseOrder=" + purchaseOrder
				+ "]";
	}

}
