main
Last change
on this file since d4b888e was ae042f4, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 20 months ago |
Configured spring security, changed spring version
|
-
Property mode
set to
100644
|
File size:
998 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.Entity;
|
---|
| 10 | import javax.persistence.Id;
|
---|
| 11 | import javax.persistence.JoinColumn;
|
---|
| 12 | import javax.persistence.ManyToOne;
|
---|
[2e46f06] | 13 | import java.time.LocalDate;
|
---|
| 14 | import java.util.Objects;
|
---|
| 15 |
|
---|
| 16 | @Entity
|
---|
| 17 | @Getter
|
---|
| 18 | @Setter
|
---|
| 19 | @ToString
|
---|
| 20 | @RequiredArgsConstructor
|
---|
| 21 | public class Price {
|
---|
| 22 | @Id
|
---|
[ae042f4] | 23 | Integer ID_price;
|
---|
[2e46f06] | 24 | Integer amount;
|
---|
| 25 | LocalDate price_from;
|
---|
| 26 | LocalDate price_till;
|
---|
| 27 | @ManyToOne
|
---|
| 28 | @JoinColumn(name = "id_part")
|
---|
| 29 | Part part;
|
---|
| 30 |
|
---|
| 31 | @Override
|
---|
| 32 | public boolean equals(Object o) {
|
---|
| 33 | if (this == o) return true;
|
---|
| 34 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
| 35 | Price price = (Price) o;
|
---|
| 36 | return ID_price != null && Objects.equals(ID_price, price.ID_price);
|
---|
| 37 | }
|
---|
| 38 |
|
---|
| 39 | @Override
|
---|
| 40 | public int hashCode() {
|
---|
| 41 | return getClass().hashCode();
|
---|
| 42 | }
|
---|
| 43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.