@@ -0,0 +1,1921 @@
+package devopsdistilled.operp.server.data.entity.stock;%0A%0Aimport java.util.List;%0A%0Aimport javax.persistence.Entity;%0Aimport javax.persistence.GeneratedValue;%0Aimport javax.persistence.GenerationType;%0Aimport javax.persistence.Id;%0Aimport javax.persistence.JoinColumn;%0Aimport javax.persistence.ManyToOne;%0Aimport javax.persistence.OneToMany;%0Aimport javax.persistence.Table;%0Aimport javax.persistence.UniqueConstraint;%0A%0Aimport devopsdistilled.operp.server.data.entity.Entiti;%0Aimport devopsdistilled.operp.server.data.entity.items.Item;%0A%0A@Entity%0A@Table(uniqueConstraints = @UniqueConstraint(columnNames = %7B %22itemId%22,%0A%09%09%22warehouseId%22 %7D))%0Apublic class Stock extends Entiti%3CLong%3E %7B%0A%0A%09private static final long serialVersionUID = -7397395555201558401L;%0A%0A%09@Id%0A%09@GeneratedValue(strategy = GenerationType.AUTO)%0A%09private Long stockId;%0A%0A%09private Long quantity;%0A%0A%09@ManyToOne%0A%09@JoinColumn(name = %22itemId%22)%0A%09private Item item;%0A%0A%09@ManyToOne%0A%09@JoinColumn(name = %22warehouseId%22)%0A%09private Warehouse warehouse;%0A%0A%09@OneToMany(mappedBy = %22stock%22)%0A%09private List%3CStockKeeper%3E stockKeepers;%0A%0A%09public Long getStockId() %7B%0A%09%09return stockId;%0A%09%7D%0A%0A%09public void setStockId(Long stockId) %7B%0A%09%09this.stockId = stockId;%0A%09%7D%0A%0A%09public Long getQuantity() %7B%0A%09%09return quantity;%0A%09%7D%0A%0A%09public void setQuantity(Long quantity) %7B%0A%09%09this.quantity = quantity;%0A%09%7D%0A%0A%09public Item getItem() %7B%0A%09%09return item;%0A%09%7D%0A%0A%09public void setItem(Item item) %7B%0A%09%09this.item = item;%0A%09%7D%0A%0A%09public Warehouse getWarehouse() %7B%0A%09%09return warehouse;%0A%09%7D%0A%0A%09public void setWarehouse(Warehouse warehouse) %7B%0A%09%09this.warehouse = warehouse;%0A%09%7D%0A%0A%09public List%3CStockKeeper%3E getStockKeepers() %7B%0A%09%09return stockKeepers;%0A%09%7D%0A%0A%09public void setStockKeepers(List%3CStockKeeper%3E stockKeepers) %7B%0A%09%09this.stockKeepers = stockKeepers;%0A%09%7D%0A%0A%09@Override%0A%09public Long id() %7B%0A%09%09return getStockId();%0A%09%7D%0A%0A%09@Override%0A%09public String toString() %7B%0A%09%09return new String(getItem().getItemName() + %22 In %22%0A%09%09%09%09+ getWarehouse().getWarehouseName());%0A%09%7D%0A%0A%7D%0A

Create Stock Entity