bzr branch
http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
1 |
package DB; |
2 |
||
3 |
import java.io.Serializable; |
|
4 |
import javax.persistence.*; |
|
5 |
||
6 |
/**
|
|
7 |
* The primary key class for the teaches database table.
|
|
8 |
*
|
|
9 |
*/
|
|
10 |
@Embeddable
|
|
11 |
public class TeachPK implements Serializable { |
|
|
15.1.6
by Gustav Hartvigsson
* tabs -> 2 spaces |
12 |
// default serial version id, required for serializable classes. |
13 |
private static final long serialVersionUID = 1L; |
|
14 |
private Long course; |
|
15 |
private Long staff; |
|
16 |
||
17 |
public TeachPK() { |
|
18 |
} |
|
19 |
||
20 |
@Column(insertable = false, updatable = false, unique = true, nullable = false) |
|
21 |
public Long getCourse() { |
|
22 |
return this.course; |
|
23 |
} |
|
24 |
||
25 |
public void setCourse(Long course) { |
|
26 |
this.course = course; |
|
27 |
} |
|
28 |
||
29 |
@Column(insertable = false, updatable = false, unique = true, nullable = false) |
|
30 |
public Long getStaff() { |
|
31 |
return this.staff; |
|
32 |
} |
|
33 |
||
34 |
public void setStaff(Long staff) { |
|
35 |
this.staff = staff; |
|
36 |
} |
|
37 |
||
38 |
public boolean equals(Object other) { |
|
39 |
if (this == other) { |
|
40 |
return true; |
|
41 |
} |
|
42 |
if (!(other instanceof TeachPK)) { |
|
43 |
return false; |
|
44 |
} |
|
45 |
TeachPK castOther = (TeachPK) other; |
|
46 |
return this.course.equals(castOther.course) && this.staff.equals(castOther.staff); |
|
47 |
} |
|
48 |
||
49 |
public int hashCode() { |
|
50 |
final int prime = 31; |
|
51 |
int hash = 17; |
|
52 |
hash = hash * prime + this.course.hashCode(); |
|
53 |
hash = hash * prime + this.staff.hashCode(); |
|
54 |
||
55 |
return hash; |
|
56 |
} |
|
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
57 |
}
|