/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
 * vi: set shiftwidth=2 tabstop=2 expandtab:
 * :indentSize=2:tabSize=2:noTabs=true:
 */

package db;

import java.io.Serializable;
import javax.persistence.*;

/**
 * The primary key class for the teaches database table.
 * 
 */
@Embeddable
public class TeachPK implements Serializable {
  // default serial version id, required for serializable classes.
  private static final long serialVersionUID = 1L;
  private Long course;
  private Long staff;

  public TeachPK() {
  }

  @Column(insertable = false, updatable = false, unique = true, nullable = false)
  public Long getCourse() {
    return this.course;
  }

  public void setCourse(Long course) {
    this.course = course;
  }

  @Column(insertable = false, updatable = false, unique = true, nullable = false)
  public Long getStaff() {
    return this.staff;
  }

  public void setStaff(Long staff) {
    this.staff = staff;
  }

  public boolean equals(Object other) {
    if (this == other) {
      return true;
    }
    if (!(other instanceof TeachPK)) {
      return false;
    }
    TeachPK castOther = (TeachPK) other;
    return this.course.equals(castOther.course) && this.staff.equals(castOther.staff);
  }

  public int hashCode() {
    final int prime = 31;
    int hash = 17;
    hash = hash * prime + this.course.hashCode();
    hash = hash * prime + this.staff.hashCode();

    return hash;
  }
}