1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 package edu.sampleu.travel.approval.dataobject;
17
18 import org.kuali.rice.krad.bo.PersistableBusinessObjectBase;
19 import javax.persistence.Entity;
20 import javax.persistence.Table;
21 import javax.persistence.OneToMany;
22 import java.sql.Date;
23 import java.util.ArrayList;
24 import java.util.LinkedHashMap;
25 import java.util.List;
26 import javax.persistence.Column;
27 import javax.persistence.GeneratedValue;
28 import javax.persistence.Id;
29 import javax.persistence.JoinColumn;
30 import javax.persistence.ManyToOne;
31 import javax.persistence.SequenceGenerator;
32 import org.apache.commons.lang.StringUtils;
33
34
35
36 @Entity
37 @Table(name="TRVL_TRAVELER_DTL_T")
38 public class TravelerDetail extends PersistableBusinessObjectBase {
39
40 protected Integer id;
41 protected String documentNumber;
42 protected String principalId;
43 protected String principalName;
44 protected String firstName;
45 protected String middleName;
46 protected String lastName;
47 protected String streetAddressLine1;
48 protected String streetAddressLine2;
49 protected String cityName;
50 protected String stateCode;
51 protected String zipCode;
52 protected String countryCode;
53 protected String citizenship;
54 protected String emailAddress;
55 protected Date dateOfBirth;
56 protected String gender;
57 protected String phoneNumber;
58 protected String travelerTypeCode;
59 protected TravelerType travelerType;
60 protected String customerNumber;
61
62 protected boolean liabilityInsurance;
63
64 protected String driversLicenseNumber;
65 protected String driversLicenseState;
66 protected Date driversLicenseExpDate;
67
68
69 protected boolean notifyTAFinal = Boolean.FALSE;
70 protected boolean notifyTAStatusChange = Boolean.FALSE;
71 protected boolean notifyTERFinal = Boolean.FALSE;
72 protected boolean notifyTERStatusChange = Boolean.FALSE;
73
74 protected boolean active = Boolean.TRUE;
75 protected boolean nonResidentAlien = Boolean.FALSE;
76 protected boolean motorVehicleRecordCheck = Boolean.FALSE;
77
78 @OneToMany(mappedBy = "id")
79 private List<TravelerDetailEmergencyContact> emergencyContacts = new ArrayList<TravelerDetailEmergencyContact>();
80
81
82
83
84 public void resetEmergencyContacts(){
85 emergencyContacts = new ArrayList<TravelerDetailEmergencyContact>();
86 }
87
88 public List<TravelerDetailEmergencyContact> getEmergencyContacts() {
89 return emergencyContacts;
90 }
91
92 public void setEmergencyContacts(List<TravelerDetailEmergencyContact> emergencyContacts) {
93 this.emergencyContacts = emergencyContacts;
94 }
95
96
97
98
99
100
101 @Column(name = "doc_nbr")
102 public String getDocumentNumber() {
103 return documentNumber;
104 }
105
106
107
108
109
110
111 public void setDocumentNumber(String documentNumber) {
112 this.documentNumber = documentNumber;
113 }
114
115 @Id
116 @GeneratedValue(generator = "TEM_TRAVELER_DTL_ID_SEQ")
117 @SequenceGenerator(name = "TEM_TRAVELER_DTL_ID_SEQ", sequenceName = "TEM_TRAVELER_DTL_ID_SEQ", allocationSize = 5)
118 @Column(name = "id", nullable = false)
119 public Integer getId() {
120 return id;
121 }
122
123
124 public void setId(Integer id) {
125 this.id = id;
126 }
127
128 @Column(name = "first_nm", length = 40, nullable = false)
129 public String getFirstName() {
130 return firstName;
131 }
132
133
134 public void setFirstName(String firstName) {
135 this.firstName = firstName;
136 }
137
138 @Column(name = "last_nm", length = 40, nullable = false)
139 public String getLastName() {
140 return lastName;
141 }
142
143
144 public void setLastName(String lastName) {
145 this.lastName = lastName;
146 }
147
148
149
150
151
152
153 @Column(length = 40, nullable = true)
154 public String getMiddleName() {
155 return middleName;
156 }
157
158
159
160
161
162
163 public void setMiddleName(String middleName) {
164 this.middleName = middleName;
165 }
166
167 public String getName() {
168 String name = "";
169 if(StringUtils.isNotBlank(getFirstName()))
170 name += getFirstName();
171 if(StringUtils.isNotBlank(getMiddleName()))
172 name += " " + getMiddleName();
173 if(StringUtils.isNotBlank(getLastName()))
174 name += " " + getLastName();
175 return name;
176 }
177
178 @Column(name = "addr_line_1", length = 50, nullable = false)
179 public String getStreetAddressLine1() {
180 return streetAddressLine1;
181 }
182
183
184 public void setStreetAddressLine1(String streetAddressLine1) {
185 this.streetAddressLine1 = streetAddressLine1;
186 }
187
188 @Column(name = "addr_line_2", length = 50, nullable = true)
189 public String getStreetAddressLine2() {
190 return streetAddressLine2;
191 }
192
193
194 public void setStreetAddressLine2(String streetAddressLine2) {
195 this.streetAddressLine2 = streetAddressLine2;
196 }
197
198 @Column(name = "city_nm", length = 50, nullable = true)
199 public String getCityName() {
200 return cityName;
201 }
202
203
204 public void setCityName(String cityName) {
205 this.cityName = cityName;
206 }
207
208 @Column(name = "postal_state_cd", length = 50, nullable = false)
209 public String getStateCode() {
210 return stateCode;
211 }
212
213
214 public void setStateCode(String stateCode) {
215 this.stateCode = stateCode;
216 }
217
218 @Column(name = "postal_cd", length = 50, nullable = false)
219 public String getZipCode() {
220 return zipCode;
221 }
222
223
224 public void setZipCode(String zipCode) {
225 this.zipCode = zipCode;
226 }
227
228 @Column(name = "country_cd", length = 50, nullable = true)
229 public String getCountryCode() {
230 return countryCode;
231 }
232
233
234 public void setCountryCode(String countryCode) {
235 this.countryCode = countryCode;
236 }
237
238 @Column(name = "email_addr", length = 50, nullable = true)
239 public String getEmailAddress() {
240 return emailAddress;
241 }
242
243
244 public void setEmailAddress(String emailAddress) {
245 this.emailAddress = emailAddress;
246 }
247
248 @Column(name = "phone_nbr", length = 20, nullable = true)
249 public String getPhoneNumber() {
250 return phoneNumber;
251 }
252
253
254 public void setPhoneNumber(String phoneNumber) {
255 this.phoneNumber = phoneNumber;
256 }
257
258 @Column(name = "traveler_typ_cd", length = 3, nullable = false)
259 public String getTravelerTypeCode() {
260 return travelerTypeCode;
261 }
262
263
264 public void setTravelerTypeCode(String travelerTypeCode) {
265 this.travelerTypeCode = travelerTypeCode;
266 }
267
268 @ManyToOne
269 @JoinColumn(name = "traveler_typ_cd")
270 public TravelerType getTravelerType() {
271 return travelerType;
272 }
273
274 public void setTravelerType(TravelerType travelerType) {
275 this.travelerType = travelerType;
276 }
277
278
279
280
281
282
283 @Column(name = "EMP_PRINCIPAL_ID")
284 public String getPrincipalId() {
285 return principalId;
286 }
287
288
289
290
291
292
293 public void setPrincipalId(String principalId) {
294 this.principalId = principalId;
295 }
296
297
298
299
300
301
302 @Column(name = "EMP_PRINCIPAL_ID")
303 public String getPrincipalName() {
304 return principalName;
305 }
306
307
308
309
310
311
312 public void setPrincipalName(String principalName) {
313 this.principalName = principalName;
314 }
315
316
317
318
319
320
321 @Column(name = "customer_num", length = 40, nullable = true)
322 public String getCustomerNumber() {
323 return customerNumber;
324 }
325
326
327
328
329
330
331 public void setCustomerNumber(String customerNumber) {
332 this.customerNumber = customerNumber;
333 }
334
335
336
337
338
339
340
341
342
343
344
345
346 protected LinkedHashMap toStringMapper() {
347 LinkedHashMap map = new LinkedHashMap();
348 map.put("id", id);
349 map.put("firstName", firstName);
350 map.put("lastName", lastName);
351 map.put("streetAddressLine1", streetAddressLine1);
352 map.put("cityName", cityName);
353 return map;
354 }
355
356 public boolean isLiabilityInsurance() {
357 return liabilityInsurance;
358 }
359
360 public void setLiabilityInsurance(boolean liabilityInsurance) {
361 this.liabilityInsurance = liabilityInsurance;
362 }
363
364
365
366
367
368
369 @Column(name = "drive_lic_num", length = 20, nullable = true)
370 public String getDriversLicenseNumber() {
371 return driversLicenseNumber;
372 }
373
374
375
376
377
378
379 public void setDriversLicenseNumber(String driversLicenseNumber) {
380 this.driversLicenseNumber = driversLicenseNumber;
381 }
382
383
384
385
386
387
388 public String getDriversLicenseState() {
389 return driversLicenseState;
390 }
391
392
393
394
395
396
397 public void setDriversLicenseState(String driversLicenseState) {
398 this.driversLicenseState = driversLicenseState;
399 }
400
401
402
403
404
405
406 @Column(name = "drive_lic_exp_dt", length = 10)
407 public Date getDriversLicenseExpDate() {
408 return driversLicenseExpDate;
409 }
410
411
412
413
414
415
416
417 public void setDriversLicenseExpDate(Date driversLicenseExpDate) {
418 this.driversLicenseExpDate = driversLicenseExpDate;
419 }
420
421 public boolean getNotifyTAFinal() {
422 return notifyTAFinal;
423 }
424
425 public boolean getNotifyTAStatusChange() {
426 return notifyTAStatusChange;
427 }
428
429 public boolean getNotifyTERFinal() {
430 return notifyTERFinal;
431 }
432
433 public boolean getNotifyTERStatusChange() {
434 return notifyTERStatusChange;
435 }
436
437
438
439
440
441
442 @Column(name = "citizenship", length = 40, nullable = true)
443 public String getCitizenship() {
444 return citizenship;
445 }
446
447
448
449
450
451
452 public void setCitizenship(String citizenship) {
453 this.citizenship = citizenship;
454 }
455
456
457
458
459
460
461 @Column(name = "ACTV_IND", nullable = false, length = 1)
462 public boolean isActive() {
463 return active;
464 }
465
466
467
468
469
470
471 public void setActive(boolean active) {
472 this.active = active;
473 }
474
475
476
477
478
479
480 public boolean isNotifyTAFinal() {
481 return notifyTAFinal;
482 }
483
484
485
486
487
488
489 public void setNotifyTAFinal(boolean notifyTAFinal) {
490 this.notifyTAFinal = notifyTAFinal;
491 }
492
493
494
495
496
497
498 public boolean isNotifyTAStatusChange() {
499 return notifyTAStatusChange;
500 }
501
502
503
504
505
506
507 public void setNotifyTAStatusChange(boolean notifyTAStatusChange) {
508 this.notifyTAStatusChange = notifyTAStatusChange;
509 }
510
511
512
513
514
515
516 public boolean isNotifyTERFinal() {
517 return notifyTERFinal;
518 }
519
520
521
522
523
524
525 public void setNotifyTERFinal(boolean notifyTERFinal) {
526 this.notifyTERFinal = notifyTERFinal;
527 }
528
529
530
531
532
533
534 public boolean isNotifyTERStatusChange() {
535 return notifyTERStatusChange;
536 }
537
538
539
540
541
542
543 public void setNotifyTERStatusChange(boolean notifyTERStatusChange) {
544 this.notifyTERStatusChange = notifyTERStatusChange;
545 }
546
547 public boolean isMotorVehicleRecordCheck() {
548 return motorVehicleRecordCheck;
549 }
550
551 public void setMotorVehicleRecordCheck(boolean motorVehicleRecordCheck) {
552 this.motorVehicleRecordCheck = motorVehicleRecordCheck;
553 }
554
555
556
557
558
559
560 @Column(name = "non_res_alien", length = 1, nullable = true)
561 public boolean isNonResidentAlien() {
562 return nonResidentAlien;
563 }
564
565
566
567
568
569
570 public void setNonResidentAlien(boolean nonResidentAlien) {
571 this.nonResidentAlien = nonResidentAlien;
572 }
573
574
575
576
577
578
579 @Column(name = "date_of_birth", length = 10, nullable = false)
580 public Date getDateOfBirth() {
581 return dateOfBirth;
582 }
583
584
585
586
587
588
589 public void setDateOfBirth(Date dateOfBirth) {
590 this.dateOfBirth = dateOfBirth;
591 }
592
593
594
595
596
597
598 @Column(name = "gender", length = 1, nullable = false)
599 public String getGender() {
600 return gender;
601 }
602
603
604
605
606
607
608 public void setGender(String gender) {
609 this.gender = gender;
610 }
611 }