View Javadoc
1   /**
2    * Copyright 2005-2015 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 org.kuali.rice.kim.impl.identity.citizenship;
17  
18  import java.sql.Timestamp;
19  
20  import javax.persistence.Column;
21  import javax.persistence.Convert;
22  import javax.persistence.MappedSuperclass;
23  import javax.persistence.Transient;
24  
25  import org.joda.time.DateTime;
26  import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenshipContract;
27  import org.kuali.rice.krad.bo.DataObjectBase;
28  import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter;
29  
30  @MappedSuperclass
31  public abstract class EntityCitizenshipBase extends DataObjectBase implements EntityCitizenshipContract {
32      private static final long serialVersionUID = 1L;
33  
34      @Column(name = "ENTITY_ID")
35      private String entityId;
36  
37      @Column(name = "POSTAL_CNTRY_CD")
38      private String countryCode;
39  
40      @Column(name = "CTZNSHP_STAT_CD")
41      private String statusCode;
42  
43      @Column(name = "STRT_DT")
44      private Timestamp startDateValue;
45  
46  
47      @Column(name = "END_DT")
48      private Timestamp endDateValue;
49  
50      @Convert(converter=BooleanYNConverter.class)
51      @Column(name = "ACTV_IND")
52      private boolean active;
53  
54  
55      @Override
56      public DateTime getStartDate() {
57          if (this.startDateValue != null) {
58              return new DateTime(this.startDateValue);
59          }
60  
61          return null;
62      }
63  
64      @Override
65      public DateTime getEndDate() {
66          if (this.endDateValue != null) {
67              return new DateTime(this.endDateValue);
68          }
69  
70          return null;
71      }
72  
73      @Override
74      public String getEntityId() {
75          return entityId;
76      }
77  
78      public void setEntityId(String entityId) {
79          this.entityId = entityId;
80      }
81  
82      @Override
83      public String getCountryCode() {
84          return countryCode;
85      }
86  
87      public void setCountryCode(String countryCode) {
88          this.countryCode = countryCode;
89      }
90  
91      public String getStatusCode() {
92          return statusCode;
93      }
94  
95      public void setStatusCode(String statusCode) {
96          this.statusCode = statusCode;
97      }
98  
99      public Timestamp getStartDateValue() {
100         return startDateValue;
101     }
102 
103     public void setStartDateValue(Timestamp startDateValue) {
104         this.startDateValue = startDateValue;
105     }
106 
107     public Timestamp getEndDateValue() {
108         return endDateValue;
109     }
110 
111     public void setEndDateValue(Timestamp endDateValue) {
112         this.endDateValue = endDateValue;
113     }
114 
115     public boolean getActive() {
116         return active;
117     }
118 
119     @Override
120     public boolean isActive() {
121         return active;
122     }
123 
124     public void setActive(boolean active) {
125         this.active = active;
126     }
127 
128 
129 }