1 | package tech.techharbor.Model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.Data;
|
---|
5 |
|
---|
6 | import java.sql.Date;
|
---|
7 | import java.util.Objects;
|
---|
8 |
|
---|
9 | @Entity
|
---|
10 | @Data
|
---|
11 | @Table(name = "order_table", schema = "project", catalog = "db_202324z_va_prj_techharbor")
|
---|
12 | public class OrderTableModel {
|
---|
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
14 | @Id
|
---|
15 | @Column(name = "order_id", nullable = false)
|
---|
16 | private Integer orderId;
|
---|
17 | @Basic
|
---|
18 | @Column(name = "order_status", nullable = false, length = 100)
|
---|
19 | private String orderStatus;
|
---|
20 | @Basic
|
---|
21 | @Column(name = "order_date", nullable = false)
|
---|
22 | private Date orderDate;
|
---|
23 | @Basic
|
---|
24 | @Column(name = "customer_id", nullable = false)
|
---|
25 | private Integer customerId;
|
---|
26 |
|
---|
27 | public OrderTableModel(String orderStatus, Date orderDate, Integer customerId) {
|
---|
28 | this.orderStatus = orderStatus;
|
---|
29 | this.orderDate = orderDate;
|
---|
30 | this.customerId = customerId;
|
---|
31 | }
|
---|
32 |
|
---|
33 | public OrderTableModel() {
|
---|
34 | }
|
---|
35 |
|
---|
36 | @Override
|
---|
37 | public boolean equals(Object o) {
|
---|
38 | if (this == o) return true;
|
---|
39 | if (o == null || getClass() != o.getClass()) return false;
|
---|
40 | OrderTableModel that = (OrderTableModel) o;
|
---|
41 | return Objects.equals(orderId, that.orderId) && Objects.equals(orderStatus, that.orderStatus) && Objects.equals(orderDate, that.orderDate) && Objects.equals(customerId, that.customerId);
|
---|
42 | }
|
---|
43 |
|
---|
44 | @Override
|
---|
45 | public int hashCode() {
|
---|
46 | return Objects.hash(orderId, orderStatus, orderDate, customerId);
|
---|
47 | }
|
---|
48 | }
|
---|