main
Last change
on this file since 60de3eb was feffc2f, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Added some views and functionalities
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package com.example.autopartz.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.*;
|
---|
5 | import org.hibernate.Hibernate;
|
---|
6 |
|
---|
7 | import java.util.List;
|
---|
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 | @Column(name = "ID_repair_shop")
|
---|
19 | Long id;
|
---|
20 | @Column(name = "rs_name")
|
---|
21 | String name;
|
---|
22 | @Column(name = "rs_location")
|
---|
23 | String location;
|
---|
24 | @Column(name = "rs_phone_number")
|
---|
25 | String number;
|
---|
26 | @ManyToMany
|
---|
27 | @JoinTable(name = "repair_shop_is_authorized_for_car_make", joinColumns =
|
---|
28 | @JoinColumn(name = "id_repair_shop"),
|
---|
29 | inverseJoinColumns = @JoinColumn(name = "id_car_manufacturer"))
|
---|
30 | @ToString.Exclude
|
---|
31 | List<CarManufacturer> carManufacturerList;
|
---|
32 |
|
---|
33 | @Override
|
---|
34 | public boolean equals(Object o) {
|
---|
35 | if (this == o) return true;
|
---|
36 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
37 | RepairShop that = (RepairShop) o;
|
---|
38 | return id != null && Objects.equals(id, that.id);
|
---|
39 | }
|
---|
40 |
|
---|
41 | @Override
|
---|
42 | public int hashCode() {
|
---|
43 | return getClass().hashCode();
|
---|
44 | }
|
---|
45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.