Ignore:
Timestamp:
01/07/23 18:37:26 (23 months ago)
Author:
andrejtodorovski <82031894+andrejtodorovski@…>
Branches:
main
Children:
5e7345e
Parents:
37966cf
Message:

Admin views for adding things to the database

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/main/java/com/example/autopartz/model/CarManufacturer.java

    r37966cf r84652fb  
    77import org.hibernate.Hibernate;
    88
    9 import javax.persistence.Entity;
    10 import javax.persistence.Id;
    11 import javax.persistence.Table;
     9import javax.persistence.*;
    1210import java.util.Objects;
    1311
     
    2018public class CarManufacturer {
    2119    @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;
    2425    String cm_country;
     26
     27    public CarManufacturer(String cmname, String cm_country) {
     28        this.cmname = cmname;
     29        this.cm_country = cm_country;
     30    }
    2531
    2632    @Override
     
    2935        if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
    3036        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);
    3238    }
    3339
Note: See TracChangeset for help on using the changeset viewer.