package com.pizza.model;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EnumType;
import javax.persistence.Enumerated;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.fasterxml.jackson.annotation.JsonIgnore;

@Entity
@Table(name="T_ORDERED_ITEM")
public class HOrderedItem {

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	private long id;

	@Column(name = "ITEM", nullable = false)
	@Enumerated(EnumType.STRING)
    private Item item;
	
	@Column(name = "COUNT", nullable = false)
	private int count;
	
	@Column(name = "USER", nullable = false)
	private String user;
	
    @ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="ORDER_ID", nullable=false)
    @JsonIgnore
	private HOrder order;

	public long getId() {
		return id;
	}

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

	public Item getItem() {
		return item;
	}

	public void setItem(Item item) {
		this.item = item;
	}

	public int getCount() {
		return count;
	}

	public void setCount(int count) {
		this.count = count;
	}

	public String getUser() {
		return user;
	}

	public void setUser(String user) {
		this.user = user;
	}

	public HOrder getOrder() {
		return order;
	}

	public void setOrder(HOrder order) {
		this.order = order;
	}
	
	
}

@@ -831,16 +831,89 @@
 user;%0A%09%0A
+%09@Column(name = %22DETAILS%22, nullable = false)%0A%09private String details;%09%0A%09%0A
     @Man
@@ -1544,15 +1544,139 @@
 rder;%0A%09%7D
+%0A%0A%09public String getDetails() %7B%0A%09%09return details;%0A%09%7D%0A%0A%09public void setDetails(String details) %7B%0A%09%09this.details = details;%0A%09%7D
 %0A%09%0A%09%0A%7D%0A

add item details