|  1 |     | 
     | 
  |  2 |     | 
     | 
  |  3 |     | 
     | 
  |  4 |     | 
     | 
  |  5 |     | 
     | 
  |  6 |     | 
     | 
  |  7 |     | 
     | 
  |  8 |     | 
     | 
  |  9 |     | 
     | 
  |  10 |     | 
     | 
  |  11 |     | 
     | 
  |  12 |     | 
     | 
  |  13 |     | 
     | 
  |  14 |     | 
     | 
  |  15 |     | 
     | 
  |  16 |     | 
   package org.kuali.rice.kim.bo.entity.impl;  | 
  |  17 |     | 
     | 
  |  18 |     | 
   import java.util.Calendar;  | 
  |  19 |     | 
   import java.util.Date;  | 
  |  20 |     | 
     | 
  |  21 |     | 
   import javax.persistence.Column;  | 
  |  22 |     | 
   import javax.persistence.Entity;  | 
  |  23 |     | 
   import javax.persistence.Id;  | 
  |  24 |     | 
   import javax.persistence.Table;  | 
  |  25 |     | 
   import javax.persistence.Transient;  | 
  |  26 |     | 
     | 
  |  27 |     | 
   import org.kuali.rice.kim.bo.entity.KimEntityBioDemographics;  | 
  |  28 |     | 
   import org.kuali.rice.kim.bo.entity.KimEntityPrivacyPreferences;  | 
  |  29 |     | 
   import org.kuali.rice.kim.service.KIMServiceLocator;  | 
  |  30 |     | 
   import org.kuali.rice.kim.util.KimConstants;  | 
  |  31 |     | 
   import org.kuali.rice.kim.util.KualiDateMask;  | 
  |  32 |     | 
     | 
  |  33 |     | 
     | 
  |  34 |     | 
     | 
  |  35 |     | 
     | 
  |  36 |     | 
   @Entity  | 
  |  37 |     | 
   @Table(name = "KRIM_ENTITY_BIO_T")  | 
  |  38 |    0 |    public class KimEntityBioDemographicsImpl extends KimEntityDataBase implements KimEntityBioDemographics { | 
  |  39 |     | 
     | 
  |  40 |     | 
           private static final long serialVersionUID = 6317317790920881093L;  | 
  |  41 |     | 
     | 
  |  42 |     | 
           @Id  | 
  |  43 |     | 
           @Column(name = "ENTITY_ID")  | 
  |  44 |     | 
           protected String entityId;  | 
  |  45 |     | 
     | 
  |  46 |     | 
           @Column(name = "BIRTH_DT")  | 
  |  47 |     | 
           protected Date birthDate;  | 
  |  48 |     | 
     | 
  |  49 |     | 
           @Column(name = "GNDR_CD")  | 
  |  50 |     | 
           protected String genderCode;  | 
  |  51 |     | 
     | 
  |  52 |     | 
           @Column(name = "DECEASED_DT")  | 
  |  53 |     | 
           protected Date deceasedDate;  | 
  |  54 |     | 
     | 
  |  55 |     | 
           @Column(name = "MARITAL_STATUS")  | 
  |  56 |     | 
           protected String maritalStatusCode;  | 
  |  57 |     | 
     | 
  |  58 |     | 
           @Column(name = "PRIM_LANG_CD")  | 
  |  59 |     | 
           protected String primaryLanguageCode;  | 
  |  60 |     | 
     | 
  |  61 |     | 
           @Column(name = "SEC_LANG_CD")  | 
  |  62 |     | 
           protected String secondaryLanguageCode;  | 
  |  63 |     | 
     | 
  |  64 |     | 
           @Column(name = "BIRTH_CNTRY_CD")  | 
  |  65 |     | 
           protected String countryOfBirthCode;  | 
  |  66 |     | 
     | 
  |  67 |     | 
           @Column(name = "BIRTH_STATE_CD")  | 
  |  68 |     | 
           protected String birthStateCode;  | 
  |  69 |     | 
     | 
  |  70 |     | 
           @Column(name = "BIRTH_CITY")  | 
  |  71 |     | 
           protected String cityOfBirth;  | 
  |  72 |     | 
     | 
  |  73 |     | 
           @Column(name = "GEO_ORIGIN")  | 
  |  74 |     | 
           protected String geographicOrigin;  | 
  |  75 |     | 
     | 
  |  76 |     | 
           @Transient  | 
  |  77 |     | 
           protected Boolean suppressPersonal;  | 
  |  78 |     | 
             | 
  |  79 |     | 
             | 
  |  80 |     | 
     | 
  |  81 |     | 
     | 
  |  82 |     | 
           public Date getBirthDate() { | 
  |  83 |     | 
                     | 
  |  84 |    0 |                if (isSuppressPersonal()) { | 
  |  85 |    0 |                return KualiDateMask.getInstance();  | 
  |  86 |     | 
           }  | 
  |  87 |    0 |                    return this.birthDate;  | 
  |  88 |     | 
           }  | 
  |  89 |     | 
             | 
  |  90 |     | 
             | 
  |  91 |     | 
     | 
  |  92 |     | 
     | 
  |  93 |     | 
     | 
  |  94 |     | 
     | 
  |  95 |     | 
           public Date getBirthDateUnmasked() { | 
  |  96 |    0 |                    return this.birthDate;  | 
  |  97 |     | 
           }  | 
  |  98 |     | 
     | 
  |  99 |     | 
             | 
  |  100 |     | 
     | 
  |  101 |     | 
     | 
  |  102 |     | 
           public Date getDeceasedDate() { | 
  |  103 |    0 |                    return this.deceasedDate;  | 
  |  104 |     | 
           }  | 
  |  105 |     | 
     | 
  |  106 |     | 
             | 
  |  107 |     | 
     | 
  |  108 |     | 
     | 
  |  109 |     | 
           public String getMaritalStatusCode() { | 
  |  110 |    0 |                if (isSuppressPersonal()) { | 
  |  111 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  112 |     | 
           }  | 
  |  113 |    0 |                    return this.maritalStatusCode;  | 
  |  114 |     | 
           }  | 
  |  115 |     | 
     | 
  |  116 |     | 
             | 
  |  117 |     | 
     | 
  |  118 |     | 
     | 
  |  119 |     | 
           public String getPrimaryLanguageCode() { | 
  |  120 |    0 |                if (isSuppressPersonal()) { | 
  |  121 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  122 |     | 
           }  | 
  |  123 |    0 |                    return this.primaryLanguageCode;  | 
  |  124 |     | 
           }  | 
  |  125 |     | 
     | 
  |  126 |     | 
             | 
  |  127 |     | 
     | 
  |  128 |     | 
     | 
  |  129 |     | 
           public String getSecondaryLanguageCode() { | 
  |  130 |    0 |                if (isSuppressPersonal()) { | 
  |  131 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  132 |     | 
           }  | 
  |  133 |    0 |                    return this.secondaryLanguageCode;  | 
  |  134 |     | 
           }  | 
  |  135 |     | 
     | 
  |  136 |     | 
             | 
  |  137 |     | 
     | 
  |  138 |     | 
     | 
  |  139 |     | 
           public String getCountryOfBirthCode() { | 
  |  140 |    0 |                if (isSuppressPersonal()) { | 
  |  141 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  142 |     | 
           }  | 
  |  143 |    0 |                    return this.countryOfBirthCode;  | 
  |  144 |     | 
           }  | 
  |  145 |     | 
     | 
  |  146 |     | 
             | 
  |  147 |     | 
     | 
  |  148 |     | 
     | 
  |  149 |     | 
           public String getBirthStateCode() { | 
  |  150 |    0 |                if (isSuppressPersonal()) { | 
  |  151 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  152 |     | 
           }  | 
  |  153 |    0 |                    return this.birthStateCode;  | 
  |  154 |     | 
           }  | 
  |  155 |     | 
     | 
  |  156 |     | 
             | 
  |  157 |     | 
     | 
  |  158 |     | 
     | 
  |  159 |     | 
           public String getCityOfBirth() { | 
  |  160 |    0 |                if (isSuppressPersonal()) { | 
  |  161 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  162 |     | 
           }  | 
  |  163 |    0 |                    return this.cityOfBirth;  | 
  |  164 |     | 
           }  | 
  |  165 |     | 
     | 
  |  166 |     | 
             | 
  |  167 |     | 
     | 
  |  168 |     | 
     | 
  |  169 |     | 
           public String getGeographicOrigin() { | 
  |  170 |    0 |                if (isSuppressPersonal()) { | 
  |  171 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  172 |     | 
           }  | 
  |  173 |    0 |                    return this.geographicOrigin;  | 
  |  174 |     | 
           }  | 
  |  175 |     | 
     | 
  |  176 |     | 
             | 
  |  177 |     | 
     | 
  |  178 |     | 
     | 
  |  179 |     | 
           public String getMaritalStatusCodeUnmasked() { | 
  |  180 |    0 |                    return this.maritalStatusCode;  | 
  |  181 |     | 
           }  | 
  |  182 |     | 
     | 
  |  183 |     | 
             | 
  |  184 |     | 
     | 
  |  185 |     | 
     | 
  |  186 |     | 
           public String getPrimaryLanguageCodeUnmasked() { | 
  |  187 |    0 |                    return this.primaryLanguageCode;  | 
  |  188 |     | 
           }  | 
  |  189 |     | 
     | 
  |  190 |     | 
             | 
  |  191 |     | 
     | 
  |  192 |     | 
     | 
  |  193 |     | 
           public String getSecondaryLanguageCodeUnmasked() { | 
  |  194 |    0 |                    return this.secondaryLanguageCode;  | 
  |  195 |     | 
           }  | 
  |  196 |     | 
     | 
  |  197 |     | 
             | 
  |  198 |     | 
     | 
  |  199 |     | 
     | 
  |  200 |     | 
           public String getCountryOfBirthCodeUnmasked() { | 
  |  201 |    0 |                    return this.countryOfBirthCode;  | 
  |  202 |     | 
           }  | 
  |  203 |     | 
     | 
  |  204 |     | 
             | 
  |  205 |     | 
     | 
  |  206 |     | 
     | 
  |  207 |     | 
           public String getBirthStateCodeUnmasked() { | 
  |  208 |    0 |                    return this.birthStateCode;  | 
  |  209 |     | 
           }  | 
  |  210 |     | 
     | 
  |  211 |     | 
             | 
  |  212 |     | 
     | 
  |  213 |     | 
     | 
  |  214 |     | 
           public String getCityOfBirthUnmasked() { | 
  |  215 |    0 |                    return this.cityOfBirth;  | 
  |  216 |     | 
           }  | 
  |  217 |     | 
     | 
  |  218 |     | 
             | 
  |  219 |     | 
     | 
  |  220 |     | 
     | 
  |  221 |     | 
           public String getGeographicOriginUnmasked() { | 
  |  222 |    0 |                    return this.geographicOrigin;  | 
  |  223 |     | 
           }  | 
  |  224 |     | 
     | 
  |  225 |     | 
             | 
  |  226 |     | 
     | 
  |  227 |     | 
     | 
  |  228 |     | 
           public void setBirthDate(Date birthDate) { | 
  |  229 |    0 |                    this.birthDate = birthDate;  | 
  |  230 |    0 |            }  | 
  |  231 |     | 
     | 
  |  232 |     | 
             | 
  |  233 |     | 
     | 
  |  234 |     | 
     | 
  |  235 |     | 
           public void setDeceasedDate(Date deceasedDate) { | 
  |  236 |    0 |                    this.deceasedDate = deceasedDate;  | 
  |  237 |    0 |            }  | 
  |  238 |     | 
     | 
  |  239 |     | 
             | 
  |  240 |     | 
     | 
  |  241 |     | 
     | 
  |  242 |     | 
           public void setMaritalStatusCode(String maritalStatusCode) { | 
  |  243 |    0 |                    this.maritalStatusCode = maritalStatusCode;  | 
  |  244 |    0 |            }  | 
  |  245 |     | 
     | 
  |  246 |     | 
             | 
  |  247 |     | 
     | 
  |  248 |     | 
     | 
  |  249 |     | 
           public void setPrimaryLanguageCode(String primaryLanguageCode) { | 
  |  250 |    0 |                    this.primaryLanguageCode = primaryLanguageCode;  | 
  |  251 |    0 |            }  | 
  |  252 |     | 
     | 
  |  253 |     | 
             | 
  |  254 |     | 
     | 
  |  255 |     | 
     | 
  |  256 |     | 
           public void setSecondaryLanguageCode(String secondaryLanguageCode) { | 
  |  257 |    0 |                    this.secondaryLanguageCode = secondaryLanguageCode;  | 
  |  258 |    0 |            }  | 
  |  259 |     | 
     | 
  |  260 |     | 
             | 
  |  261 |     | 
     | 
  |  262 |     | 
     | 
  |  263 |     | 
           public void setCountryOfBirthCode(String countryOfBirthCode) { | 
  |  264 |    0 |                    this.countryOfBirthCode = countryOfBirthCode;  | 
  |  265 |    0 |            }  | 
  |  266 |     | 
     | 
  |  267 |     | 
             | 
  |  268 |     | 
     | 
  |  269 |     | 
     | 
  |  270 |     | 
           public void setBirthStateCode(String birthStateCode) { | 
  |  271 |    0 |                    this.birthStateCode = birthStateCode;  | 
  |  272 |    0 |            }  | 
  |  273 |     | 
     | 
  |  274 |     | 
             | 
  |  275 |     | 
     | 
  |  276 |     | 
     | 
  |  277 |     | 
           public void setCityOfBirth(String cityOfBirth) { | 
  |  278 |    0 |                    this.cityOfBirth = cityOfBirth;  | 
  |  279 |    0 |            }  | 
  |  280 |     | 
     | 
  |  281 |     | 
             | 
  |  282 |     | 
     | 
  |  283 |     | 
     | 
  |  284 |     | 
           public void setGeographicOrigin(String geographicOrigin) { | 
  |  285 |    0 |                    this.geographicOrigin = geographicOrigin;  | 
  |  286 |    0 |            }  | 
  |  287 |     | 
     | 
  |  288 |     | 
             | 
  |  289 |     | 
     | 
  |  290 |     | 
     | 
  |  291 |     | 
           public String getEntityId() { | 
  |  292 |    0 |                    return this.entityId;  | 
  |  293 |     | 
           }  | 
  |  294 |     | 
     | 
  |  295 |     | 
             | 
  |  296 |     | 
     | 
  |  297 |     | 
     | 
  |  298 |     | 
           public void setEntityId(String entityId) { | 
  |  299 |    0 |                    this.entityId = entityId;  | 
  |  300 |    0 |            }  | 
  |  301 |     | 
     | 
  |  302 |     | 
             | 
  |  303 |     | 
     | 
  |  304 |     | 
     | 
  |  305 |     | 
           public String getGenderCode() { | 
  |  306 |    0 |                if (isSuppressPersonal()) { | 
  |  307 |    0 |                return KimConstants.RESTRICTED_DATA_MASK;  | 
  |  308 |     | 
           }  | 
  |  309 |    0 |                    return genderCode;  | 
  |  310 |     | 
           }  | 
  |  311 |     | 
     | 
  |  312 |     | 
         | 
  |  313 |     | 
     | 
  |  314 |     | 
     | 
  |  315 |     | 
       public String getGenderCodeUnmasked() { | 
  |  316 |    0 |            return this.genderCode;  | 
  |  317 |     | 
       }  | 
  |  318 |     | 
     | 
  |  319 |     | 
           public void setGenderCode(String genderCode) { | 
  |  320 |    0 |                    this.genderCode = genderCode;  | 
  |  321 |    0 |            }  | 
  |  322 |     | 
     | 
  |  323 |     | 
             | 
  |  324 |     | 
     | 
  |  325 |     | 
     | 
  |  326 |     | 
           public Boolean getSuppressPersonal() { | 
  |  327 |    0 |                    return this.suppressPersonal;  | 
  |  328 |     | 
           }  | 
  |  329 |     | 
     | 
  |  330 |     | 
             | 
  |  331 |     | 
     | 
  |  332 |     | 
     | 
  |  333 |     | 
           public void setSuppressPersonal(Boolean suppressPersonal) { | 
  |  334 |    0 |                    this.suppressPersonal = suppressPersonal;  | 
  |  335 |    0 |            }  | 
  |  336 |     | 
     | 
  |  337 |     | 
       public boolean isSuppressPersonal() { | 
  |  338 |    0 |            if (suppressPersonal != null) { | 
  |  339 |    0 |                return suppressPersonal.booleanValue();  | 
  |  340 |     | 
           }  | 
  |  341 |    0 |            KimEntityPrivacyPreferences privacy = KIMServiceLocator.getIdentityService().getEntityPrivacyPreferences(getEntityId());  | 
  |  342 |     | 
     | 
  |  343 |    0 |            suppressPersonal = false;  | 
  |  344 |    0 |            if (privacy != null) { | 
  |  345 |    0 |                suppressPersonal = privacy.isSuppressPersonal();  | 
  |  346 |     | 
           }   | 
  |  347 |    0 |            return suppressPersonal.booleanValue();  | 
  |  348 |     | 
       }  | 
  |  349 |     | 
     | 
  |  350 |     | 
         | 
  |  351 |     | 
       private Date dateMask(){ | 
  |  352 |     | 
     | 
  |  353 |    0 |                Calendar calendar = Calendar.getInstance();  | 
  |  354 |    0 |                calendar.set(calendar.getMinimum(Calendar.YEAR),   | 
  |  355 |     | 
                               calendar.getMinimum(Calendar.MONTH ),   | 
  |  356 |     | 
                               calendar.getMinimum(Calendar.DATE));  | 
  |  357 |     | 
             | 
  |  358 |    0 |                return (calendar != null ? new java.sql.Date(calendar.getTime().getTime()) : null);  | 
  |  359 |     | 
       }  | 
  |  360 |     | 
   }  |