- Timestamp:
- 01/07/23 18:37:26 (23 months ago)
- Branches:
- main
- Children:
- 5e7345e
- Parents:
- 37966cf
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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
Note:
See TracChangeset
for help on using the changeset viewer.