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 = "vehicle", schema = "project", catalog = "db_202324z_va_prj_techharbor")
|
---|
12 | public class VehicleModel {
|
---|
13 | @GeneratedValue(strategy = GenerationType.IDENTITY)
|
---|
14 | @Id
|
---|
15 | @Column(name = "vehicle_id", nullable = false)
|
---|
16 | private Integer vehicleId;
|
---|
17 | @Basic
|
---|
18 | @Column(name = "vehicle_model", length = 100)
|
---|
19 | private String vehicleModel;
|
---|
20 | @Basic
|
---|
21 | @Column(name = "vehicle_service")
|
---|
22 | private Date vehicleService;
|
---|
23 | @Basic
|
---|
24 | @Column(name = "delivery_man_id", nullable = false)
|
---|
25 | private Integer deliveryManId;
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public boolean equals(Object o) {
|
---|
29 | if (this == o) return true;
|
---|
30 | if (o == null || getClass() != o.getClass()) return false;
|
---|
31 | VehicleModel that = (VehicleModel) o;
|
---|
32 | return Objects.equals(vehicleId, that.vehicleId) && Objects.equals(vehicleModel, that.vehicleModel) && Objects.equals(vehicleService, that.vehicleService) && Objects.equals(deliveryManId, that.deliveryManId);
|
---|
33 | }
|
---|
34 |
|
---|
35 | @Override
|
---|
36 | public int hashCode() {
|
---|
37 | return Objects.hash(vehicleId, vehicleModel, vehicleService, deliveryManId);
|
---|
38 | }
|
---|
39 | }
|
---|