main
Rev | Line | |
---|
[2e46f06] | 1 | package com.example.autopartz.model;
|
---|
| 2 |
|
---|
[eaf0f1b] | 3 | import jakarta.persistence.*;
|
---|
[2e46f06] | 4 | import lombok.*;
|
---|
| 5 | import org.hibernate.Hibernate;
|
---|
| 6 |
|
---|
[eaf0f1b] | 7 | import java.util.List;
|
---|
[2e46f06] | 8 | import java.util.Objects;
|
---|
| 9 |
|
---|
| 10 | @Getter
|
---|
| 11 | @Setter
|
---|
| 12 | @ToString
|
---|
| 13 | @RequiredArgsConstructor
|
---|
| 14 | @Entity
|
---|
| 15 | @Table(name = "repair_shop")
|
---|
| 16 | public class RepairShop {
|
---|
| 17 | @Id
|
---|
| 18 | Long ID_repair_shop;
|
---|
| 19 | String rs_name;
|
---|
| 20 | String rs_location;
|
---|
| 21 | String rs_phone_number;
|
---|
[eaf0f1b] | 22 | @ManyToMany
|
---|
| 23 | @JoinTable(name = "repair_shop_is_authorized_for_car_make", joinColumns =
|
---|
| 24 | @JoinColumn(name = "id_repair_shop"),
|
---|
| 25 | inverseJoinColumns = @JoinColumn(name = "id_car_manufacturer"))
|
---|
| 26 | @ToString.Exclude
|
---|
| 27 | List<CarManufacturer> carManufacturerList;
|
---|
[2e46f06] | 28 |
|
---|
| 29 | @Override
|
---|
| 30 | public boolean equals(Object o) {
|
---|
| 31 | if (this == o) return true;
|
---|
| 32 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 33 | RepairShop that = (RepairShop) o;
|
---|
| 34 | return ID_repair_shop != null && Objects.equals(ID_repair_shop, that.ID_repair_shop);
|
---|
| 35 | }
|
---|
| 36 |
|
---|
| 37 | @Override
|
---|
| 38 | public int hashCode() {
|
---|
| 39 | return getClass().hashCode();
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.