package spring.mvc.orders.entities;

import javax.persistence.*;

/**
 * @Created 08 / 04 / 2020 - 5:46 PM
 * @project SpringMultipleDataStructure
 * @Author Hamdamboy
 */

@Entity
@Table(name = "ORDER_ITEMS")
public class OrderItem {
    //
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Integer id;
    private String productCode;
    private int quantity;
    @ManyToOne
    @JoinColumn(name = "order_id")
    private Order order;

    public Integer getId(){
        return id;
    }

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

    public String getProductCode() {
        return productCode;
    }

    public void setProductCode(String productCode) {
        this.productCode = productCode;
    }

    public int getQuantity() {
        return quantity;
    }

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

    public Order getOrder() {
        return order;
    }

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



}
