-
Notifications
You must be signed in to change notification settings - Fork 0
/
Occupation.java
212 lines (189 loc) · 5.62 KB
/
Occupation.java
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
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
package com.CodingDojo.LognadReg.Models;
import java.util.Date;
import java.util.List;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.JoinTable;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.PrePersist;
import javax.persistence.PreUpdate;
import javax.persistence.Table;
import javax.validation.constraints.FutureOrPresent;
import javax.validation.constraints.NotEmpty;
import javax.validation.constraints.Size;
import org.springframework.format.annotation.DateTimeFormat;
@Entity
@Table(name="occupation")
public class Occupation {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;
@NotEmpty(message="What type of job is being advertised? Please enter a job type.")
private String type;
@NotEmpty(message="Which company is advertising this position? Please enter a company.")
private String company;
@NotEmpty(message="Please enter the city for your occupation")
private String city;
@NotEmpty(message="Please enter the state for your occupation")
private String state;
@NotEmpty(message="How much will this position get paid? Please enter a salary.")
private Integer salary;
@Size(min=2, message ="Group name must be at least 2 char")
private String benefits;
private String shift;
@FutureOrPresent
@DateTimeFormat(pattern="yyyy-mm-dd")
private Date start_date;
@NotEmpty(message="Please enter description of occupation.")
@Size(min=25, message ="Job Description must be at least 25 characters.")
private String job_description;
private String education_and_certifications;
@NotEmpty(message="Please enter the skills required to be considered for this occupation.")
private String required_skills_and_experience;
private String desired_skills_and_experience;
private String soft_skills;
@Column(updatable=false)
private Date createdAt;
private Date updatedAt;
@ManyToMany(fetch = FetchType.LAZY)
@JoinTable(
name = "users_occupations",
joinColumns = @JoinColumn(name = "occupation_id"),
inverseJoinColumns = @JoinColumn(name = "user_id")
)
private List<User> joinedUsers;
@ManyToOne(fetch = FetchType.LAZY)
@JoinColumn(name="user_id")
private User user;
@OneToMany(mappedBy="occupation", fetch = FetchType.LAZY)
private List<RateReview> ratereviews;
@PrePersist
protected void onCreate() {
this.createdAt = new Date();
}
@PreUpdate
protected void onUpdate() {
this.updatedAt = new Date();
}
public Long getId() {
return id;
}
public void setId(Long id) {
this.id = id;
}
public String getType() {
return type;
}
public void setType(String type) {
this.type = type;
}
public String getCompany() {
return company;
}
public void setCompany(String company) {
this.company = company;
}
public String getCity() {
return city;
}
public void setCity(String city) {
this.city = city;
}
public String getState() {
return state;
}
public void setState(String state) {
this.state = state;
}
public Integer getSalary() {
return salary;
}
public void setSalary(Integer salary) {
this.salary = salary;
}
public String getBenefits() {
return benefits;
}
public void setBenefits(String benefits) {
this.benefits = benefits;
}
public String getShift() {
return shift;
}
public void setShift(String shift) {
this.shift = shift;
}
public Date getStart_date() {
return start_date;
}
public void setStart_date(Date start_date) {
this.start_date = start_date;
}
public String getJob_description() {
return job_description;
}
public void setJob_description(String job_description) {
this.job_description = job_description;
}
public String getEducation_and_certifications() {
return education_and_certifications;
}
public void setEducation_and_certifications(String education_and_certifications) {
this.education_and_certifications = education_and_certifications;
}
public String getRequired_skills_and_experience() {
return required_skills_and_experience;
}
public void setRequired_skills_and_experience(String required_skills_and_experience) {
this.required_skills_and_experience = required_skills_and_experience;
}
public String getDesired_skills_and_experience() {
return desired_skills_and_experience;
}
public void setDesired_skills_and_experience(String desired_skills_and_experience) {
this.desired_skills_and_experience = desired_skills_and_experience;
}
public String getSoft_skills() {
return soft_skills;
}
public void setSoft_skills(String soft_skills) {
this.soft_skills = soft_skills;
}
public Date getCreatedAt() {
return createdAt;
}
public void setCreatedAt(Date createdAt) {
this.createdAt = createdAt;
}
public Date getUpdatedAt() {
return updatedAt;
}
public void setUpdatedAt(Date updatedAt) {
this.updatedAt = updatedAt;
}
public List<User> getJoinedUsers() {
return joinedUsers;
}
public void setJoinedUsers(List<User> joinedUsers) {
this.joinedUsers = joinedUsers;
}
public User getUser() {
return user;
}
public void setUser(User user) {
this.user = user;
}
public List<RateReview> getRatereviews() {
return ratereviews;
}
public void setRatereviews(List<RateReview> ratereviews) {
this.ratereviews = ratereviews;
}
}