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 yingp
 * 
 */
@Table(name = "purc$changeitems")
@Entity
public class PurchaseOrderChangeItemSimpleInfo {

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

	/**
	 * 序号
	 */
	@Column(name = "pcd_number")
	private Short number;

	/**
	 * 采购订单明细
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "pcd_pdid", insertable = false, updatable = false)
	private PurchaseOrderItemSimpleInfo purcOrders;

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

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

	public Long getId() {
		return id;
	}

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

	public Short getNumber() {
		return number;
	}

	public void setNumber(Short number) {
		this.number = number;
	}

	public PurchaseOrderItemSimpleInfo getPurcOrders() {
		return purcOrders;
	}

	public void setPurcOrders(PurchaseOrderItemSimpleInfo purcOrders) {
		this.purcOrders = purcOrders;
	}

	public ProductSimpleInfo getNewProduct() {
		return newProduct;
	}

	public void setNewProduct(ProductSimpleInfo newProduct) {
		this.newProduct = newProduct;
	}

	public ProductSimpleInfo getOldProduct() {
		return oldProduct;
	}

	public void setOldProduct(ProductSimpleInfo oldProduct) {
		this.oldProduct = oldProduct;
	}

	@Override
	public String toString() {
		return "PurchaseOrderChangeItemSimpleInfo [id=" + id + ", number=" + number + ", purcOrders=" + purcOrders
				+ ", newProduct=" + newProduct + ", oldProduct=" + oldProduct + "]";
	}

}