bzr branch
http://gegoxaren.bato24.eu/bzr/magstudentportal/trunk
|
18
by Gustav Hartvigsson
* Added vim modelines |
1 |
/* c-basic-offset: 2; tab-width: 2; indent-tabs-mode: nil
|
2 |
* vi: set shiftwidth=2 tabstop=2 expandtab:
|
|
3 |
* :indentSize=2:tabSize=2:noTabs=true:
|
|
4 |
*/
|
|
5 |
||
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
6 |
package DB; |
7 |
||
8 |
import java.io.Serializable; |
|
9 |
import javax.persistence.*; |
|
10 |
||
11 |
/**
|
|
12 |
* The persistent class for the staff database table.
|
|
13 |
*
|
|
14 |
*/
|
|
15 |
@Entity
|
|
|
15.1.6
by Gustav Hartvigsson
* tabs -> 2 spaces |
16 |
@Table(name = "staff") |
17 |
@NamedQuery(name = "Staff.findAll", query = "SELECT s FROM Staff s") |
|
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
18 |
public class Staff implements Serializable { |
|
15.1.6
by Gustav Hartvigsson
* tabs -> 2 spaces |
19 |
private static final long serialVersionUID = 1L; |
20 |
private Integer id; |
|
21 |
private String nameFirst; |
|
22 |
private String nameLast; |
|
23 |
private String pwd; |
|
24 |
private String userName; |
|
25 |
private StaffType staffTypeBean; |
|
26 |
||
27 |
public Staff() { |
|
28 |
} |
|
29 |
||
30 |
@Id |
|
31 |
@GeneratedValue(strategy = GenerationType.AUTO) |
|
32 |
@Column(unique = true, nullable = false) |
|
33 |
public Integer getId() { |
|
34 |
return this.id; |
|
35 |
} |
|
36 |
||
37 |
public void setId(Integer id) { |
|
38 |
this.id = id; |
|
39 |
} |
|
40 |
||
41 |
@Column(name = "name_first", nullable = false, length = 32) |
|
42 |
public String getNameFirst() { |
|
43 |
return this.nameFirst; |
|
44 |
} |
|
45 |
||
46 |
public void setNameFirst(String nameFirst) { |
|
47 |
this.nameFirst = nameFirst; |
|
48 |
} |
|
49 |
||
50 |
@Column(name = "name_last", nullable = false, length = 32) |
|
51 |
public String getNameLast() { |
|
52 |
return this.nameLast; |
|
53 |
} |
|
54 |
||
55 |
public void setNameLast(String nameLast) { |
|
56 |
this.nameLast = nameLast; |
|
57 |
} |
|
58 |
||
59 |
@Column(nullable = false, length = 256) |
|
60 |
public String getPwd() { |
|
61 |
return this.pwd; |
|
62 |
} |
|
63 |
||
64 |
public void setPwd(String pwd) { |
|
65 |
this.pwd = pwd; |
|
66 |
} |
|
67 |
||
68 |
@Column(name = "user_name", nullable = false, length = 32) |
|
69 |
public String getUserName() { |
|
70 |
return this.userName; |
|
71 |
} |
|
72 |
||
73 |
public void setUserName(String userName) { |
|
74 |
this.userName = userName; |
|
75 |
} |
|
76 |
||
77 |
// bi-directional many-to-one association to StaffType |
|
78 |
@ManyToOne |
|
79 |
@JoinColumn(name = "staff_type") |
|
80 |
public StaffType getStaffTypeBean() { |
|
81 |
return this.staffTypeBean; |
|
82 |
} |
|
83 |
||
84 |
public void setStaffTypeBean(StaffType staffTypeBean) { |
|
85 |
this.staffTypeBean = staffTypeBean; |
|
86 |
} |
|
|
15.1.3
by Gustav Hartvigsson
Generated classes from tables and added them. |
87 |
|
88 |
}
|