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 lecture database table.
|
|
8 |
*
|
|
9 |
*/
|
|
10 |
@Embeddable
|
|
11 |
public class LecturePK 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 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 |
} |
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
71 |
}
|