package org.hso.ecommerce.entities.shop; import org.hso.ecommerce.entities.user.User; import javax.persistence.*; import javax.validation.constraints.NotNull; import java.util.ArrayList; import java.util.List; @Entity @Table(name = "customer_orders") public class CustomerOrder { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @Basic public long id; @ManyToOne(optional = false) public User customer; @Embedded public Address destination; @OneToMany( targetEntity = CustomerOrderPosition.class, mappedBy = "order" ) public List positions = new ArrayList<>(); @NotNull public java.sql.Timestamp created; @NotNull public String trackingId; @Column(nullable = true) public java.sql.Timestamp inDeliverySince; @Column(nullable = true) public java.sql.Timestamp deliveredAt; public int totalNetCent; public int totalGrossCent; public int totalVatCent; }