main
Last change
on this file since f094f6c was 2e46f06, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 22 months ago |
Adding the models and testing one view
|
-
Property mode
set to
100644
|
File size:
997 bytes
|
Line | |
---|
1 | package com.example.autopartz.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.Entity;
|
---|
4 | import jakarta.persistence.Id;
|
---|
5 | import jakarta.persistence.JoinColumn;
|
---|
6 | import jakarta.persistence.ManyToOne;
|
---|
7 | import lombok.*;
|
---|
8 | import org.hibernate.Hibernate;
|
---|
9 |
|
---|
10 | import java.util.Objects;
|
---|
11 |
|
---|
12 | @Getter
|
---|
13 | @Setter
|
---|
14 | @ToString
|
---|
15 | @RequiredArgsConstructor
|
---|
16 | @Entity
|
---|
17 | public class Repair {
|
---|
18 | @Id
|
---|
19 | Long ID_repair;
|
---|
20 | @ManyToOne
|
---|
21 | @JoinColumn(name = "vin")
|
---|
22 | CarSample carSample;
|
---|
23 | @ManyToOne
|
---|
24 | @JoinColumn(name = "id_repair_shop")
|
---|
25 | RepairShop repairShop;
|
---|
26 | @ManyToOne
|
---|
27 | @JoinColumn(name = "id_service_book")
|
---|
28 | ServiceBook serviceBook;
|
---|
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 | Repair repair = (Repair) o;
|
---|
35 | return ID_repair != null && Objects.equals(ID_repair, repair.ID_repair);
|
---|
36 | }
|
---|
37 |
|
---|
38 | @Override
|
---|
39 | public int hashCode() {
|
---|
40 | return getClass().hashCode();
|
---|
41 | }
|
---|
42 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.