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