1 package com.germinus.merlin.model;
2
3
4
5 import javax.persistence.Column;
6 import javax.persistence.Embeddable;
7
8
9
10
11 @Embeddable
12 public class TeachersId implements java.io.Serializable {
13
14
15
16
17
18 private static final long serialVersionUID = 6598528621185484343L;
19 private long userid;
20 private long courseid;
21
22 public TeachersId() {
23 }
24
25 public TeachersId(long userid, long courseid) {
26 this.userid = userid;
27 this.courseid = courseid;
28 }
29
30 @Column(name = "Teacher_userid", nullable = false)
31 public long getUserid() {
32 return this.userid;
33 }
34
35 public void setUserid(long userUserid) {
36 this.userid = userUserid;
37 }
38
39 @Column(name = "Teacher_courseid", nullable = false)
40 public long getCourseid() {
41 return this.courseid;
42 }
43
44 public void setCourseid(long courseid) {
45 this.courseid = courseid;
46 }
47
48 public boolean equals(Object other) {
49 if ((this == other))
50 return true;
51 if ((other == null))
52 return false;
53 if (!(other instanceof TeachersId))
54 return false;
55 TeachersId castOther = (TeachersId) other;
56
57 return (this.getUserid() == castOther.getUserid())
58 && (this.getCourseid() == castOther.getCourseid());
59 }
60
61 public int hashCode() {
62 int result = 17;
63
64 result = 37 * result + (int) this.getUserid();
65 result = 37 * result + (int) this.getCourseid();
66 return result;
67 }
68
69 }