source: src/main/java/com/example/autopartz/model/Car.java@ f484b14

main
Last change on this file since f484b14 was f484b14, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago

Added full functionality for creating order

  • Property mode set to 100644
File size: 958 bytes
Line 
1package com.example.autopartz.model;
2
3import lombok.Getter;
4import lombok.RequiredArgsConstructor;
5import lombok.Setter;
6import lombok.ToString;
7import org.hibernate.Hibernate;
8
9import javax.persistence.*;
10import java.util.Objects;
11
12@Getter
13@Setter
14@ToString
15@RequiredArgsConstructor
16@Entity
17@Table(name = "car")
18public class Car {
19 @Id
20 @Column(name = "ID_car")
21 Integer id;
22 Integer in_production_since;
23 Integer in_production_till;
24 @Column(name = "car_type")
25 String cartype;
26 @ManyToOne
27 @JoinColumn(name = "id_car_manufacturer")
28 CarManufacturer car_manufacturer;
29
30 @Override
31 public boolean equals(Object o) {
32 if (this == o) return true;
33 if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
34 Car car = (Car) o;
35 return id != null && Objects.equals(id, car.id);
36 }
37
38 @Override
39 public int hashCode() {
40 return getClass().hashCode();
41 }
42}
Note: See TracBrowser for help on using the repository browser.