Changeset 84652fb for src/main/java/com/example/autopartz/model
- Timestamp:
- 01/07/23 18:37:26 (23 months ago)
- Branches:
- main
- Children:
- 5e7345e
- Parents:
- 37966cf
- Location:
- src/main/java/com/example/autopartz/model
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
src/main/java/com/example/autopartz/model/Car.java
r37966cf r84652fb 18 18 public class Car { 19 19 @Id 20 @GeneratedValue(strategy = GenerationType.IDENTITY) 20 21 @Column(name = "ID_car") 21 22 Integer id; … … 27 28 @JoinColumn(name = "id_car_manufacturer") 28 29 CarManufacturer car_manufacturer; 30 31 public Car(Integer in_production_since, Integer in_production_till, String cartype, CarManufacturer car_manufacturer) { 32 this.in_production_since = in_production_since; 33 this.in_production_till = in_production_till; 34 this.cartype = cartype; 35 this.car_manufacturer = car_manufacturer; 36 } 29 37 30 38 @Override -
src/main/java/com/example/autopartz/model/CarManufacturer.java
r37966cf r84652fb 7 7 import org.hibernate.Hibernate; 8 8 9 import javax.persistence.Entity; 10 import javax.persistence.Id; 11 import javax.persistence.Table; 9 import javax.persistence.*; 12 10 import java.util.Objects; 13 11 … … 20 18 public class CarManufacturer { 21 19 @Id 22 Integer ID_car_manufacturer; 23 String cm_name; 20 @GeneratedValue(strategy = GenerationType.IDENTITY) 21 @Column(name = "id_car_manufacturer") 22 Integer id; 23 @Column(name = "cm_name") 24 String cmname; 24 25 String cm_country; 26 27 public CarManufacturer(String cmname, String cm_country) { 28 this.cmname = cmname; 29 this.cm_country = cm_country; 30 } 25 31 26 32 @Override … … 29 35 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false; 30 36 CarManufacturer that = (CarManufacturer) o; 31 return ID_car_manufacturer != null && Objects.equals(ID_car_manufacturer, that.ID_car_manufacturer);37 return id != null && Objects.equals(id, that.id); 32 38 } 33 39 -
src/main/java/com/example/autopartz/model/Category.java
r37966cf r84652fb 18 18 @Id 19 19 @Column(name = "id_category") 20 @GeneratedValue(strategy = GenerationType.IDENTITY) 20 21 Integer id; 21 22 @Column(name = "category_name") … … 24 25 @JoinColumn(name = "id_parent_category") 25 26 Category ID_parent_category; 27 28 public Category(String category) { 29 this.cname = category; 30 } 26 31 27 32 @Override -
src/main/java/com/example/autopartz/model/PartManufacturer.java
r37966cf r84652fb 7 7 import org.hibernate.Hibernate; 8 8 9 import javax.persistence.Column; 10 import javax.persistence.Entity; 11 import javax.persistence.Id; 12 import javax.persistence.Table; 9 import javax.persistence.*; 13 10 import java.util.Objects; 14 11 … … 21 18 public class PartManufacturer { 22 19 @Id 20 @GeneratedValue(strategy = GenerationType.IDENTITY) 23 21 @Column(name = "id_part_manufacturer") 24 22 Integer id; … … 26 24 String name; 27 25 String pm_location; 26 27 public PartManufacturer(String name, String location) { 28 this.name = name; 29 this.pm_location = location; 30 } 28 31 29 32 @Override -
src/main/java/com/example/autopartz/model/RepairShop.java
r37966cf r84652fb 20 20 @Id 21 21 @Column(name = "ID_repair_shop") 22 @GeneratedValue(strategy = GenerationType.IDENTITY) 22 23 Integer id; 23 24 @Column(name = "rs_name") … … 34 35 List<CarManufacturer> carManufacturerList; 35 36 37 public RepairShop(String name, String location, String number, List<CarManufacturer> carManufacturerList) { 38 this.name = name; 39 this.location = location; 40 this.number = number; 41 this.carManufacturerList = carManufacturerList; 42 } 43 36 44 @Override 37 45 public boolean equals(Object o) { -
src/main/java/com/example/autopartz/model/Warehouse.java
r37966cf r84652fb 7 7 import org.hibernate.Hibernate; 8 8 9 import javax.persistence.Column; 10 import javax.persistence.Entity; 11 import javax.persistence.Id; 9 import javax.persistence.*; 12 10 import java.util.Objects; 13 11 … … 20 18 @Id 21 19 @Column(name = "id_warehouse") 20 @GeneratedValue(strategy = GenerationType.IDENTITY) 22 21 Integer id; 23 22 @Column(name = "warehouse_location") 24 23 String location; 24 25 public Warehouse(String name) { 26 this.location = name; 27 } 25 28 26 29 @Override -
src/main/java/com/example/autopartz/model/manytomany/RsForCm.java
r37966cf r84652fb 22 22 @Id 23 23 Integer cmid; 24 25 public RsForCm(Integer rsid, Integer cmid) { 26 this.rsid = rsid; 27 this.cmid = cmid; 28 } 24 29 }
Note:
See TracChangeset
for help on using the changeset viewer.