-
Notifications
You must be signed in to change notification settings - Fork 106
/
Order.java
134 lines (105 loc) · 3.53 KB
/
Order.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
package com.fasterxml.jackson.datatype.hibernate.data;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
@SuppressWarnings("serial")
@Entity
@Table(name="Order"
,catalog="classicmodels"
)
public class Order implements java.io.Serializable {
private Integer orderNumber;
private Customer customer;
private Date orderDate;
private Date requiredDate;
private Date shippedDate;
private String status;
private String comments;
private Set<OrderDetail> orderDetails = new HashSet<OrderDetail>(0);
public Order() {
}
public Order(Customer customer, Date orderDate, Date requiredDate, String status) {
this.customer = customer;
this.orderDate = orderDate;
this.requiredDate = requiredDate;
this.status = status;
}
public Order(Customer customer, Date orderDate, Date requiredDate, Date shippedDate, String status, String comments, Set<OrderDetail> orderDetails) {
this.customer = customer;
this.orderDate = orderDate;
this.requiredDate = requiredDate;
this.shippedDate = shippedDate;
this.status = status;
this.comments = comments;
this.orderDetails = orderDetails;
}
@Id @GeneratedValue(strategy=IDENTITY)
@Column(name="orderNumber", unique=true, nullable=false)
public Integer getOrderNumber() {
return this.orderNumber;
}
public void setOrderNumber(Integer orderNumber) {
this.orderNumber = orderNumber;
}
@ManyToOne(fetch=FetchType.LAZY)
@JoinColumn(name="customerNumber", nullable=false)
public Customer getCustomer() {
return this.customer;
}
public void setCustomer(Customer customer) {
this.customer = customer;
}
@Column(name="orderDate", nullable=false, length=19)
public Date getOrderDate() {
return this.orderDate;
}
public void setOrderDate(Date orderDate) {
this.orderDate = orderDate;
}
@Column(name="requiredDate", nullable=false, length=19)
public Date getRequiredDate() {
return this.requiredDate;
}
public void setRequiredDate(Date requiredDate) {
this.requiredDate = requiredDate;
}
@Column(name="shippedDate", length=19)
public Date getShippedDate() {
return this.shippedDate;
}
public void setShippedDate(Date shippedDate) {
this.shippedDate = shippedDate;
}
@Column(name="status", nullable=false, length=15)
public String getStatus() {
return this.status;
}
public void setStatus(String status) {
this.status = status;
}
@Column(name="comments", length=65535)
public String getComments() {
return this.comments;
}
public void setComments(String comments) {
this.comments = comments;
}
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="order")
public Set<OrderDetail> getOrderDetails() {
return this.orderDetails;
}
public void setOrderDetails(Set<OrderDetail> orderDetails) {
this.orderDetails = orderDetails;
}
}