main
Last change
on this file since 101cbe2 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:
706 bytes
|
Line | |
---|
1 | package com.example.autopartz.model;
|
---|
2 |
|
---|
3 | import jakarta.persistence.*;
|
---|
4 | import lombok.*;
|
---|
5 | import org.hibernate.Hibernate;
|
---|
6 |
|
---|
7 | import java.time.LocalDate;
|
---|
8 | import java.util.Objects;
|
---|
9 |
|
---|
10 | @Getter
|
---|
11 | @Setter
|
---|
12 | @ToString
|
---|
13 | @Entity
|
---|
14 | public class Administrator extends User{
|
---|
15 | LocalDate authorized_from;
|
---|
16 | LocalDate authorized_till;
|
---|
17 |
|
---|
18 |
|
---|
19 | @Override
|
---|
20 | public boolean equals(Object o) {
|
---|
21 | if (this == o) return true;
|
---|
22 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
23 | Administrator that = (Administrator) o;
|
---|
24 | return ID_user != null && Objects.equals(ID_user, that.ID_user);
|
---|
25 | }
|
---|
26 |
|
---|
27 | @Override
|
---|
28 | public int hashCode() {
|
---|
29 | return getClass().hashCode();
|
---|
30 | }
|
---|
31 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.