Changeset f484b14 for src/main/java/com/example/autopartz/model
- Timestamp:
- 01/06/23 02:51:45 (23 months ago)
- Branches:
- main
- Children:
- d4b888e
- Parents:
- 1bd8d1e
- Location:
- src/main/java/com/example/autopartz/model
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/model/Car.java
r1bd8d1e rf484b14 18 18 public class Car { 19 19 @Id 20 Integer ID_car; 20 @Column(name = "ID_car") 21 Integer id; 21 22 Integer in_production_since; 22 23 Integer in_production_till; … … 32 33 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; 33 34 Car car = (Car) o; 34 return ID_car != null && Objects.equals(ID_car, car.ID_car);35 return id != null && Objects.equals(id, car.id); 35 36 } 36 37 -
src/main/java/com/example/autopartz/model/CarSample.java
r1bd8d1e rf484b14 31 31 Car car; 32 32 33 34 public CarSample(Integer vin,Integer year_of_production, Integer engine_power, Integer displacement, String fuel_type, Integer km_driven, Client client, Car car) { 35 this.vin = vin; 36 this.year_of_production = year_of_production; 37 this.engine_power = engine_power; 38 this.displacement = displacement; 39 this.fuel_type = fuel_type; 40 this.km_driven = km_driven; 41 this.client = client; 42 this.car = car; 43 } 44 33 45 @Override 34 46 public boolean equals(Object o) { -
src/main/java/com/example/autopartz/model/Delivery.java
r1bd8d1e rf484b14 17 17 public class Delivery { 18 18 @Id 19 @GeneratedValue(strategy = GenerationType.IDENTITY) 19 20 Integer ID_delivery; 20 21 @Column(name = "delivery_status") … … 28 29 @OneToOne 29 30 Order order; 31 32 public Delivery(String status, String address, Deliveryman deliveryman, Order order) { 33 this.status = status; 34 this.address = address; 35 this.deliveryman = deliveryman; 36 this.order = order; 37 } 30 38 31 39 @Override -
src/main/java/com/example/autopartz/model/Repair.java
r1bd8d1e rf484b14 17 17 public class Repair { 18 18 @Id 19 @GeneratedValue(strategy = GenerationType.IDENTITY) 19 20 Integer ID_repair; 20 21 @OneToOne … … 27 28 @JoinColumn(name = "id_service_book") 28 29 ServiceBook serviceBook; 30 31 public Repair(Order order, RepairShop repairShop, ServiceBook serviceBook) { 32 this.order = order; 33 this.repairShop = repairShop; 34 this.serviceBook = serviceBook; 35 } 29 36 30 37 @Override -
src/main/java/com/example/autopartz/model/ServiceBook.java
r1bd8d1e rf484b14 19 19 public class ServiceBook { 20 20 @Id 21 Integer ID_service_book; 21 @Column(name = "ID_service_book") 22 @GeneratedValue(strategy = GenerationType.IDENTITY) 23 Integer id; 22 24 LocalDateTime sb_created_on; 23 25 @OneToOne 24 26 @JoinColumn(name = "vin") 25 27 CarSample carSample; 28 29 public ServiceBook(CarSample carSample) { 30 this.sb_created_on = LocalDateTime.now(); 31 this.carSample = carSample; 32 } 26 33 27 34 @Override … … 30 37 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; 31 38 ServiceBook that = (ServiceBook) o; 32 return ID_service_book != null && Objects.equals(ID_service_book, that.ID_service_book);39 return id != null && Objects.equals(id, that.id); 33 40 } 34 41
Note:
See TracChangeset
for help on using the changeset viewer.