Last change
on this file was d3cf3a1, checked in by Marija Micevska <marija_micevska@…>, 2 years ago |
Initial commit
|
-
Property mode
set to
100644
|
File size:
1.1 KB
|
Line | |
---|
1 | package project.educatum.model.primarykeys;
|
---|
2 |
|
---|
3 | import lombok.Data;
|
---|
4 | import org.hibernate.Hibernate;
|
---|
5 |
|
---|
6 | import javax.persistence.Column;
|
---|
7 | import javax.persistence.Embeddable;
|
---|
8 | import java.io.Serializable;
|
---|
9 | import java.util.Objects;
|
---|
10 |
|
---|
11 | @Data
|
---|
12 | @Embeddable
|
---|
13 | public class ListeningID implements Serializable {
|
---|
14 |
|
---|
15 | private static final long serialVersionUID = -8688686914310645850L;
|
---|
16 | @Column(name = "id_cas", nullable = false)
|
---|
17 | private Integer idClass;
|
---|
18 | @Column(name = "id_slusanje", nullable = false)
|
---|
19 | private Integer idListening;
|
---|
20 |
|
---|
21 | public ListeningID(Integer idClass, Integer idListening) {
|
---|
22 | this.idClass = idClass;
|
---|
23 | this.idListening = idListening;
|
---|
24 | }
|
---|
25 |
|
---|
26 | public ListeningID() {
|
---|
27 |
|
---|
28 | }
|
---|
29 |
|
---|
30 | @Override
|
---|
31 | public int hashCode() {
|
---|
32 | return Objects.hash(idClass, idListening);
|
---|
33 | }
|
---|
34 |
|
---|
35 | @Override
|
---|
36 | public boolean equals(Object o) {
|
---|
37 | if (this == o) return true;
|
---|
38 | if (o == null || Hibernate.getClass(this) != Hibernate.getClass(o)) return false;
|
---|
39 | ListeningID entity = (ListeningID) o;
|
---|
40 | return Objects.equals(this.idClass, entity.idListening) &&
|
---|
41 | Objects.equals(this.idListening, entity.idListening);
|
---|
42 | }
|
---|
43 | } |
---|
Note:
See
TracBrowser
for help on using the repository browser.