1 package org.hibernate.test.criteria; 3 4 import java.io.Serializable ; 5 6 9 public class Enrolment implements Serializable { 10 private Student student; 11 private Course course; 12 private long studentNumber; 13 private String courseCode; 14 private short year; 15 private short semester; 16 public String getCourseCode() { 17 return courseCode; 18 } 19 public void setCourseCode(String courseId) { 20 this.courseCode = courseId; 21 } 22 public long getStudentNumber() { 23 return studentNumber; 24 } 25 public void setStudentNumber(long studentId) { 26 this.studentNumber = studentId; 27 } 28 public Course getCourse() { 29 return course; 30 } 31 public void setCourse(Course course) { 32 this.course = course; 33 } 34 public Student getStudent() { 35 return student; 36 } 37 public void setStudent(Student student) { 38 this.student = student; 39 } 40 public short getSemester() { 41 return semester; 42 } 43 public void setSemester(short semester) { 44 this.semester = semester; 45 } 46 public short getYear() { 47 return year; 48 } 49 public void setYear(short year) { 50 this.year = year; 51 } 52 53 public boolean equals(Object other) { 54 if ( !(other instanceof Enrolment) ) return false; 55 Enrolment that = (Enrolment) other; 56 return studentNumber==that.studentNumber && 57 courseCode.equals(that.courseCode); 58 } 59 60 public int hashCode() { 61 return courseCode.hashCode(); 62 } 63 } 64 | Popular Tags |