source: src/main/java/com/example/autopartz/model/Warehouseman.java@ 2e46f06

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: 855 bytes
Line 
1package com.example.autopartz.model;
2
3import jakarta.persistence.Entity;
4import jakarta.persistence.JoinColumn;
5import jakarta.persistence.ManyToOne;
6import lombok.*;
7import org.hibernate.Hibernate;
8
9import java.time.LocalDate;
10import java.util.Objects;
11
12@Getter
13@Setter
14@ToString
15@RequiredArgsConstructor
16@Entity
17public class Warehouseman extends User{
18 LocalDate employed_from;
19 @ManyToOne
20 @JoinColumn(name = "id_warehouse")
21 Warehouse warehouse;
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 Warehouseman that = (Warehouseman) o;
28 return ID_user != null && Objects.equals(ID_user, that.ID_user);
29 }
30
31 @Override
32 public int hashCode() {
33 return getClass().hashCode();
34 }
35}
Note: See TracBrowser for help on using the repository browser.