View Javadoc

1   package com.germinus.merlin.model;
2   
3   // Generated 14-ene-2008 11:39:32 by Hibernate Tools 3.2.0.CR1
4   
5   import javax.persistence.Column;
6   import javax.persistence.Embeddable;
7   
8   /**
9    * StudentsId generated by hbm2java
10   */
11  @Embeddable
12  public class StudentsId implements java.io.Serializable {
13  
14  	/**
15  	 * @author David Jiménez, Germinus XXI
16  	 * @since 1.0
17  	*/
18  	private static final long serialVersionUID = -596625269129406578L;
19  	private long userid;
20  	private long courseid;
21  
22  	public StudentsId() {
23  	}
24  
25  	public StudentsId(long userUserid, long courseCourseid) {
26  		this.userid = userUserid;
27  		this.courseid = courseCourseid;
28  	}
29  
30  	@Column(name = "Student_userid", nullable = false)
31  	public long getUserid() {
32  		return this.userid;
33  	}
34  
35  	public void setUserid(long userUserid) {
36  		this.userid = userUserid;
37  	}
38  
39  	@Column(name = "Student_courseid", nullable = false)
40  	public long getCourseid() {
41  		return this.courseid;
42  	}
43  
44  	public void setCourseid(long courseCourseid) {
45  		this.courseid = courseCourseid;
46  	}
47  
48  	public boolean equals(Object other) {
49  		if ((this == other))
50  			return true;
51  		if ((other == null))
52  			return false;
53  		if (!(other instanceof StudentsId))
54  			return false;
55  		StudentsId castOther = (StudentsId) other;
56  
57  		return (this.getUserid() == castOther.getUserid())
58  				&& (this.getCourseid() == castOther.getCourseid());
59  	}
60  
61  	public int hashCode() {
62  		int result = 17;
63  
64  		result = 37 * result + (int) this.getUserid();
65  		result = 37 * result + (int) this.getCourseid();
66  		return result;
67  	}
68  
69  }