/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 lecture database table.
13
 * 
14
 */
15
@Embeddable
16
public class LecturePK 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 java.util.Date startTime;
21
  private java.util.Date endTime;
22
23
  public LecturePK() {
24
  }
25
26
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
27
  public Long getCourse() {
28
    return this.course;
29
  }
30
31
  public void setCourse(Long course) {
32
    this.course = course;
33
  }
34
35
  @Temporal(TemporalType.TIMESTAMP)
36
  @Column(name = "start_time", unique = true, nullable = false)
37
  public java.util.Date getStartTime() {
38
    return this.startTime;
39
  }
40
41
  public void setStartTime(java.util.Date startTime) {
42
    this.startTime = startTime;
43
  }
44
45
  @Temporal(TemporalType.TIMESTAMP)
46
  @Column(name = "end_time", unique = true, nullable = false)
47
  public java.util.Date getEndTime() {
48
    return this.endTime;
49
  }
50
51
  public void setEndTime(java.util.Date endTime) {
52
    this.endTime = endTime;
53
  }
54
55
  public boolean equals(Object other) {
56
    if (this == other) {
57
      return true;
58
    }
59
    if (!(other instanceof LecturePK)) {
60
      return false;
61
    }
62
    LecturePK castOther = (LecturePK) other;
63
    return this.course.equals(castOther.course) && this.startTime.equals(castOther.startTime)
64
        && this.endTime.equals(castOther.endTime);
65
  }
66
67
  public int hashCode() {
68
    final int prime = 31;
69
    int hash = 17;
70
    hash = hash * prime + this.course.hashCode();
71
    hash = hash * prime + this.startTime.hashCode();
72
    hash = hash * prime + this.endTime.hashCode();
73
74
    return hash;
75
  }
27 by Gustav Hartvigsson
* changed DB -> db
76
}