001// -------------------------------------------------------------------------------- 002// Copyright 2002-2026 Echo Three, LLC 003// 004// Licensed under the Apache 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.apache.org/licenses/LICENSE-2.0 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// -------------------------------------------------------------------------------- 016// Generated File -- DO NOT EDIT BY HAND 017// -------------------------------------------------------------------------------- 018 019/** 020 * Profile.java 021 */ 022 023package com.echothree.model.data.party.server.entity; 024 025import com.echothree.model.data.party.common.pk.ProfilePK; 026 027import com.echothree.model.data.party.common.pk.PartyPK; 028import com.echothree.model.data.icon.common.pk.IconPK; 029import com.echothree.model.data.party.common.pk.GenderPK; 030import com.echothree.model.data.party.common.pk.BirthdayFormatPK; 031import com.echothree.model.data.core.common.pk.MimeTypePK; 032 033import com.echothree.model.data.party.server.entity.Party; 034import com.echothree.model.data.icon.server.entity.Icon; 035import com.echothree.model.data.party.server.entity.Gender; 036import com.echothree.model.data.party.server.entity.BirthdayFormat; 037import com.echothree.model.data.core.server.entity.MimeType; 038 039import com.echothree.model.data.party.server.factory.PartyFactory; 040import com.echothree.model.data.icon.server.factory.IconFactory; 041import com.echothree.model.data.party.server.factory.GenderFactory; 042import com.echothree.model.data.party.server.factory.BirthdayFormatFactory; 043import com.echothree.model.data.core.server.factory.MimeTypeFactory; 044 045import com.echothree.model.data.party.common.pk.ProfilePK; 046 047import com.echothree.model.data.party.server.value.ProfileValue; 048 049import com.echothree.model.data.party.server.factory.ProfileFactory; 050 051import com.echothree.util.common.exception.PersistenceException; 052import com.echothree.util.common.exception.PersistenceDatabaseException; 053import com.echothree.util.common.exception.PersistenceNotNullException; 054import com.echothree.util.common.exception.PersistenceReadOnlyException; 055 056import com.echothree.util.common.persistence.BasePK; 057 058import com.echothree.util.common.persistence.type.ByteArray; 059 060import com.echothree.util.server.persistence.BaseEntity; 061import com.echothree.util.server.persistence.EntityPermission; 062import com.echothree.util.server.persistence.Session; 063import com.echothree.util.server.persistence.ThreadSession; 064 065import java.io.Serializable; 066 067public class Profile 068 extends BaseEntity 069 implements Serializable { 070 071 private ProfilePK _pk; 072 private ProfileValue _value; 073 074 /** Creates a new instance of Profile */ 075 public Profile() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of Profile */ 081 public Profile(ProfileValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 public ProfileFactory getBaseFactoryInstance() { 090 return ProfileFactory.getInstance(); 091 } 092 093 @Override 094 public boolean hasBeenModified() { 095 return _value.hasBeenModified(); 096 } 097 098 @Override 099 public int hashCode() { 100 return _pk.hashCode(); 101 } 102 103 @Override 104 public String toString() { 105 return _pk.toString(); 106 } 107 108 @Override 109 public boolean equals(Object other) { 110 if(this == other) 111 return true; 112 113 if(other instanceof Profile that) { 114 ProfileValue thatValue = that.getProfileValue(); 115 return _value.equals(thatValue); 116 } else { 117 return false; 118 } 119 } 120 121 @Override 122 public void store() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().store(this); 125 } 126 127 @Override 128 public void remove() 129 throws PersistenceDatabaseException { 130 getBaseFactoryInstance().remove(this); 131 } 132 133 public ProfileValue getProfileValue() { 134 return _value; 135 } 136 137 public void setProfileValue(ProfileValue value) 138 throws PersistenceReadOnlyException { 139 checkReadWrite(); 140 _value = value; 141 } 142 143 @Override 144 public ProfilePK getPrimaryKey() { 145 return _pk; 146 } 147 148 public PartyPK getPartyPK() { 149 return _value.getPartyPK(); 150 } 151 152 public Party getParty(EntityPermission entityPermission) { 153 return PartyFactory.getInstance().getEntityFromPK(entityPermission, getPartyPK()); 154 } 155 156 public Party getParty() { 157 return getParty(EntityPermission.READ_ONLY); 158 } 159 160 public Party getPartyForUpdate() { 161 return getParty(EntityPermission.READ_WRITE); 162 } 163 164 public void setPartyPK(PartyPK partyPK) 165 throws PersistenceNotNullException, PersistenceReadOnlyException { 166 checkReadWrite(); 167 _value.setPartyPK(partyPK); 168 } 169 170 public void setParty(Party entity) { 171 setPartyPK(entity == null? null: entity.getPrimaryKey()); 172 } 173 174 public boolean getPartyPKHasBeenModified() { 175 return _value.getPartyPKHasBeenModified(); 176 } 177 178 public String getNickname() { 179 return _value.getNickname(); 180 } 181 182 public void setNickname(String nickname) 183 throws PersistenceNotNullException, PersistenceReadOnlyException { 184 checkReadWrite(); 185 _value.setNickname(nickname); 186 } 187 188 public boolean getNicknameHasBeenModified() { 189 return _value.getNicknameHasBeenModified(); 190 } 191 192 public IconPK getIconPK() { 193 return _value.getIconPK(); 194 } 195 196 public Icon getIcon(EntityPermission entityPermission) { 197 IconPK pk = getIconPK(); 198 Icon entity = pk == null? null: IconFactory.getInstance().getEntityFromPK(entityPermission, pk); 199 200 return entity; 201 } 202 203 public Icon getIcon() { 204 return getIcon(EntityPermission.READ_ONLY); 205 } 206 207 public Icon getIconForUpdate() { 208 return getIcon(EntityPermission.READ_WRITE); 209 } 210 211 public void setIconPK(IconPK iconPK) 212 throws PersistenceNotNullException, PersistenceReadOnlyException { 213 checkReadWrite(); 214 _value.setIconPK(iconPK); 215 } 216 217 public void setIcon(Icon entity) { 218 setIconPK(entity == null? null: entity.getPrimaryKey()); 219 } 220 221 public boolean getIconPKHasBeenModified() { 222 return _value.getIconPKHasBeenModified(); 223 } 224 225 public String getPronunciation() { 226 return _value.getPronunciation(); 227 } 228 229 public void setPronunciation(String pronunciation) 230 throws PersistenceNotNullException, PersistenceReadOnlyException { 231 checkReadWrite(); 232 _value.setPronunciation(pronunciation); 233 } 234 235 public boolean getPronunciationHasBeenModified() { 236 return _value.getPronunciationHasBeenModified(); 237 } 238 239 public GenderPK getGenderPK() { 240 return _value.getGenderPK(); 241 } 242 243 public Gender getGender(EntityPermission entityPermission) { 244 GenderPK pk = getGenderPK(); 245 Gender entity = pk == null? null: GenderFactory.getInstance().getEntityFromPK(entityPermission, pk); 246 247 return entity; 248 } 249 250 public Gender getGender() { 251 return getGender(EntityPermission.READ_ONLY); 252 } 253 254 public Gender getGenderForUpdate() { 255 return getGender(EntityPermission.READ_WRITE); 256 } 257 258 public void setGenderPK(GenderPK genderPK) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setGenderPK(genderPK); 262 } 263 264 public void setGender(Gender entity) { 265 setGenderPK(entity == null? null: entity.getPrimaryKey()); 266 } 267 268 public boolean getGenderPKHasBeenModified() { 269 return _value.getGenderPKHasBeenModified(); 270 } 271 272 public String getPronouns() { 273 return _value.getPronouns(); 274 } 275 276 public void setPronouns(String pronouns) 277 throws PersistenceNotNullException, PersistenceReadOnlyException { 278 checkReadWrite(); 279 _value.setPronouns(pronouns); 280 } 281 282 public boolean getPronounsHasBeenModified() { 283 return _value.getPronounsHasBeenModified(); 284 } 285 286 public Integer getBirthday() { 287 return _value.getBirthday(); 288 } 289 290 public void setBirthday(Integer birthday) 291 throws PersistenceNotNullException, PersistenceReadOnlyException { 292 checkReadWrite(); 293 _value.setBirthday(birthday); 294 } 295 296 public boolean getBirthdayHasBeenModified() { 297 return _value.getBirthdayHasBeenModified(); 298 } 299 300 public BirthdayFormatPK getBirthdayFormatPK() { 301 return _value.getBirthdayFormatPK(); 302 } 303 304 public BirthdayFormat getBirthdayFormat(EntityPermission entityPermission) { 305 return BirthdayFormatFactory.getInstance().getEntityFromPK(entityPermission, getBirthdayFormatPK()); 306 } 307 308 public BirthdayFormat getBirthdayFormat() { 309 return getBirthdayFormat(EntityPermission.READ_ONLY); 310 } 311 312 public BirthdayFormat getBirthdayFormatForUpdate() { 313 return getBirthdayFormat(EntityPermission.READ_WRITE); 314 } 315 316 public void setBirthdayFormatPK(BirthdayFormatPK birthdayFormatPK) 317 throws PersistenceNotNullException, PersistenceReadOnlyException { 318 checkReadWrite(); 319 _value.setBirthdayFormatPK(birthdayFormatPK); 320 } 321 322 public void setBirthdayFormat(BirthdayFormat entity) { 323 setBirthdayFormatPK(entity == null? null: entity.getPrimaryKey()); 324 } 325 326 public boolean getBirthdayFormatPKHasBeenModified() { 327 return _value.getBirthdayFormatPKHasBeenModified(); 328 } 329 330 public String getOccupation() { 331 return _value.getOccupation(); 332 } 333 334 public void setOccupation(String occupation) 335 throws PersistenceNotNullException, PersistenceReadOnlyException { 336 checkReadWrite(); 337 _value.setOccupation(occupation); 338 } 339 340 public boolean getOccupationHasBeenModified() { 341 return _value.getOccupationHasBeenModified(); 342 } 343 344 public String getHobbies() { 345 return _value.getHobbies(); 346 } 347 348 public void setHobbies(String hobbies) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setHobbies(hobbies); 352 } 353 354 public boolean getHobbiesHasBeenModified() { 355 return _value.getHobbiesHasBeenModified(); 356 } 357 358 public String getLocation() { 359 return _value.getLocation(); 360 } 361 362 public void setLocation(String location) 363 throws PersistenceNotNullException, PersistenceReadOnlyException { 364 checkReadWrite(); 365 _value.setLocation(location); 366 } 367 368 public boolean getLocationHasBeenModified() { 369 return _value.getLocationHasBeenModified(); 370 } 371 372 public MimeTypePK getBioMimeTypePK() { 373 return _value.getBioMimeTypePK(); 374 } 375 376 public MimeType getBioMimeType(EntityPermission entityPermission) { 377 MimeTypePK pk = getBioMimeTypePK(); 378 MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(entityPermission, pk); 379 380 return entity; 381 } 382 383 public MimeType getBioMimeType() { 384 return getBioMimeType(EntityPermission.READ_ONLY); 385 } 386 387 public MimeType getBioMimeTypeForUpdate() { 388 return getBioMimeType(EntityPermission.READ_WRITE); 389 } 390 391 public void setBioMimeTypePK(MimeTypePK bioMimeTypePK) 392 throws PersistenceNotNullException, PersistenceReadOnlyException { 393 checkReadWrite(); 394 _value.setBioMimeTypePK(bioMimeTypePK); 395 } 396 397 public void setBioMimeType(MimeType entity) { 398 setBioMimeTypePK(entity == null? null: entity.getPrimaryKey()); 399 } 400 401 public boolean getBioMimeTypePKHasBeenModified() { 402 return _value.getBioMimeTypePKHasBeenModified(); 403 } 404 405 public String getBio() { 406 return _value.getBio(); 407 } 408 409 public void setBio(String bio) 410 throws PersistenceNotNullException, PersistenceReadOnlyException { 411 checkReadWrite(); 412 _value.setBio(bio); 413 } 414 415 public boolean getBioHasBeenModified() { 416 return _value.getBioHasBeenModified(); 417 } 418 419 public MimeTypePK getSignatureMimeTypePK() { 420 return _value.getSignatureMimeTypePK(); 421 } 422 423 public MimeType getSignatureMimeType(EntityPermission entityPermission) { 424 MimeTypePK pk = getSignatureMimeTypePK(); 425 MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(entityPermission, pk); 426 427 return entity; 428 } 429 430 public MimeType getSignatureMimeType() { 431 return getSignatureMimeType(EntityPermission.READ_ONLY); 432 } 433 434 public MimeType getSignatureMimeTypeForUpdate() { 435 return getSignatureMimeType(EntityPermission.READ_WRITE); 436 } 437 438 public void setSignatureMimeTypePK(MimeTypePK signatureMimeTypePK) 439 throws PersistenceNotNullException, PersistenceReadOnlyException { 440 checkReadWrite(); 441 _value.setSignatureMimeTypePK(signatureMimeTypePK); 442 } 443 444 public void setSignatureMimeType(MimeType entity) { 445 setSignatureMimeTypePK(entity == null? null: entity.getPrimaryKey()); 446 } 447 448 public boolean getSignatureMimeTypePKHasBeenModified() { 449 return _value.getSignatureMimeTypePKHasBeenModified(); 450 } 451 452 public String getSignature() { 453 return _value.getSignature(); 454 } 455 456 public void setSignature(String signature) 457 throws PersistenceNotNullException, PersistenceReadOnlyException { 458 checkReadWrite(); 459 _value.setSignature(signature); 460 } 461 462 public boolean getSignatureHasBeenModified() { 463 return _value.getSignatureHasBeenModified(); 464 } 465 466 public Long getFromTime() { 467 return _value.getFromTime(); 468 } 469 470 public void setFromTime(Long fromTime) 471 throws PersistenceNotNullException, PersistenceReadOnlyException { 472 checkReadWrite(); 473 _value.setFromTime(fromTime); 474 } 475 476 public boolean getFromTimeHasBeenModified() { 477 return _value.getFromTimeHasBeenModified(); 478 } 479 480 public Long getThruTime() { 481 return _value.getThruTime(); 482 } 483 484 public void setThruTime(Long thruTime) 485 throws PersistenceNotNullException, PersistenceReadOnlyException { 486 checkReadWrite(); 487 _value.setThruTime(thruTime); 488 } 489 490 public boolean getThruTimeHasBeenModified() { 491 return _value.getThruTimeHasBeenModified(); 492 } 493 494}