/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/StudentAttendancePK.java

  • Committer: Gustav Hartvigsson
  • Date: 2017-08-28 14:00:50 UTC
  • mfrom: (15.1.3 magstudentportal-more-db)
  • Revision ID: gustav.hartvigsson@gmail.com-20170828140050-zu6nqc1vlp9wnwh8
* derp?

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
package DB;
 
2
 
 
3
import java.io.Serializable;
 
4
import javax.persistence.*;
 
5
 
 
6
/**
 
7
 * The primary key class for the student_attendance database table.
 
8
 * 
 
9
 */
 
10
@Embeddable
 
11
public class StudentAttendancePK implements Serializable {
 
12
        //default serial version id, required for serializable classes.
 
13
        private static final long serialVersionUID = 1L;
 
14
        private Long lectureCourse;
 
15
        private java.util.Date lectureStartTime;
 
16
        private java.util.Date lectureEndTime;
 
17
        private Long student;
 
18
 
 
19
        public StudentAttendancePK() {
 
20
        }
 
21
 
 
22
        @Column(name="lecture_course", insertable=false, updatable=false, unique=true, nullable=false)
 
23
        public Long getLectureCourse() {
 
24
                return this.lectureCourse;
 
25
        }
 
26
        public void setLectureCourse(Long lectureCourse) {
 
27
                this.lectureCourse = lectureCourse;
 
28
        }
 
29
 
 
30
        @Temporal(TemporalType.TIMESTAMP)
 
31
        @Column(name="lecture_start_time", insertable=false, updatable=false, unique=true, nullable=false)
 
32
        public java.util.Date getLectureStartTime() {
 
33
                return this.lectureStartTime;
 
34
        }
 
35
        public void setLectureStartTime(java.util.Date lectureStartTime) {
 
36
                this.lectureStartTime = lectureStartTime;
 
37
        }
 
38
 
 
39
        @Temporal(TemporalType.TIMESTAMP)
 
40
        @Column(name="lecture_end_time", insertable=false, updatable=false, unique=true, nullable=false)
 
41
        public java.util.Date getLectureEndTime() {
 
42
                return this.lectureEndTime;
 
43
        }
 
44
        public void setLectureEndTime(java.util.Date lectureEndTime) {
 
45
                this.lectureEndTime = lectureEndTime;
 
46
        }
 
47
 
 
48
        @Column(insertable=false, updatable=false, unique=true, nullable=false)
 
49
        public Long getStudent() {
 
50
                return this.student;
 
51
        }
 
52
        public void setStudent(Long student) {
 
53
                this.student = student;
 
54
        }
 
55
 
 
56
        public boolean equals(Object other) {
 
57
                if (this == other) {
 
58
                        return true;
 
59
                }
 
60
                if (!(other instanceof StudentAttendancePK)) {
 
61
                        return false;
 
62
                }
 
63
                StudentAttendancePK castOther = (StudentAttendancePK)other;
 
64
                return 
 
65
                        this.lectureCourse.equals(castOther.lectureCourse)
 
66
                        && this.lectureStartTime.equals(castOther.lectureStartTime)
 
67
                        && this.lectureEndTime.equals(castOther.lectureEndTime)
 
68
                        && this.student.equals(castOther.student);
 
69
        }
 
70
 
 
71
        public int hashCode() {
 
72
                final int prime = 31;
 
73
                int hash = 17;
 
74
                hash = hash * prime + this.lectureCourse.hashCode();
 
75
                hash = hash * prime + this.lectureStartTime.hashCode();
 
76
                hash = hash * prime + this.lectureEndTime.hashCode();
 
77
                hash = hash * prime + this.student.hashCode();
 
78
                
 
79
                return hash;
 
80
        }
 
81
}
 
 
b'\\ No newline at end of file'