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 = "sale$senditem")
@Entity
public class SaleSendItemSimpleInfo {

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

	/**
	 * 客户送货提醒单
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "si_noticeid", insertable = false, updatable = false, nullable = false)
	private PurchaseNoticeSimpleInfo notice;

	/**
	 * 客户采购单明细（可能存在不通过送货提醒发货的情况，所以需要能直接关联客户采购单明细）
	 */
	@OneToOne(cascade = { CascadeType.REFRESH })
	@JoinColumn(name = "si_pdid", insertable = false, updatable = false, nullable = false)
	private PurchaseOrderItemSimpleInfo orderItem;

	public Long getId() {
		return id;
	}

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

	public PurchaseNoticeSimpleInfo getNotice() {
		return notice;
	}

	public void setNotice(PurchaseNoticeSimpleInfo notice) {
		this.notice = notice;
	}

	public PurchaseOrderItemSimpleInfo getOrderItem() {
		return orderItem;
	}

	public void setOrderItem(PurchaseOrderItemSimpleInfo orderItem) {
		this.orderItem = orderItem;
	}

	@Override
	public String toString() {
		return "SaleSendItemSimpleInfo [id=" + id + ", notice=" + notice + ", orderItem=" + orderItem + "]";
	}

}