package devopsdistilled.operp.server.data.entity.stock;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

import devopsdistilled.operp.server.data.entity.Entiti;
import devopsdistilled.operp.server.data.entity.items.Item;

@Entity
public class StockKeeper extends Entiti<Long> {

	private static final long serialVersionUID = 6110042579005L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private Long stockKeeperId;

	@Temporal(TemporalType.TIMESTAMP)
	private Date stockUpdateDate;

	@ManyToOne
	private Stock stock;

	private Long quantity;

	@OneToOne
	@JoinColumn(name = "transferStockKeeperId")
	private StockKeeper transferStockKeeper;

	public Long getStockKeeperId() {
		return stockKeeperId;
	}

	public void setStockKeeperId(Long stockKeeperId) {
		this.stockKeeperId = stockKeeperId;
	}

	public Date getStockUpdateDate() {
		return stockUpdateDate;
	}

	public void setStockUpdateDate(Date stockUpdateDate) {
		this.stockUpdateDate = stockUpdateDate;
	}

	public Stock getStock() {
		return stock;
	}

	public void setStock(Stock stock) {
		this.stock = stock;
	}

	public Long getQuantity() {
		return quantity;
	}

	public void setQuantity(Long quantity) {
		this.quantity = quantity;
	}

	public StockKeeper getTransferStockKeeper() {
		return transferStockKeeper;
	}

	public void setTransferStockKeeper(StockKeeper transferStockKeeper) {
		this.transferStockKeeper = transferStockKeeper;
	}

	public Item getItem() {
		return getStock().getItem();
	}

	public Warehouse getWarehouse() {
		return getStock().getWarehouse();
	}

	@Override
	public Long id() {
		return getStockKeeperId();
	}

	@Override
	public String toString() {
		return new String(getQuantity() + " " + getStock().toString());
	}

}

@@ -849,16 +849,39 @@
 ntity;%0A%0A
+%09private String note;%0A%0A
 %09@OneToO
@@ -1729,32 +1729,138 @@
 tockKeeper;%0A%09%7D%0A%0A
+%09public String getNote() %7B%0A%09%09return note;%0A%09%7D%0A%0A%09public void setNote(String note) %7B%0A%09%09this.note = note;%0A%09%7D%0A%0A
 %09public Item get

Add "note" field