9/7/2017 - 3:54 AM

Association table between orders and items

Create a table for the purpose of associating orders and items

package com.project.model;

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.Table;

import com.fasterxml.jackson.annotation.JsonBackReference;
import com.fasterxml.jackson.annotation.JsonIdentityInfo;
import com.fasterxml.jackson.annotation.ObjectIdGenerators;

public class OrderItem {
	private Long id;
	private CustomerOrder order;
//	@JsonBackReference
//	@JsonIdentityInfo(generator=ObjectIdGenerators.IntSequenceGenerator.class, property= "description")
	private Item items;
	private Long quantity;

	public Long getQuantity() {
		return quantity;

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

	public CustomerOrder getOrder() {
		return order;

	public void setOrder(CustomerOrder order) {
		this.order = order;

	public Item getItems() {
		return items;

	public void setItems(Item items) {
		this.items = items;

	public Long getId() {
		return id;