-
Notifications
You must be signed in to change notification settings - Fork 0
/
teacher
190 lines (159 loc) · 4.56 KB
/
teacher
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package com.hebeinu.lee.domain.entity;
import java.io.Serializable;
import java.util.Collection;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;
import javax.xml.bind.annotation.XmlTransient;
/**
*
* @author lee
*/
@Entity
@Table(name = "TEACHERS")
@XmlRootElement
public class Teachers implements Serializable {
private static final long serialVersionUID = 1L;
@Id
@Basic(optional = false)
@NotNull
@Size(min = 1, max = 18)
@Column(name = "TEACHER_ID")
private String teacherId;
@Size(max = 18)
@Column(name = "TEACHER_NAME")
private String teacherName;
@Size(max = 18)
@Column(name = "ENGLISH_NAME")
private String englishName;
@Size(max = 18)
@Column(name = "GENDER")
private String gender;
@Column(name = "PHOTO")
private String photo;
@Size(max = 1000)
@Column(name = "NOTE")
private String note;
public String getTeacherType() {
return teacherType;
}
public void setTeacherType(String teacherType) {
this.teacherType = teacherType;
}
@Size(max = 18)
@Column(name = "TEACHER_TYPE")
private String teacherType;
@Size(max = 18)
@Column(name = "TEACHER_PWD")
private String teacherPwd;
@JoinColumn(name = "GROUP_ID", referencedColumnName = "GROUP_ID")
@ManyToOne
private ReplyGroup groupId;
@JoinColumn(name = "FACULTY_ID", referencedColumnName = "FACULTY_ID")
@ManyToOne
private Faculty facultyId;
@OneToMany(mappedBy = "teacherId")
private Collection<TopicNameList> topicNameListCollection;
public Teachers() {
}
public Teachers(String teacherId) {
this.teacherId = teacherId;
}
public String getTeacherId() {
return teacherId;
}
public void setTeacherId(String teacherId) {
this.teacherId = teacherId;
}
public String getTeacherName() {
return teacherName;
}
public void setTeacherName(String teacherName) {
this.teacherName = teacherName;
}
public String getEnglishName() {
return englishName;
}
public void setEnglishName(String englishName) {
this.englishName = englishName;
}
public String getGender() {
return gender;
}
public void setGender(String gender) {
this.gender = gender;
}
public String getPhoto() {
return photo;
}
public void setPhoto(String photo) {
this.photo = photo;
}
public String getNote() {
return note;
}
public void setNote(String note) {
this.note = note;
}
public String getTeacherPwd() {
return teacherPwd;
}
public void setTeacherPwd(String teacherPwd) {
this.teacherPwd = teacherPwd;
}
public ReplyGroup getGroupId() {
return groupId;
}
public void setGroupId(ReplyGroup groupId) {
this.groupId = groupId;
}
public Faculty getFacultyId() {
return facultyId;
}
public void setFacultyId(Faculty facultyId) {
this.facultyId = facultyId;
}
@XmlTransient
public Collection<TopicNameList> getTopicNameListCollection() {
return topicNameListCollection;
}
public void setTopicNameListCollection(Collection<TopicNameList> topicNameListCollection) {
this.topicNameListCollection = topicNameListCollection;
}
@Override
public int hashCode() {
int hash = 0;
hash += (teacherId != null ? teacherId.hashCode() : 0);
return hash;
}
@Override
public boolean equals(Object object) {
// TODO: Warning - this method won't work in the case the id fields are not set
if (!(object instanceof Teachers)) {
return false;
}
Teachers other = (Teachers) object;
if ((this.teacherId == null && other.teacherId != null) || (this.teacherId != null && !this.teacherId.equals(other.teacherId))) {
return false;
}
return true;
}
@Override
public String toString() {
return "com.Teachers[ teacherId=" + teacherId + " ]";
}
}