main
Last change
on this file since 60de3eb 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:
844 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.LocalDateTime;
|
---|
8 | import java.util.Objects;
|
---|
9 |
|
---|
10 | @Getter
|
---|
11 | @Setter
|
---|
12 | @ToString
|
---|
13 | @RequiredArgsConstructor
|
---|
14 | @Entity
|
---|
15 | @Table(name = "service_book")
|
---|
16 | public class ServiceBook {
|
---|
17 | @Id
|
---|
18 | Long ID_service_book;
|
---|
19 | LocalDateTime sb_created_on;
|
---|
20 | @OneToOne
|
---|
21 | @JoinColumn(name = "vin")
|
---|
22 | CarSample carSample;
|
---|
23 |
|
---|
24 | @Override
|
---|
25 | public boolean equals(Object o) {
|
---|
26 | if (this == o) return true;
|
---|
27 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
28 | ServiceBook that = (ServiceBook) o;
|
---|
29 | return ID_service_book != null && Objects.equals(ID_service_book, that.ID_service_book);
|
---|
30 | }
|
---|
31 |
|
---|
32 | @Override
|
---|
33 | public int hashCode() {
|
---|
34 | return getClass().hashCode();
|
---|
35 | }
|
---|
36 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.