45 lines
954 B
Java
45 lines
954 B
Java
|
package org.hso.ecommerce.entities;
|
||
|
|
||
|
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<CustomerOrderPosition> 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;
|
||
|
}
|