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:
739 bytes
|
Line | |
---|
1 | package com.example.autopartz.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.Entity;
|
---|
4 | import jakarta.persistence.Id;
|
---|
5 | import lombok.*;
|
---|
6 | import org.hibernate.Hibernate;
|
---|
7 |
|
---|
8 | import java.util.Objects;
|
---|
9 |
|
---|
10 | @Getter
|
---|
11 | @Setter
|
---|
12 | @ToString
|
---|
13 | @RequiredArgsConstructor
|
---|
14 | @Entity
|
---|
15 | public class Warehouse {
|
---|
16 | @Id
|
---|
17 | Long ID_warehouse;
|
---|
18 | String warehouse_location;
|
---|
19 |
|
---|
20 | @Override
|
---|
21 | public boolean equals(Object o) {
|
---|
22 | if (this == o) return true;
|
---|
23 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
24 | Warehouse warehouse = (Warehouse) o;
|
---|
25 | return ID_warehouse != null && Objects.equals(ID_warehouse, warehouse.ID_warehouse);
|
---|
26 | }
|
---|
27 |
|
---|
28 | @Override
|
---|
29 | public int hashCode() {
|
---|
30 | return getClass().hashCode();
|
---|
31 | }
|
---|
32 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.