View Javadoc
1   /**
2    * Copyright 2005-2016 The Kuali Foundation
3    *
4    * Licensed under the Educational Community License, Version 2.0 (the "License");
5    * you may not use this file except in compliance with the License.
6    * You may obtain a copy of the License at
7    *
8    * http://www.opensource.org/licenses/ecl2.php
9    *
10   * Unless required by applicable law or agreed to in writing, software
11   * distributed under the License is distributed on an "AS IS" BASIS,
12   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13   * See the License for the specific language governing permissions and
14   * limitations under the License.
15   */
16  package edu.sampleu.travel.dataobject;
17  
18  import org.apache.commons.lang.StringUtils;
19  import org.kuali.rice.core.api.mo.common.active.MutableInactivatable;
20  import org.kuali.rice.kim.api.identity.Person;
21  import org.kuali.rice.krad.bo.DataObjectBase;
22  import org.kuali.rice.krad.data.jpa.PortableSequenceGenerator;
23  import org.kuali.rice.krad.data.provider.annotation.InheritProperties;
24  import org.kuali.rice.krad.data.provider.annotation.InheritProperty;
25  import org.kuali.rice.krad.data.provider.annotation.Label;
26  import org.kuali.rice.krad.data.provider.annotation.Relationship;
27  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViewType;
28  import org.kuali.rice.krad.data.provider.annotation.UifAutoCreateViews;
29  
30  import javax.persistence.Column;
31  import javax.persistence.Entity;
32  import javax.persistence.GeneratedValue;
33  import javax.persistence.Id;
34  import javax.persistence.Table;
35  import javax.persistence.Temporal;
36  import javax.persistence.TemporalType;
37  import javax.persistence.Transient;
38  import java.util.Date;
39  
40  
41  @Entity
42  @Table(name="TRVL_TRAVELER_DTL_T")
43  @UifAutoCreateViews({UifAutoCreateViewType.INQUIRY, UifAutoCreateViewType.LOOKUP})
44  public class TravelerDetail extends DataObjectBase implements MutableInactivatable {
45  	private static final long serialVersionUID = -7169083136626617130L;
46  
47  
48      @Id
49      @GeneratedValue(generator = "TRVL_TRAVELER_DTL_ID_S")
50      @PortableSequenceGenerator(name = "TRVL_TRAVELER_DTL_ID_S")
51      @Column(name = "id", length = 40, nullable = false)
52  	protected String id;
53      @Column(name = "doc_nbr", length=14)
54      protected String documentNumber;
55      @Column(name = "EMP_PRINCIPAL_ID")
56      protected String principalId;
57      @Relationship(foreignKeyFields="principalId")
58      @Transient
59      @InheritProperties({
60      		@InheritProperty(name="principalName",label=@Label("Traveler User ID")),
61      		@InheritProperty(name="name",label=@Label("Traveler Name"))
62      })
63  	private Person person;
64      @Column(name = "first_nm", length = 40, nullable = false)
65      protected String firstName;
66      @Column(length = 40, nullable = true)
67      protected String middleName;
68      @Column(name = "last_nm", length = 40, nullable = false)
69      protected String lastName;
70      @Column(name = "addr_line_1", length = 50, nullable = false)
71      protected String streetAddressLine1;
72      @Column(name = "addr_line_2", length = 50, nullable = true)
73      protected String streetAddressLine2;
74      @Column(name = "city_nm", length = 50, nullable = true)
75      protected String cityName;
76      @Column(name = "postal_state_cd", length = 2, nullable = false)
77      protected String stateCode;
78      @Column(name = "postal_cd", length = 11, nullable = false)
79      protected String zipCode;
80      @Column(name = "country_cd", length = 2, nullable = true)
81      protected String countryCode;
82      @Column(name = "citizenship", length = 40, nullable = true)
83      protected String citizenship;
84      @Column(name = "email_addr", length = 50, nullable = true)
85      protected String emailAddress;
86      @Transient
87      protected Date dateOfBirth;
88      @Column(name = "gender", length = 1, nullable = false)
89      protected String gender;
90      @Column(name = "phone_nbr", length = 20, nullable = true)
91      protected String phoneNumber;
92      @Column(name = "traveler_typ_cd", length = 3, nullable = false)
93      protected String travelerTypeCode;
94  //    @ManyToOne
95  //    @JoinColumn(name = "traveler_typ_cd", insertable=false, updatable=false)
96  
97      @Relationship(foreignKeyFields="travelerTypeCode")
98      @Transient
99      protected TravelerType travelerType;
100     @Column(name = "customer_num", length = 40, nullable = true)
101     protected String customerNumber;
102     //protected AccountsReceivableCustomer customer;
103     @Transient
104     protected boolean liabilityInsurance;
105 
106     @Column(name = "drive_lic_num", length = 20, nullable = true)
107     protected String driversLicenseNumber;
108     @Transient
109     protected String driversLicenseState;
110     @Column(name = "drive_lic_exp_dt")
111     @Temporal(TemporalType.DATE)
112     protected Date driversLicenseExpDate;
113 
114     // Notification
115     @Transient
116     protected Boolean notifyTAFinal = Boolean.FALSE;
117     @Transient
118     protected Boolean notifyTAStatusChange = Boolean.FALSE;
119     @Transient
120     protected Boolean notifyTERFinal = Boolean.FALSE;
121     @Transient
122     protected Boolean notifyTERStatusChange = Boolean.FALSE;
123 
124     @Column(name = "ACTV_IND", nullable = false, length = 1)
125     protected Boolean active = Boolean.TRUE;
126     @Column(name = "non_res_alien", length = 1, nullable = true)
127     protected Boolean nonResidentAlien = Boolean.FALSE;
128     @Transient
129     protected Boolean motorVehicleRecordCheck = Boolean.FALSE;
130 
131     /**
132      * This method returns the document number this TravelerDetail object is associated with
133      *
134      * @return document number
135      */
136     public String getDocumentNumber() {
137         return documentNumber;
138     }
139 
140     /**
141      * This method sets the document number this TravelerDetail object will be associated with
142      *
143      * @param documentNumber
144      */
145     public void setDocumentNumber(String documentNumber) {
146         this.documentNumber = documentNumber;
147     }
148 
149     public String getId() {
150         return id;
151     }
152 
153 
154     public void setId(String id) {
155         this.id = id;
156     }
157 
158     public String getFirstName() {
159         return firstName;
160     }
161 
162 
163     public void setFirstName(String firstName) {
164         this.firstName = firstName;
165     }
166 
167     public String getLastName() {
168         return lastName;
169     }
170 
171 
172     public void setLastName(String lastName) {
173         this.lastName = lastName;
174     }
175 
176     public String getMiddleName() {
177         return middleName;
178     }
179 
180     public void setMiddleName(String middleName) {
181         this.middleName = middleName;
182     }
183 
184     public String getName() {
185         String name = "";
186         if(StringUtils.isNotBlank(getFirstName()))
187             name += getFirstName();
188         if(StringUtils.isNotBlank(getMiddleName()))
189             name += " " + getMiddleName();
190         if(StringUtils.isNotBlank(getLastName()))
191             name += " " + getLastName();
192         return name;
193     }
194 
195     public String getStreetAddressLine1() {
196         return streetAddressLine1;
197     }
198 
199 
200     public void setStreetAddressLine1(String streetAddressLine1) {
201         this.streetAddressLine1 = streetAddressLine1;
202     }
203 
204     public String getStreetAddressLine2() {
205         return streetAddressLine2;
206     }
207 
208 
209     public void setStreetAddressLine2(String streetAddressLine2) {
210         this.streetAddressLine2 = streetAddressLine2;
211     }
212 
213     public String getCityName() {
214         return cityName;
215     }
216 
217 
218     public void setCityName(String cityName) {
219         this.cityName = cityName;
220     }
221 
222     public String getStateCode() {
223         return stateCode;
224     }
225 
226 
227     public void setStateCode(String stateCode) {
228         this.stateCode = stateCode;
229     }
230 
231     public String getZipCode() {
232         return zipCode;
233     }
234 
235 
236     public void setZipCode(String zipCode) {
237         this.zipCode = zipCode;
238     }
239 
240     public String getCountryCode() {
241         return countryCode;
242     }
243 
244 
245     public void setCountryCode(String countryCode) {
246         this.countryCode = countryCode;
247     }
248 
249     public String getEmailAddress() {
250         return emailAddress;
251     }
252 
253 
254     public void setEmailAddress(String emailAddress) {
255         this.emailAddress = emailAddress;
256     }
257 
258     public String getPhoneNumber() {
259         return phoneNumber;
260     }
261 
262 
263     public void setPhoneNumber(String phoneNumber) {
264         this.phoneNumber = phoneNumber;
265     }
266 
267     public String getTravelerTypeCode() {
268         return travelerTypeCode;
269     }
270 
271 
272     public void setTravelerTypeCode(String travelerTypeCode) {
273         this.travelerTypeCode = travelerTypeCode;
274     }
275 
276     public TravelerType getTravelerType() {
277         return travelerType;
278     }
279 
280     public void setTravelerType(TravelerType travelerType) {
281         this.travelerType = travelerType;
282     }
283 
284     public String getPrincipalId() {
285         return principalId;
286     }
287 
288     public void setPrincipalId(String principalId) {
289         this.principalId = principalId;
290     }
291 
292     public String getCustomerNumber() {
293         return customerNumber;
294     }
295 
296     public void setCustomerNumber(String customerNumber) {
297         this.customerNumber = customerNumber;
298     }
299 
300     public boolean isLiabilityInsurance() {
301         return liabilityInsurance;
302     }
303 
304     public void setLiabilityInsurance(boolean liabilityInsurance) {
305         this.liabilityInsurance = liabilityInsurance;
306     }
307 
308     public String getDriversLicenseNumber() {
309         return driversLicenseNumber;
310     }
311 
312     public void setDriversLicenseNumber(String driversLicenseNumber) {
313         this.driversLicenseNumber = driversLicenseNumber;
314     }
315 
316     public String getDriversLicenseState() {
317         return driversLicenseState;
318     }
319 
320     public void setDriversLicenseState(String driversLicenseState) {
321         this.driversLicenseState = driversLicenseState;
322     }
323 
324     public Date getDriversLicenseExpDate() {
325         return driversLicenseExpDate;
326     }
327 
328     public void setDriversLicenseExpDate(Date driversLicenseExpDate) {
329         this.driversLicenseExpDate = driversLicenseExpDate;
330     }
331 
332     public boolean getNotifyTAFinal() {
333         return notifyTAFinal;
334     }
335 
336     public boolean getNotifyTAStatusChange() {
337         return notifyTAStatusChange;
338     }
339 
340     public boolean getNotifyTERFinal() {
341         return notifyTERFinal;
342     }
343 
344     public boolean getNotifyTERStatusChange() {
345         return notifyTERStatusChange;
346     }
347 
348     public String getCitizenship() {
349         return citizenship;
350     }
351 
352     public void setCitizenship(String citizenship) {
353         this.citizenship = citizenship;
354     }
355 
356     public boolean isActive() {
357         return active;
358     }
359 
360     public void setActive(boolean active) {
361         this.active = active;
362     }
363 
364     public boolean isNotifyTAFinal() {
365         return notifyTAFinal;
366     }
367 
368     public void setNotifyTAFinal(boolean notifyTAFinal) {
369         this.notifyTAFinal = notifyTAFinal;
370     }
371 
372     public boolean isNotifyTAStatusChange() {
373         return notifyTAStatusChange;
374     }
375 
376     public void setNotifyTAStatusChange(boolean notifyTAStatusChange) {
377         this.notifyTAStatusChange = notifyTAStatusChange;
378     }
379 
380     public boolean isNotifyTERFinal() {
381         return notifyTERFinal;
382     }
383 
384     public void setNotifyTERFinal(boolean notifyTERFinal) {
385         this.notifyTERFinal = notifyTERFinal;
386     }
387 
388     public boolean isNotifyTERStatusChange() {
389         return notifyTERStatusChange;
390     }
391 
392     public void setNotifyTERStatusChange(boolean notifyTERStatusChange) {
393         this.notifyTERStatusChange = notifyTERStatusChange;
394     }
395 
396     public boolean isMotorVehicleRecordCheck() {
397         return motorVehicleRecordCheck;
398     }
399 
400     public void setMotorVehicleRecordCheck(boolean motorVehicleRecordCheck) {
401         this.motorVehicleRecordCheck = motorVehicleRecordCheck;
402     }
403 
404     public boolean isNonResidentAlien() {
405         return nonResidentAlien;
406     }
407 
408     public void setNonResidentAlien(boolean nonResidentAlien) {
409         this.nonResidentAlien = nonResidentAlien;
410     }
411 
412     public Date getDateOfBirth() {
413         return dateOfBirth;
414     }
415 
416     public void setDateOfBirth(Date dateOfBirth) {
417         this.dateOfBirth = dateOfBirth;
418     }
419 
420     public String getGender() {
421         return gender;
422     }
423 
424     public void setGender(String gender) {
425         this.gender = gender;
426     }
427 
428 	public Person getPerson() {
429 		return person;
430 	}
431 
432 	public void setPerson(Person person) {
433 		this.person = person;
434 	}
435 }