main
Last change
on this file since ae042f4 was ae042f4, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Configured spring security, changed spring version
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Rev | Line | |
---|
[2e46f06] | 1 | package com.example.autopartz.model;
|
---|
| 2 |
|
---|
[ae042f4] | 3 | import lombok.Getter;
|
---|
| 4 | import lombok.RequiredArgsConstructor;
|
---|
| 5 | import lombok.Setter;
|
---|
| 6 | import lombok.ToString;
|
---|
[2e46f06] | 7 | import org.hibernate.Hibernate;
|
---|
| 8 |
|
---|
[ae042f4] | 9 | import javax.persistence.Entity;
|
---|
| 10 | import javax.persistence.Id;
|
---|
| 11 | import javax.persistence.JoinColumn;
|
---|
| 12 | import javax.persistence.ManyToOne;
|
---|
[2e46f06] | 13 | import java.util.Objects;
|
---|
| 14 |
|
---|
| 15 | @Getter
|
---|
| 16 | @Setter
|
---|
| 17 | @ToString
|
---|
| 18 | @RequiredArgsConstructor
|
---|
| 19 | @Entity
|
---|
| 20 | public class Repair {
|
---|
| 21 | @Id
|
---|
[ae042f4] | 22 | Integer ID_repair;
|
---|
[2e46f06] | 23 | @ManyToOne
|
---|
| 24 | @JoinColumn(name = "vin")
|
---|
| 25 | CarSample carSample;
|
---|
| 26 | @ManyToOne
|
---|
| 27 | @JoinColumn(name = "id_repair_shop")
|
---|
| 28 | RepairShop repairShop;
|
---|
| 29 | @ManyToOne
|
---|
| 30 | @JoinColumn(name = "id_service_book")
|
---|
| 31 | ServiceBook serviceBook;
|
---|
| 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 | Repair repair = (Repair) o;
|
---|
| 38 | return ID_repair != null && Objects.equals(ID_repair, repair.ID_repair);
|
---|
| 39 | }
|
---|
| 40 |
|
---|
| 41 | @Override
|
---|
| 42 | public int hashCode() {
|
---|
| 43 | return getClass().hashCode();
|
---|
| 44 | }
|
---|
| 45 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.