/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk

« back to all changes in this revision

Viewing changes to src/main/java/db/TeachPK.java

  • Committer: Gustav Hartvigsson
  • Date: 2017-08-18 12:02:27 UTC
  • mto: (15.1.9 magstudentportal-more-db)
  • mto: This revision was merged to the branch mainline in revision 17.
  • Revision ID: gustav.hartvigsson@gmail.com-20170818120227-l7ltgppcssfk3y5e
* tabs -> 2 spaces

Show diffs side-by-side

added added

removed removed

Lines of Context:
9
9
 */
10
10
@Embeddable
11
11
public class TeachPK implements Serializable {
12
 
        //default serial version id, required for serializable classes.
13
 
        private static final long serialVersionUID = 1L;
14
 
        private Long course;
15
 
        private Long staff;
16
 
 
17
 
        public TeachPK() {
18
 
        }
19
 
 
20
 
        @Column(insertable=false, updatable=false, unique=true, nullable=false)
21
 
        public Long getCourse() {
22
 
                return this.course;
23
 
        }
24
 
        public void setCourse(Long course) {
25
 
                this.course = course;
26
 
        }
27
 
 
28
 
        @Column(insertable=false, updatable=false, unique=true, nullable=false)
29
 
        public Long getStaff() {
30
 
                return this.staff;
31
 
        }
32
 
        public void setStaff(Long staff) {
33
 
                this.staff = staff;
34
 
        }
35
 
 
36
 
        public boolean equals(Object other) {
37
 
                if (this == other) {
38
 
                        return true;
39
 
                }
40
 
                if (!(other instanceof TeachPK)) {
41
 
                        return false;
42
 
                }
43
 
                TeachPK castOther = (TeachPK)other;
44
 
                return 
45
 
                        this.course.equals(castOther.course)
46
 
                        && this.staff.equals(castOther.staff);
47
 
        }
48
 
 
49
 
        public int hashCode() {
50
 
                final int prime = 31;
51
 
                int hash = 17;
52
 
                hash = hash * prime + this.course.hashCode();
53
 
                hash = hash * prime + this.staff.hashCode();
54
 
                
55
 
                return hash;
56
 
        }
 
12
  // default serial version id, required for serializable classes.
 
13
  private static final long serialVersionUID = 1L;
 
14
  private Long course;
 
15
  private Long staff;
 
16
 
 
17
  public TeachPK() {
 
18
  }
 
19
 
 
20
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
 
21
  public Long getCourse() {
 
22
    return this.course;
 
23
  }
 
24
 
 
25
  public void setCourse(Long course) {
 
26
    this.course = course;
 
27
  }
 
28
 
 
29
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
 
30
  public Long getStaff() {
 
31
    return this.staff;
 
32
  }
 
33
 
 
34
  public void setStaff(Long staff) {
 
35
    this.staff = staff;
 
36
  }
 
37
 
 
38
  public boolean equals(Object other) {
 
39
    if (this == other) {
 
40
      return true;
 
41
    }
 
42
    if (!(other instanceof TeachPK)) {
 
43
      return false;
 
44
    }
 
45
    TeachPK castOther = (TeachPK) other;
 
46
    return this.course.equals(castOther.course) && this.staff.equals(castOther.staff);
 
47
  }
 
48
 
 
49
  public int hashCode() {
 
50
    final int prime = 31;
 
51
    int hash = 17;
 
52
    hash = hash * prime + this.course.hashCode();
 
53
    hash = hash * prime + this.staff.hashCode();
 
54
 
 
55
    return hash;
 
56
  }
57
57
}
 
 
b'\\ No newline at end of file'