1   package org.wcb.model.vo.hibernate;
2   
3   import org.wcb.model.vo.ApplicationCertificate;
4   
5   import javax.persistence.*;
6   import java.util.Date;
7   import java.io.Serializable;
8   
9   /**
10   * <small>
11   * <p>
12   * This library is distributed in the hope that it will be useful,
13   * but WITHOUT ANY WARRANTY; without even the implied warranty of
14   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
15   * Lesser General Public License for more details.
16   * <p/>
17   * <p>
18   * You should have received a copy of the GNU Lesser General Public
19   * License along with this library; if not, write to the Free Software
20   * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21   * <p/>
22   * $File:  $ <br>
23   * $Change:  $ submitted by $Author: wbogaardt $ at $DateTime: Oct 26, 2006 10:31:14 AM $ <br>
24   * </small>
25   *
26   * @author wbogaardt
27   *         Value object of the applicant for the FAA 8710 form.
28   */
29  @Entity
30  @Table(name ="applicant")
31  public class FAA8710ApplicationBO implements Serializable {
32  
33      @Id
34      @GeneratedValue(strategy= GenerationType.AUTO)
35      @Column( name="id")
36      private int id;
37      @Column(name = "first_name", length=50)
38      private String firstName;
39      @Column(name = "last_name", length=50)
40      private String lastName;
41      @Column(name = "middle_name", length=50)
42      private String middleName;
43      @Column(name = "ssn", length=12)
44      private String ssn;
45      @Column(name = "birth_date", length=10)
46      private Date birthDate;
47      @Column(name = "place_birth", length=30)
48      private String placeOfBirth;
49      @Column(name = "address", length=100)
50      private String address;
51      @Column(name = "city", length=50)
52      private String city;
53      @Column(name = "state", length=20)
54      private String state;
55      @Column(name = "zipcode", length=11)
56      private String zip;
57      @Column(name = "height", length=4)
58      private String height;
59      @Column(name = "weight", length=4)
60      private String weight;
61      @Column(name = "hair_color", length=20)
62      private String hair;
63      @Column(name = "eye_color", length=20)
64      private String eyes;
65      @Column(name = "sex", length=7)
66      private String sex;
67      private boolean qHoldFaaCertificate;
68      @Column(name = "certificate_grade", length=10)
69      private String gradePilotCertificate;
70      @Column(name = "certificate_number", length=15)
71      private String certificateNumber;
72      @Column(name = "certificate_issued", length=10)
73      private Date certificateIssued;
74      @Column(name = "medical_class", length=20)
75      private String classMedicalCertificate;
76      @Column(name = "medical_issued", length=10)
77      private Date medicalIssued;
78      @Column(name = "medical_examiner", length=100)
79      private String nameMedicalExaminer;
80      @Transient
81      private ApplicationCertificate certification;
82      @Transient
83      private boolean citizen;
84      @Transient
85      private String specifiy;
86      @Transient
87      private boolean understandEnglish;
88      @Transient
89      private boolean qHoldMedicalCertificate;
90      @Transient
91      private boolean convicted;
92      @Transient
93      private Date dateOfFinalConviction;
94      @Transient
95      private String applicationBasis;
96      @Transient
97      private String aircraftToUse;
98      @Transient
99      private String timeInAircraft;
100     @Transient
101     private String picAircraft;
102     @Transient
103     private boolean failedTestBefore;
104 
105     public Integer getId() {
106         return this.id;
107     }
108 
109     public void setId(Integer id) {
110         this.id = id;
111     }
112 
113     /**
114      * references another object that stores a bunch of
115      * boolean values.
116      * @return Certificate that the applicant is applying for.
117      */
118     public ApplicationCertificate getApplyForCertificate() {
119         return this.certification;
120     }
121 
122     public void setApplyForCertificate(ApplicationCertificate cert) {
123         this.certification = cert;
124     }
125 
126     /**
127      * Basis of application is completion of a flight test,
128      * military, graduation, foriegn applicants this is section II
129      * a, b, c, d, e of faa 8710 form.
130      * @return a - completion flight test, b - military, c - graduation, d - foriegn
131      */
132     public String getApplicationBasis() {
133         if (applicationBasis == null) {
134             return "a";
135         }
136         return applicationBasis;
137     }
138 
139     public void setApplicationBasis(String basis) {
140         applicationBasis = basis;
141     }
142 
143     public String getFirstName() {
144         return firstName;
145     }
146 
147     public void setFirstName(String firstName) {
148         this.firstName = firstName;
149     }
150 
151     public String getLastName() {
152         return lastName;
153     }
154 
155     public void setLastName(String lastName) {
156         this.lastName = lastName;
157     }
158 
159 
160     public String getMiddleName() {
161         return middleName;
162     }
163 
164     public void setMiddleName(String middleName) {
165         this.middleName = middleName;
166     }
167 
168     public String getName() {
169         return getLastName() + ", " + getFirstName() + " " + getMiddleName();
170     }
171 
172 
173     public String getSsn() {
174         return ssn;
175     }
176 
177     public void setSsn(String ssn) {
178         this.ssn = ssn;
179     }
180 
181 
182     public Date getBirthDate() {
183         return birthDate;
184     }
185 
186     public void setBirthDate(Date birthDate) {
187         this.birthDate = birthDate;
188     }
189 
190     public String getPlaceOfBirth() {
191         return placeOfBirth;
192     }
193 
194     public void setPlaceOfBirth(String placeOfBirth) {
195         this.placeOfBirth = placeOfBirth;
196     }
197 
198     public String getAddress() {
199         return address;
200     }
201 
202     public void setAddress(String address) {
203         this.address = address;
204     }
205 
206     public boolean isCitizen() {
207         return citizen;
208     }
209 
210     public void setCitizen(boolean citizen) {
211         this.citizen = citizen;
212     }
213 
214     /**
215      * Specify citizen ship
216      * @return  Citizen country
217      */
218     public String getSpecifiy() {
219         return specifiy;
220     }
221 
222     public void setSpecifiy(String specifiy) {
223         this.specifiy = specifiy;
224     }
225 
226     public boolean isUnderstandEnglish() {
227         return understandEnglish;
228     }
229 
230     public void setUnderstandEnglish(boolean understandEnglish) {
231         this.understandEnglish = understandEnglish;
232     }
233 
234     public String getCity() {
235         return city;
236     }
237 
238     public void setCity(String city) {
239         this.city = city;
240     }
241 
242     public String getState() {
243         return state;
244     }
245 
246     public void setState(String state) {
247         this.state = state;
248     }
249 
250     public String getZip() {
251         return zip;
252     }
253 
254     public void setZip(String zip) {
255         this.zip = zip;
256     }
257 
258     public String getHeight() {
259         return height;
260     }
261 
262     public void setHeight(String height) {
263         this.height = height;
264     }
265 
266     public String getWeight() {
267         return weight;
268     }
269 
270     public void setWeight(String weight) {
271         this.weight = weight;
272     }
273 
274     public String getHair() {
275         return hair;
276     }
277 
278     public void setHair(String hair) {
279         this.hair = hair;
280     }
281 
282     public String getEyes() {
283         return eyes;
284     }
285 
286     public void setEyes(String eyes) {
287         this.eyes = eyes;
288     }
289 
290     public String getSex() {
291         if(sex == null) {
292             return "male";
293         }
294         return sex;
295     }
296 
297     /**
298      * Should be male or female
299      * @param sex male female
300      */
301     public void setSex(String sex) {
302         this.sex = sex;
303     }
304 
305     public boolean isqHoldFaaCertificate() {
306         return qHoldFaaCertificate;
307     }
308 
309     public void setqHoldFaaCertificate(boolean qHoldFaaCertificate) {
310         this.qHoldFaaCertificate = qHoldFaaCertificate;
311     }
312 
313     public String getGradePilotCertificate() {
314         return gradePilotCertificate;
315     }
316 
317     public void setGradePilotCertificate(String gradePilotCertificate) {
318         this.gradePilotCertificate = gradePilotCertificate;
319     }
320 
321     public String getCertificateNumber() {
322         return certificateNumber;
323     }
324 
325     public void setCertificateNumber(String certificateNumber) {
326         this.certificateNumber = certificateNumber;
327     }
328 
329     public Date getCertificateIssued() {
330         return certificateIssued;
331     }
332 
333     public void setCertificateIssued(Date certificateIssued) {
334         this.certificateIssued = certificateIssued;
335     }
336 
337     public boolean isqHoldMedicalCertificate() {
338         return qHoldMedicalCertificate;
339     }
340 
341     public void setqHoldMedicalCertificate(boolean qHoldMedicalCertificate) {
342         this.qHoldMedicalCertificate = qHoldMedicalCertificate;
343     }
344 
345     public String getClassMedicalCertificate() {
346         return classMedicalCertificate;
347     }
348 
349     public void setClassMedicalCertificate(String classMedicalCertificate) {
350         this.classMedicalCertificate = classMedicalCertificate;
351     }
352 
353     public Date getMedicalIssued() {
354         return medicalIssued;
355     }
356 
357     public void setMedicalIssued(Date medicalIssued) {
358         this.medicalIssued = medicalIssued;
359     }
360 
361     public String getNameMedicalExaminer() {
362         return nameMedicalExaminer;
363     }
364 
365     public void setNameMedicalExaminer(String nameMedicalExaminer) {
366         this.nameMedicalExaminer = nameMedicalExaminer;
367     }
368 
369 
370     public boolean isConvicted() {
371         return convicted;
372     }
373 
374     public void setConvicted(boolean convicted) {
375         this.convicted = convicted;
376     }
377 
378     public Date getDateOfFinalConviction() {
379         return dateOfFinalConviction;
380     }
381 
382     public void setDateOfFinalConviction(Date dateOfFinalConviction) {
383         this.dateOfFinalConviction = dateOfFinalConviction;
384     }
385 
386     /* section II questions Part A */
387     /**
388      * FAA II A. 1.
389      * @return  a string
390      */
391     public String getAircraftToUse() {
392         return aircraftToUse;
393     }
394 
395     public void setAircraftToUse(String aircraftToUse) {
396         this.aircraftToUse = aircraftToUse;
397     }
398 
399     /**
400      * FAA II A. 2a.
401      * @return total hours
402      */
403     public String getTimeInAircraft() {
404         return timeInAircraft;
405     }
406 
407     public void setTimeInAircraft(String timeInAircraft) {
408         this.timeInAircraft = timeInAircraft;
409     }
410 
411     /**
412      * FAA II A. 2b.
413      * @return  total hours
414      */
415     public String getPicAircraft() {
416         return picAircraft;
417     }
418 
419     public void setPicAircraft(String picAircraft) {
420         this.picAircraft = picAircraft;
421     }
422 
423     /**
424      * FAA IV failed test for cert or rating before?
425      * @return true failed false no did not fail.
426      */
427     public boolean hasFailedRatingBefore() {
428         return this.failedTestBefore;
429     }
430 
431     public void setFailedRatingBefore(boolean val) {
432         this.failedTestBefore = val;
433     }
434 }