001/** 002 * Copyright 2005-2016 The Kuali Foundation 003 * 004 * Licensed under the Educational Community License, Version 2.0 (the "License"); 005 * you may not use this file except in compliance with the License. 006 * You may obtain a copy of the License at 007 * 008 * http://www.opensource.org/licenses/ecl2.php 009 * 010 * Unless required by applicable law or agreed to in writing, software 011 * distributed under the License is distributed on an "AS IS" BASIS, 012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 013 * See the License for the specific language governing permissions and 014 * limitations under the License. 015 */ 016package org.kuali.rice.kim.impl.identity.citizenship; 017 018import java.sql.Timestamp; 019 020import javax.persistence.Column; 021import javax.persistence.Convert; 022import javax.persistence.MappedSuperclass; 023import javax.persistence.Transient; 024 025import org.joda.time.DateTime; 026import org.kuali.rice.kim.api.identity.citizenship.EntityCitizenshipContract; 027import org.kuali.rice.krad.bo.DataObjectBase; 028import org.kuali.rice.krad.data.jpa.converters.BooleanYNConverter; 029 030@MappedSuperclass 031public abstract class EntityCitizenshipBase extends DataObjectBase implements EntityCitizenshipContract { 032 private static final long serialVersionUID = 1L; 033 034 @Column(name = "ENTITY_ID") 035 private String entityId; 036 037 @Column(name = "POSTAL_CNTRY_CD") 038 private String countryCode; 039 040 @Column(name = "CTZNSHP_STAT_CD") 041 private String statusCode; 042 043 @Column(name = "STRT_DT") 044 private Timestamp startDateValue; 045 046 047 @Column(name = "END_DT") 048 private Timestamp endDateValue; 049 050 @Convert(converter=BooleanYNConverter.class) 051 @Column(name = "ACTV_IND") 052 private boolean active; 053 054 055 @Override 056 public DateTime getStartDate() { 057 if (this.startDateValue != null) { 058 return new DateTime(this.startDateValue); 059 } 060 061 return null; 062 } 063 064 @Override 065 public DateTime getEndDate() { 066 if (this.endDateValue != null) { 067 return new DateTime(this.endDateValue); 068 } 069 070 return null; 071 } 072 073 @Override 074 public String getEntityId() { 075 return entityId; 076 } 077 078 public void setEntityId(String entityId) { 079 this.entityId = entityId; 080 } 081 082 @Override 083 public String getCountryCode() { 084 return countryCode; 085 } 086 087 public void setCountryCode(String countryCode) { 088 this.countryCode = countryCode; 089 } 090 091 public String getStatusCode() { 092 return statusCode; 093 } 094 095 public void setStatusCode(String statusCode) { 096 this.statusCode = statusCode; 097 } 098 099 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}