Last change
on this file since 0e4d807 was 0e4d807, checked in by Ivona <ivonatapshanovska@…>, 10 months ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.3 KB
|
Line | |
---|
1 | package com.example.baziproekt.model.Parce_del_od_naracki;
|
---|
2 |
|
---|
3 | import com.example.baziproekt.model.Naracki;
|
---|
4 | import com.example.baziproekt.model.Parce;
|
---|
5 | import javax.persistence.*;
|
---|
6 |
|
---|
7 | import java.io.Serializable;
|
---|
8 | import java.util.Objects;
|
---|
9 |
|
---|
10 | @Embeddable
|
---|
11 | public class Del_od_CompositeKey implements Serializable {
|
---|
12 |
|
---|
13 | @ManyToOne
|
---|
14 | @JoinColumn(name = "id_parce")
|
---|
15 | private Parce parce;
|
---|
16 | @ManyToOne
|
---|
17 | @JoinColumn(name = "id_naracka")
|
---|
18 | private Naracki naracka;
|
---|
19 |
|
---|
20 | public Naracki getNaracka() {
|
---|
21 | return naracka;
|
---|
22 | }
|
---|
23 |
|
---|
24 | public void setNaracka(Naracki naracka) {
|
---|
25 | this.naracka = naracka;
|
---|
26 | }
|
---|
27 |
|
---|
28 | public Parce getParce() {
|
---|
29 | return parce;
|
---|
30 | }
|
---|
31 |
|
---|
32 | public void setParce(Parce parce) {
|
---|
33 | this.parce = parce;
|
---|
34 | }
|
---|
35 |
|
---|
36 | public Del_od_CompositeKey() {
|
---|
37 | }
|
---|
38 |
|
---|
39 | public Del_od_CompositeKey(Parce parce, Naracki naracka) {
|
---|
40 | this.parce = parce;
|
---|
41 | this.naracka = naracka;
|
---|
42 | }
|
---|
43 |
|
---|
44 | @Override
|
---|
45 | public boolean equals(Object o) {
|
---|
46 | if (this == o) return true;
|
---|
47 | if (o == null || getClass() != o.getClass()) return false;
|
---|
48 | Del_od_CompositeKey that = (Del_od_CompositeKey) o;
|
---|
49 | return Objects.equals(parce, that.parce) && Objects.equals(naracka, that.naracka);
|
---|
50 | }
|
---|
51 |
|
---|
52 | @Override
|
---|
53 | public int hashCode() {
|
---|
54 | return Objects.hash(parce, naracka);
|
---|
55 | }
|
---|
56 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.