| 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.LinkedHashMap; |
| 19 | |
import java.util.List; |
| 20 | |
|
| 21 | |
import javax.persistence.CascadeType; |
| 22 | |
import javax.persistence.Column; |
| 23 | |
import javax.persistence.Entity; |
| 24 | |
import javax.persistence.FetchType; |
| 25 | |
import javax.persistence.Id; |
| 26 | |
import javax.persistence.JoinColumn; |
| 27 | |
import javax.persistence.OneToMany; |
| 28 | |
import javax.persistence.OneToOne; |
| 29 | |
import javax.persistence.Table; |
| 30 | |
|
| 31 | |
import org.kuali.rice.kim.bo.entity.KimEntity; |
| 32 | |
import org.kuali.rice.kns.util.ObjectUtils; |
| 33 | |
import org.kuali.rice.kns.util.TypedArrayList; |
| 34 | |
|
| 35 | |
|
| 36 | |
|
| 37 | |
|
| 38 | |
|
| 39 | |
|
| 40 | |
|
| 41 | |
|
| 42 | 0 | @SuppressWarnings("unchecked") |
| 43 | |
@Entity |
| 44 | |
@Table(name = "KRIM_ENTITY_T") |
| 45 | 0 | public class KimEntityImpl extends KimInactivatableEntityDataBase implements KimEntity { |
| 46 | |
|
| 47 | |
private static final long serialVersionUID = 1L; |
| 48 | |
|
| 49 | |
@Id |
| 50 | |
@Column(name = "ENTITY_ID") |
| 51 | |
protected String entityId; |
| 52 | |
|
| 53 | 0 | @OneToMany(targetEntity = KimEntityNameImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 54 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
| 55 | |
protected List<KimEntityNameImpl> names = new TypedArrayList(KimEntityNameImpl.class); |
| 56 | |
|
| 57 | 0 | @OneToMany(targetEntity = KimEntityEntityTypeImpl.class, fetch = FetchType.EAGER, cascade = { CascadeType.ALL }) |
| 58 | |
@JoinColumn(name = "ENTITY_ID", insertable = true, updatable = true) |
| 59 | |
protected List<KimEntityEntityTypeImpl> entityTypes = new TypedArrayList(KimEntityEntityTypeImpl.class); |
| 60 | |
|
| 61 | 0 | @OneToMany(targetEntity = KimPrincipalImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 62 | |
@JoinColumn(name = "ENTITY_ID", insertable = true, updatable = true) |
| 63 | |
protected List<KimPrincipalImpl> principals = new TypedArrayList(KimPrincipalImpl.class); |
| 64 | |
|
| 65 | 0 | @OneToMany(targetEntity=KimEntityExternalIdentifierImpl.class,fetch=FetchType.LAZY,cascade={CascadeType.ALL}) |
| 66 | |
@JoinColumn(name="ENTITY_ID", insertable=true, updatable=true) |
| 67 | |
protected List<KimEntityExternalIdentifierImpl> externalIdentifiers = new TypedArrayList(KimEntityExternalIdentifierImpl.class); |
| 68 | |
|
| 69 | 0 | @OneToMany(targetEntity=KimEntityAffiliationImpl.class,fetch=FetchType.LAZY,cascade={CascadeType.ALL}) |
| 70 | |
@JoinColumn(name="ENTITY_ID", insertable=true, updatable=true) |
| 71 | |
protected List<KimEntityAffiliationImpl> affiliations = new TypedArrayList(KimEntityAffiliationImpl.class); |
| 72 | |
|
| 73 | 0 | @OneToMany(targetEntity=KimEntityEmploymentInformationImpl.class,fetch=FetchType.LAZY, cascade={CascadeType.ALL}) |
| 74 | |
@JoinColumn(name="ENTITY_ID", insertable=true, updatable=true) |
| 75 | |
protected List<KimEntityEmploymentInformationImpl> employmentInformation = new TypedArrayList(KimEntityEmploymentInformationImpl.class); |
| 76 | |
|
| 77 | |
@OneToOne(targetEntity=KimEntityPrivacyPreferencesImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 78 | |
@JoinColumn(name = "ENTITY_ID", insertable = true, updatable = true) |
| 79 | |
protected KimEntityPrivacyPreferencesImpl privacyPreferences; |
| 80 | |
|
| 81 | |
@OneToOne(targetEntity=KimEntityBioDemographicsImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 82 | |
@JoinColumn(name = "ENTITY_ID", insertable = true, updatable = true) |
| 83 | |
protected KimEntityBioDemographicsImpl bioDemographics; |
| 84 | |
|
| 85 | 0 | @OneToMany(targetEntity = KimEntityCitizenshipImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 86 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
| 87 | |
protected List<KimEntityCitizenshipImpl> citizenships = new TypedArrayList(KimEntityCitizenshipImpl.class); |
| 88 | |
|
| 89 | 0 | @OneToMany(targetEntity = KimEntityEthnicityImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 90 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
| 91 | |
protected List<KimEntityEthnicityImpl> ethnicities = new TypedArrayList(KimEntityEthnicityImpl.class); |
| 92 | |
|
| 93 | 0 | @OneToMany(targetEntity = KimEntityResidencyImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 94 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
| 95 | |
protected List<KimEntityResidencyImpl> residencies = new TypedArrayList(KimEntityResidencyImpl.class); |
| 96 | |
|
| 97 | 0 | @OneToMany(targetEntity = KimEntityVisaImpl.class, fetch = FetchType.LAZY, cascade = { CascadeType.ALL }) |
| 98 | |
@JoinColumn(name = "ENTITY_ID", insertable = false, updatable = false) |
| 99 | |
protected List<KimEntityVisaImpl> visas = new TypedArrayList(KimEntityVisaImpl.class); |
| 100 | |
|
| 101 | |
|
| 102 | |
|
| 103 | |
|
| 104 | |
public String getEntityId() { |
| 105 | 0 | return this.entityId; |
| 106 | |
} |
| 107 | |
|
| 108 | |
|
| 109 | |
|
| 110 | |
|
| 111 | |
|
| 112 | |
public void setEntityId(String entityId) { |
| 113 | 0 | this.entityId = entityId; |
| 114 | 0 | } |
| 115 | |
|
| 116 | |
|
| 117 | |
|
| 118 | |
|
| 119 | |
public List<KimEntityEntityTypeImpl> getEntityTypes() { |
| 120 | 0 | return this.entityTypes; |
| 121 | |
} |
| 122 | |
|
| 123 | |
|
| 124 | |
|
| 125 | |
|
| 126 | |
|
| 127 | |
public void setEntityTypes(List<KimEntityEntityTypeImpl> entityTypes) { |
| 128 | 0 | this.entityTypes = entityTypes; |
| 129 | 0 | } |
| 130 | |
|
| 131 | |
|
| 132 | |
|
| 133 | |
|
| 134 | |
protected LinkedHashMap toStringMapper() { |
| 135 | 0 | LinkedHashMap lhm = new LinkedHashMap(); |
| 136 | 0 | lhm.put("entityId", entityId); |
| 137 | 0 | return lhm; |
| 138 | |
} |
| 139 | |
|
| 140 | |
|
| 141 | |
|
| 142 | |
|
| 143 | |
public List<KimEntityExternalIdentifierImpl> getExternalIdentifiers() { |
| 144 | 0 | return this.externalIdentifiers; |
| 145 | |
} |
| 146 | |
|
| 147 | |
|
| 148 | |
|
| 149 | |
|
| 150 | |
|
| 151 | |
public void setExternalIdentifiers(List<KimEntityExternalIdentifierImpl> externalIdentifiers) { |
| 152 | 0 | this.externalIdentifiers = externalIdentifiers; |
| 153 | 0 | } |
| 154 | |
|
| 155 | |
|
| 156 | |
|
| 157 | |
|
| 158 | |
public KimEntityPrivacyPreferencesImpl getPrivacyPreferences() { |
| 159 | 0 | if (ObjectUtils.isNull(this.privacyPreferences)) { |
| 160 | 0 | return null; |
| 161 | |
} |
| 162 | 0 | return this.privacyPreferences; |
| 163 | |
} |
| 164 | |
|
| 165 | |
|
| 166 | |
|
| 167 | |
|
| 168 | |
|
| 169 | |
public void setPrivacyPreferences(KimEntityPrivacyPreferencesImpl privacyPreferences) { |
| 170 | 0 | this.privacyPreferences = privacyPreferences; |
| 171 | 0 | } |
| 172 | |
|
| 173 | |
|
| 174 | |
|
| 175 | |
|
| 176 | |
public KimEntityBioDemographicsImpl getBioDemographics() { |
| 177 | 0 | if (ObjectUtils.isNull(this.bioDemographics)) { |
| 178 | 0 | return null; |
| 179 | |
} |
| 180 | 0 | return this.bioDemographics; |
| 181 | |
} |
| 182 | |
|
| 183 | |
|
| 184 | |
|
| 185 | |
|
| 186 | |
|
| 187 | |
public void setBioDemographics(KimEntityBioDemographicsImpl bioDemographics) { |
| 188 | 0 | this.bioDemographics = bioDemographics; |
| 189 | 0 | } |
| 190 | |
|
| 191 | |
|
| 192 | |
|
| 193 | |
|
| 194 | |
public List<KimEntityAffiliationImpl> getAffiliations() { |
| 195 | 0 | return this.affiliations; |
| 196 | |
} |
| 197 | |
|
| 198 | |
|
| 199 | |
|
| 200 | |
|
| 201 | |
|
| 202 | |
public void setAffiliations(List<KimEntityAffiliationImpl> affiliations) { |
| 203 | 0 | this.affiliations = affiliations; |
| 204 | 0 | } |
| 205 | |
|
| 206 | |
|
| 207 | |
|
| 208 | |
|
| 209 | |
public List<KimEntityEmploymentInformationImpl> getEmploymentInformation() { |
| 210 | 0 | return this.employmentInformation; |
| 211 | |
} |
| 212 | |
|
| 213 | |
|
| 214 | |
|
| 215 | |
|
| 216 | |
|
| 217 | |
public void setEmploymentInformation(List<KimEntityEmploymentInformationImpl> employmentInformation) { |
| 218 | 0 | this.employmentInformation = employmentInformation; |
| 219 | 0 | } |
| 220 | |
|
| 221 | |
|
| 222 | |
|
| 223 | |
|
| 224 | |
public List<KimPrincipalImpl> getPrincipals() { |
| 225 | 0 | return principals; |
| 226 | |
} |
| 227 | |
|
| 228 | |
|
| 229 | |
|
| 230 | |
|
| 231 | |
|
| 232 | |
public KimEntityEntityTypeImpl getEntityType(String entityTypeCode) { |
| 233 | 0 | for ( KimEntityEntityTypeImpl entType : entityTypes ) { |
| 234 | 0 | if ( entType.getEntityTypeCode().equals( entityTypeCode ) ) { |
| 235 | 0 | return entType; |
| 236 | |
} |
| 237 | |
} |
| 238 | 0 | return null; |
| 239 | |
} |
| 240 | |
|
| 241 | |
|
| 242 | |
|
| 243 | |
|
| 244 | |
|
| 245 | |
|
| 246 | |
public KimEntityAffiliationImpl getDefaultAffiliation() { |
| 247 | 0 | return (KimEntityAffiliationImpl)getDefaultItem( affiliations ); |
| 248 | |
} |
| 249 | |
|
| 250 | |
|
| 251 | |
|
| 252 | |
|
| 253 | |
|
| 254 | |
|
| 255 | |
public KimEntityExternalIdentifierImpl getEntityExternalIdentifier(String externalIdentifierTypeCode) { |
| 256 | 0 | for ( KimEntityExternalIdentifierImpl id : externalIdentifiers ) { |
| 257 | 0 | if ( id.getExternalIdentifierTypeCode().equals( externalIdentifierTypeCode ) ) { |
| 258 | 0 | return id; |
| 259 | |
} |
| 260 | |
} |
| 261 | 0 | return null; |
| 262 | |
} |
| 263 | |
|
| 264 | |
|
| 265 | |
|
| 266 | |
|
| 267 | |
|
| 268 | |
|
| 269 | |
public KimEntityEmploymentInformationImpl getPrimaryEmployment() { |
| 270 | 0 | for ( KimEntityEmploymentInformationImpl emp : employmentInformation ) { |
| 271 | 0 | if ( emp.isActive() && emp.isPrimary() ) { |
| 272 | 0 | return emp; |
| 273 | |
} |
| 274 | |
} |
| 275 | 0 | return null; |
| 276 | |
} |
| 277 | |
|
| 278 | |
public List<KimEntityNameImpl> getNames() { |
| 279 | 0 | return this.names; |
| 280 | |
} |
| 281 | |
|
| 282 | |
public void setNames(List<KimEntityNameImpl> names) { |
| 283 | 0 | this.names = names; |
| 284 | 0 | } |
| 285 | |
|
| 286 | |
|
| 287 | |
|
| 288 | |
|
| 289 | |
|
| 290 | |
|
| 291 | |
public KimEntityNameImpl getDefaultName() { |
| 292 | 0 | return (KimEntityNameImpl)getDefaultItem( names ); |
| 293 | |
} |
| 294 | |
|
| 295 | |
|
| 296 | |
|
| 297 | |
|
| 298 | |
public List<KimEntityCitizenshipImpl> getCitizenships() { |
| 299 | 0 | return this.citizenships; |
| 300 | |
} |
| 301 | |
|
| 302 | |
|
| 303 | |
|
| 304 | |
|
| 305 | |
public void setCitizenships(List<KimEntityCitizenshipImpl> citizenships) { |
| 306 | 0 | this.citizenships = citizenships; |
| 307 | 0 | } |
| 308 | |
|
| 309 | |
|
| 310 | |
|
| 311 | |
|
| 312 | |
public List<KimEntityEthnicityImpl> getEthnicities() { |
| 313 | 0 | return this.ethnicities; |
| 314 | |
} |
| 315 | |
|
| 316 | |
|
| 317 | |
|
| 318 | |
|
| 319 | |
public void setEthnicities(List<KimEntityEthnicityImpl> ethnicities) { |
| 320 | 0 | this.ethnicities = ethnicities; |
| 321 | 0 | } |
| 322 | |
|
| 323 | |
|
| 324 | |
|
| 325 | |
|
| 326 | |
public List<KimEntityResidencyImpl> getResidencies() { |
| 327 | 0 | return this.residencies; |
| 328 | |
} |
| 329 | |
|
| 330 | |
|
| 331 | |
|
| 332 | |
|
| 333 | |
public void setResidencies(List<KimEntityResidencyImpl> residencies) { |
| 334 | 0 | this.residencies = residencies; |
| 335 | 0 | } |
| 336 | |
|
| 337 | |
|
| 338 | |
|
| 339 | |
|
| 340 | |
public List<KimEntityVisaImpl> getVisas() { |
| 341 | 0 | return this.visas; |
| 342 | |
} |
| 343 | |
|
| 344 | |
|
| 345 | |
|
| 346 | |
|
| 347 | |
public void setVisas(List<KimEntityVisaImpl> visas) { |
| 348 | 0 | this.visas = visas; |
| 349 | 0 | } |
| 350 | |
|
| 351 | |
public void setPrincipals(List<KimPrincipalImpl> principals) { |
| 352 | 0 | this.principals = principals; |
| 353 | 0 | } |
| 354 | |
|
| 355 | |
|
| 356 | |
|
| 357 | |
|
| 358 | |
|
| 359 | |
|
| 360 | |
|
| 361 | |
|
| 362 | |
|
| 363 | |
|
| 364 | |
|
| 365 | |
|
| 366 | |
|
| 367 | |
|
| 368 | |
|
| 369 | |
} |