main
Last change
on this file since 2e46f06 was 2e46f06, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 19 months ago |
Adding the models and testing one view
|
-
Property mode
set to
100644
|
File size:
844 bytes
|
Rev | Line | |
---|
[2e46f06] | 1 | package com.example.autopartz.model;
|
---|
| 2 |
|
---|
| 3 | import jakarta.persistence.Entity;
|
---|
| 4 | import jakarta.persistence.Id;
|
---|
| 5 | import jakarta.persistence.Table;
|
---|
| 6 | import lombok.*;
|
---|
| 7 | import org.hibernate.Hibernate;
|
---|
| 8 |
|
---|
| 9 | import java.util.Objects;
|
---|
| 10 |
|
---|
| 11 | @Getter
|
---|
| 12 | @Setter
|
---|
| 13 | @ToString
|
---|
| 14 | @RequiredArgsConstructor
|
---|
| 15 | @Entity
|
---|
| 16 | @Table(name = "repair_shop")
|
---|
| 17 | public class RepairShop {
|
---|
| 18 | @Id
|
---|
| 19 | Long ID_repair_shop;
|
---|
| 20 | String rs_name;
|
---|
| 21 | String rs_location;
|
---|
| 22 | String rs_phone_number;
|
---|
| 23 |
|
---|
| 24 | @Override
|
---|
| 25 | public boolean equals(Object o) {
|
---|
| 26 | if (this == o) return true;
|
---|
| 27 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 28 | RepairShop that = (RepairShop) o;
|
---|
| 29 | return ID_repair_shop != null && Objects.equals(ID_repair_shop, that.ID_repair_shop);
|
---|
| 30 | }
|
---|
| 31 |
|
---|
| 32 | @Override
|
---|
| 33 | public int hashCode() {
|
---|
| 34 | return getClass().hashCode();
|
---|
| 35 | }
|
---|
| 36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.