/magstudentportal/trunk

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
18 by Gustav Hartvigsson
* Added vim modelines
1
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
2
 * vi: set shiftwidth=2 tabstop=2 expandtab:
3
 * :indentSize=2:tabSize=2:noTabs=true:
4
 */
5
27 by Gustav Hartvigsson
* changed DB -> db
6
package db;
15.1.3 by Gustav Hartvigsson
Generated classes from tables and added them.
7
8
import java.io.Serializable;
9
import javax.persistence.*;
10
11
/**
12
 * The primary key class for the teaches database table.
13
 * 
14
 */
15
@Embeddable
16
public class TeachPK implements Serializable {
15.1.6 by Gustav Hartvigsson
* tabs -> 2 spaces
17
  // default serial version id, required for serializable classes.
18
  private static final long serialVersionUID = 1L;
19
  private Long course;
20
  private Long staff;
21
22
  public TeachPK() {
23
  }
24
25
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
26
  public Long getCourse() {
27
    return this.course;
28
  }
29
30
  public void setCourse(Long course) {
31
    this.course = course;
32
  }
33
34
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
35
  public Long getStaff() {
36
    return this.staff;
37
  }
38
39
  public void setStaff(Long staff) {
40
    this.staff = staff;
41
  }
42
43
  public boolean equals(Object other) {
44
    if (this == other) {
45
      return true;
46
    }
47
    if (!(other instanceof TeachPK)) {
48
      return false;
49
    }
50
    TeachPK castOther = (TeachPK) other;
51
    return this.course.equals(castOther.course) && this.staff.equals(castOther.staff);
52
  }
53
54
  public int hashCode() {
55
    final int prime = 31;
56
    int hash = 17;
57
    hash = hash * prime + this.course.hashCode();
58
    hash = hash * prime + this.staff.hashCode();
59
60
    return hash;
61
  }
27 by Gustav Hartvigsson
* changed DB -> db
62
}