main
Last change
on this file since 6832924 was 60de3eb, checked in by andrejtodorovski <82031894+andrejtodorovski@…>, 18 months ago |
Added master template and added filtering parts by car and category
|
-
Property mode
set to
100644
|
File size:
810 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.util.Objects;
|
---|
8 |
|
---|
9 | @Getter
|
---|
10 | @Setter
|
---|
11 | @ToString
|
---|
12 | @RequiredArgsConstructor
|
---|
13 | @Entity
|
---|
14 | public class Category {
|
---|
15 | @Id
|
---|
16 | Long ID_category;
|
---|
17 | @Column(name = "category_name")
|
---|
18 | String cname;
|
---|
19 | @ManyToOne
|
---|
20 | @JoinColumn(name = "id_parent_category")
|
---|
21 | Category ID_parent_category;
|
---|
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 | Category category = (Category) o;
|
---|
28 | return ID_category != null && Objects.equals(ID_category, category.ID_category);
|
---|
29 | }
|
---|
30 |
|
---|
31 | @Override
|
---|
32 | public int hashCode() {
|
---|
33 | return getClass().hashCode();
|
---|
34 | }
|
---|
35 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.