RM-Fashion/src/main/java/com/rmfashion/RM/Fashion/Entity/Order.java
package com.rmfashion.RM.Fashion.Entity;

import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.List;

@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@Entity(name = "COrder")
public class Order {
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "Order_ID")
    private long orderId;

    @ManyToOne
    @JoinColumn(name = "Customer_ID")
    private Customer customer;

    @OneToOne(mappedBy = "order",cascade = CascadeType.ALL)
    private Shipment shipment;
    @ManyToMany(mappedBy = "orders")
    private List<Product> products=new ArrayList<>();

}
