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 suntg
 * 
 */
@Table(name = "purc$badinitem")
@Entity
public class PurchaseBadInItemSimpleInfo {

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

	/**
	 * 送货单号
	 */
	@Column(name = "pbi_batchcode")
	private String batchCode;

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

	public Long getId() {
		return id;
	}

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

	public String getBatchCode() {
		return batchCode;
	}

	public void setBatchCode(String batchCode) {
		this.batchCode = batchCode;
	}

	public PurchaseOrderItemSimpleInfo getOrderItem() {
		return orderItem;
	}

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

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