/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/LecturePK.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 LecturePK implements Serializable {
12
 
        //default serial version id, required for serializable classes.
13
 
        private static final long serialVersionUID = 1L;
14
 
        private Long course;
15
 
        private java.util.Date startTime;
16
 
        private java.util.Date endTime;
17
 
 
18
 
        public LecturePK() {
19
 
        }
20
 
 
21
 
        @Column(insertable=false, updatable=false, unique=true, nullable=false)
22
 
        public Long getCourse() {
23
 
                return this.course;
24
 
        }
25
 
        public void setCourse(Long course) {
26
 
                this.course = course;
27
 
        }
28
 
 
29
 
        @Temporal(TemporalType.TIMESTAMP)
30
 
        @Column(name="start_time", unique=true, nullable=false)
31
 
        public java.util.Date getStartTime() {
32
 
                return this.startTime;
33
 
        }
34
 
        public void setStartTime(java.util.Date startTime) {
35
 
                this.startTime = startTime;
36
 
        }
37
 
 
38
 
        @Temporal(TemporalType.TIMESTAMP)
39
 
        @Column(name="end_time", unique=true, nullable=false)
40
 
        public java.util.Date getEndTime() {
41
 
                return this.endTime;
42
 
        }
43
 
        public void setEndTime(java.util.Date endTime) {
44
 
                this.endTime = endTime;
45
 
        }
46
 
 
47
 
        public boolean equals(Object other) {
48
 
                if (this == other) {
49
 
                        return true;
50
 
                }
51
 
                if (!(other instanceof LecturePK)) {
52
 
                        return false;
53
 
                }
54
 
                LecturePK castOther = (LecturePK)other;
55
 
                return 
56
 
                        this.course.equals(castOther.course)
57
 
                        && this.startTime.equals(castOther.startTime)
58
 
                        && this.endTime.equals(castOther.endTime);
59
 
        }
60
 
 
61
 
        public int hashCode() {
62
 
                final int prime = 31;
63
 
                int hash = 17;
64
 
                hash = hash * prime + this.course.hashCode();
65
 
                hash = hash * prime + this.startTime.hashCode();
66
 
                hash = hash * prime + this.endTime.hashCode();
67
 
                
68
 
                return hash;
69
 
        }
 
12
  // default serial version id, required for serializable classes.
 
13
  private static final long serialVersionUID = 1L;
 
14
  private Long course;
 
15
  private java.util.Date startTime;
 
16
  private java.util.Date endTime;
 
17
 
 
18
  public LecturePK() {
 
19
  }
 
20
 
 
21
  @Column(insertable = false, updatable = false, unique = true, nullable = false)
 
22
  public Long getCourse() {
 
23
    return this.course;
 
24
  }
 
25
 
 
26
  public void setCourse(Long course) {
 
27
    this.course = course;
 
28
  }
 
29
 
 
30
  @Temporal(TemporalType.TIMESTAMP)
 
31
  @Column(name = "start_time", unique = true, nullable = false)
 
32
  public java.util.Date getStartTime() {
 
33
    return this.startTime;
 
34
  }
 
35
 
 
36
  public void setStartTime(java.util.Date startTime) {
 
37
    this.startTime = startTime;
 
38
  }
 
39
 
 
40
  @Temporal(TemporalType.TIMESTAMP)
 
41
  @Column(name = "end_time", unique = true, nullable = false)
 
42
  public java.util.Date getEndTime() {
 
43
    return this.endTime;
 
44
  }
 
45
 
 
46
  public void setEndTime(java.util.Date endTime) {
 
47
    this.endTime = endTime;
 
48
  }
 
49
 
 
50
  public boolean equals(Object other) {
 
51
    if (this == other) {
 
52
      return true;
 
53
    }
 
54
    if (!(other instanceof LecturePK)) {
 
55
      return false;
 
56
    }
 
57
    LecturePK castOther = (LecturePK) other;
 
58
    return this.course.equals(castOther.course) && this.startTime.equals(castOther.startTime)
 
59
        && this.endTime.equals(castOther.endTime);
 
60
  }
 
61
 
 
62
  public int hashCode() {
 
63
    final int prime = 31;
 
64
    int hash = 17;
 
65
    hash = hash * prime + this.course.hashCode();
 
66
    hash = hash * prime + this.startTime.hashCode();
 
67
    hash = hash * prime + this.endTime.hashCode();
 
68
 
 
69
    return hash;
 
70
  }
70
71
}
 
 
b'\\ No newline at end of file'