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:
875 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 = "car_manufacturer", schema = "project")
|
---|
| 17 | public class CarManufacturer {
|
---|
| 18 | @Id
|
---|
| 19 | Long ID_car_manufacturer;
|
---|
| 20 | String cm_name;
|
---|
| 21 | String cm_country;
|
---|
| 22 |
|
---|
| 23 | @Override
|
---|
| 24 | public boolean equals(Object o) {
|
---|
| 25 | if (this == o) return true;
|
---|
| 26 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 27 | CarManufacturer that = (CarManufacturer) o;
|
---|
| 28 | return ID_car_manufacturer != null && Objects.equals(ID_car_manufacturer, that.ID_car_manufacturer);
|
---|
| 29 | }
|
---|
| 30 |
|
---|
| 31 | @Override
|
---|
| 32 | public int hashCode() {
|
---|
| 33 | return getClass().hashCode();
|
---|
| 34 | }
|
---|
| 35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.