main
Last change
on this file since 4d67d70 was 4d67d70, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Final touches
|
-
Property mode
set to
100644
|
File size:
982 bytes
|
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.Column;
|
---|
| 10 | import javax.persistence.Entity;
|
---|
| 11 | import javax.persistence.Id;
|
---|
| 12 | import javax.persistence.Table;
|
---|
[2e46f06] | 13 | import java.util.Objects;
|
---|
| 14 |
|
---|
| 15 | @Getter
|
---|
| 16 | @Setter
|
---|
| 17 | @ToString
|
---|
| 18 | @RequiredArgsConstructor
|
---|
| 19 | @Entity
|
---|
| 20 | @Table(name = "part_manufacturer")
|
---|
| 21 | public class PartManufacturer {
|
---|
| 22 | @Id
|
---|
[4d67d70] | 23 | @Column(name = "id_part_manufacturer")
|
---|
| 24 | Integer id;
|
---|
[feffc2f] | 25 | @Column(name = "pm_name")
|
---|
| 26 | String name;
|
---|
[2e46f06] | 27 | String pm_location;
|
---|
| 28 |
|
---|
| 29 | @Override
|
---|
| 30 | public boolean equals(Object o) {
|
---|
| 31 | if (this == o) return true;
|
---|
| 32 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 33 | PartManufacturer that = (PartManufacturer) o;
|
---|
[4d67d70] | 34 | return id != null && Objects.equals(id, that.id);
|
---|
[2e46f06] | 35 | }
|
---|
| 36 |
|
---|
| 37 | @Override
|
---|
| 38 | public int hashCode() {
|
---|
| 39 | return getClass().hashCode();
|
---|
| 40 | }
|
---|
| 41 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.