001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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) { 114 Profile that = (Profile)other; 115 116 ProfileValue thatValue = that.getProfileValue(); 117 return _value.equals(thatValue); 118 } else { 119 return false; 120 } 121 } 122 123 @Override 124 public void store(Session session) 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().store(session, this); 127 } 128 129 @Override 130 public void remove(Session session) 131 throws PersistenceDatabaseException { 132 getBaseFactoryInstance().remove(session, this); 133 } 134 135 @Override 136 public void remove() 137 throws PersistenceDatabaseException { 138 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 139 } 140 141 public ProfileValue getProfileValue() { 142 return _value; 143 } 144 145 public void setProfileValue(ProfileValue value) 146 throws PersistenceReadOnlyException { 147 checkReadWrite(); 148 _value = value; 149 } 150 151 @Override 152 public ProfilePK getPrimaryKey() { 153 return _pk; 154 } 155 156 public PartyPK getPartyPK() { 157 return _value.getPartyPK(); 158 } 159 160 public Party getParty(Session session, EntityPermission entityPermission) { 161 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK()); 162 } 163 164 public Party getParty(EntityPermission entityPermission) { 165 return getParty(ThreadSession.currentSession(), entityPermission); 166 } 167 168 public Party getParty(Session session) { 169 return getParty(session, EntityPermission.READ_ONLY); 170 } 171 172 public Party getParty() { 173 return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 174 } 175 176 public Party getPartyForUpdate(Session session) { 177 return getParty(session, EntityPermission.READ_WRITE); 178 } 179 180 public Party getPartyForUpdate() { 181 return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 182 } 183 184 public void setPartyPK(PartyPK partyPK) 185 throws PersistenceNotNullException, PersistenceReadOnlyException { 186 checkReadWrite(); 187 _value.setPartyPK(partyPK); 188 } 189 190 public void setParty(Party entity) { 191 setPartyPK(entity == null? null: entity.getPrimaryKey()); 192 } 193 194 public boolean getPartyPKHasBeenModified() { 195 return _value.getPartyPKHasBeenModified(); 196 } 197 198 public String getNickname() { 199 return _value.getNickname(); 200 } 201 202 public void setNickname(String nickname) 203 throws PersistenceNotNullException, PersistenceReadOnlyException { 204 checkReadWrite(); 205 _value.setNickname(nickname); 206 } 207 208 public boolean getNicknameHasBeenModified() { 209 return _value.getNicknameHasBeenModified(); 210 } 211 212 public IconPK getIconPK() { 213 return _value.getIconPK(); 214 } 215 216 public Icon getIcon(Session session, EntityPermission entityPermission) { 217 IconPK pk = getIconPK(); 218 Icon entity = pk == null? null: IconFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 219 220 return entity; 221 } 222 223 public Icon getIcon(EntityPermission entityPermission) { 224 return getIcon(ThreadSession.currentSession(), entityPermission); 225 } 226 227 public Icon getIcon(Session session) { 228 return getIcon(session, EntityPermission.READ_ONLY); 229 } 230 231 public Icon getIcon() { 232 return getIcon(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 233 } 234 235 public Icon getIconForUpdate(Session session) { 236 return getIcon(session, EntityPermission.READ_WRITE); 237 } 238 239 public Icon getIconForUpdate() { 240 return getIcon(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 241 } 242 243 public void setIconPK(IconPK iconPK) 244 throws PersistenceNotNullException, PersistenceReadOnlyException { 245 checkReadWrite(); 246 _value.setIconPK(iconPK); 247 } 248 249 public void setIcon(Icon entity) { 250 setIconPK(entity == null? null: entity.getPrimaryKey()); 251 } 252 253 public boolean getIconPKHasBeenModified() { 254 return _value.getIconPKHasBeenModified(); 255 } 256 257 public String getPronunciation() { 258 return _value.getPronunciation(); 259 } 260 261 public void setPronunciation(String pronunciation) 262 throws PersistenceNotNullException, PersistenceReadOnlyException { 263 checkReadWrite(); 264 _value.setPronunciation(pronunciation); 265 } 266 267 public boolean getPronunciationHasBeenModified() { 268 return _value.getPronunciationHasBeenModified(); 269 } 270 271 public GenderPK getGenderPK() { 272 return _value.getGenderPK(); 273 } 274 275 public Gender getGender(Session session, EntityPermission entityPermission) { 276 GenderPK pk = getGenderPK(); 277 Gender entity = pk == null? null: GenderFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 278 279 return entity; 280 } 281 282 public Gender getGender(EntityPermission entityPermission) { 283 return getGender(ThreadSession.currentSession(), entityPermission); 284 } 285 286 public Gender getGender(Session session) { 287 return getGender(session, EntityPermission.READ_ONLY); 288 } 289 290 public Gender getGender() { 291 return getGender(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 292 } 293 294 public Gender getGenderForUpdate(Session session) { 295 return getGender(session, EntityPermission.READ_WRITE); 296 } 297 298 public Gender getGenderForUpdate() { 299 return getGender(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 300 } 301 302 public void setGenderPK(GenderPK genderPK) 303 throws PersistenceNotNullException, PersistenceReadOnlyException { 304 checkReadWrite(); 305 _value.setGenderPK(genderPK); 306 } 307 308 public void setGender(Gender entity) { 309 setGenderPK(entity == null? null: entity.getPrimaryKey()); 310 } 311 312 public boolean getGenderPKHasBeenModified() { 313 return _value.getGenderPKHasBeenModified(); 314 } 315 316 public String getPronouns() { 317 return _value.getPronouns(); 318 } 319 320 public void setPronouns(String pronouns) 321 throws PersistenceNotNullException, PersistenceReadOnlyException { 322 checkReadWrite(); 323 _value.setPronouns(pronouns); 324 } 325 326 public boolean getPronounsHasBeenModified() { 327 return _value.getPronounsHasBeenModified(); 328 } 329 330 public Integer getBirthday() { 331 return _value.getBirthday(); 332 } 333 334 public void setBirthday(Integer birthday) 335 throws PersistenceNotNullException, PersistenceReadOnlyException { 336 checkReadWrite(); 337 _value.setBirthday(birthday); 338 } 339 340 public boolean getBirthdayHasBeenModified() { 341 return _value.getBirthdayHasBeenModified(); 342 } 343 344 public BirthdayFormatPK getBirthdayFormatPK() { 345 return _value.getBirthdayFormatPK(); 346 } 347 348 public BirthdayFormat getBirthdayFormat(Session session, EntityPermission entityPermission) { 349 return BirthdayFormatFactory.getInstance().getEntityFromPK(session, entityPermission, getBirthdayFormatPK()); 350 } 351 352 public BirthdayFormat getBirthdayFormat(EntityPermission entityPermission) { 353 return getBirthdayFormat(ThreadSession.currentSession(), entityPermission); 354 } 355 356 public BirthdayFormat getBirthdayFormat(Session session) { 357 return getBirthdayFormat(session, EntityPermission.READ_ONLY); 358 } 359 360 public BirthdayFormat getBirthdayFormat() { 361 return getBirthdayFormat(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 362 } 363 364 public BirthdayFormat getBirthdayFormatForUpdate(Session session) { 365 return getBirthdayFormat(session, EntityPermission.READ_WRITE); 366 } 367 368 public BirthdayFormat getBirthdayFormatForUpdate() { 369 return getBirthdayFormat(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 370 } 371 372 public void setBirthdayFormatPK(BirthdayFormatPK birthdayFormatPK) 373 throws PersistenceNotNullException, PersistenceReadOnlyException { 374 checkReadWrite(); 375 _value.setBirthdayFormatPK(birthdayFormatPK); 376 } 377 378 public void setBirthdayFormat(BirthdayFormat entity) { 379 setBirthdayFormatPK(entity == null? null: entity.getPrimaryKey()); 380 } 381 382 public boolean getBirthdayFormatPKHasBeenModified() { 383 return _value.getBirthdayFormatPKHasBeenModified(); 384 } 385 386 public String getOccupation() { 387 return _value.getOccupation(); 388 } 389 390 public void setOccupation(String occupation) 391 throws PersistenceNotNullException, PersistenceReadOnlyException { 392 checkReadWrite(); 393 _value.setOccupation(occupation); 394 } 395 396 public boolean getOccupationHasBeenModified() { 397 return _value.getOccupationHasBeenModified(); 398 } 399 400 public String getHobbies() { 401 return _value.getHobbies(); 402 } 403 404 public void setHobbies(String hobbies) 405 throws PersistenceNotNullException, PersistenceReadOnlyException { 406 checkReadWrite(); 407 _value.setHobbies(hobbies); 408 } 409 410 public boolean getHobbiesHasBeenModified() { 411 return _value.getHobbiesHasBeenModified(); 412 } 413 414 public String getLocation() { 415 return _value.getLocation(); 416 } 417 418 public void setLocation(String location) 419 throws PersistenceNotNullException, PersistenceReadOnlyException { 420 checkReadWrite(); 421 _value.setLocation(location); 422 } 423 424 public boolean getLocationHasBeenModified() { 425 return _value.getLocationHasBeenModified(); 426 } 427 428 public MimeTypePK getBioMimeTypePK() { 429 return _value.getBioMimeTypePK(); 430 } 431 432 public MimeType getBioMimeType(Session session, EntityPermission entityPermission) { 433 MimeTypePK pk = getBioMimeTypePK(); 434 MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 435 436 return entity; 437 } 438 439 public MimeType getBioMimeType(EntityPermission entityPermission) { 440 return getBioMimeType(ThreadSession.currentSession(), entityPermission); 441 } 442 443 public MimeType getBioMimeType(Session session) { 444 return getBioMimeType(session, EntityPermission.READ_ONLY); 445 } 446 447 public MimeType getBioMimeType() { 448 return getBioMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 449 } 450 451 public MimeType getBioMimeTypeForUpdate(Session session) { 452 return getBioMimeType(session, EntityPermission.READ_WRITE); 453 } 454 455 public MimeType getBioMimeTypeForUpdate() { 456 return getBioMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 457 } 458 459 public void setBioMimeTypePK(MimeTypePK bioMimeTypePK) 460 throws PersistenceNotNullException, PersistenceReadOnlyException { 461 checkReadWrite(); 462 _value.setBioMimeTypePK(bioMimeTypePK); 463 } 464 465 public void setBioMimeType(MimeType entity) { 466 setBioMimeTypePK(entity == null? null: entity.getPrimaryKey()); 467 } 468 469 public boolean getBioMimeTypePKHasBeenModified() { 470 return _value.getBioMimeTypePKHasBeenModified(); 471 } 472 473 public String getBio() { 474 return _value.getBio(); 475 } 476 477 public void setBio(String bio) 478 throws PersistenceNotNullException, PersistenceReadOnlyException { 479 checkReadWrite(); 480 _value.setBio(bio); 481 } 482 483 public boolean getBioHasBeenModified() { 484 return _value.getBioHasBeenModified(); 485 } 486 487 public MimeTypePK getSignatureMimeTypePK() { 488 return _value.getSignatureMimeTypePK(); 489 } 490 491 public MimeType getSignatureMimeType(Session session, EntityPermission entityPermission) { 492 MimeTypePK pk = getSignatureMimeTypePK(); 493 MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 494 495 return entity; 496 } 497 498 public MimeType getSignatureMimeType(EntityPermission entityPermission) { 499 return getSignatureMimeType(ThreadSession.currentSession(), entityPermission); 500 } 501 502 public MimeType getSignatureMimeType(Session session) { 503 return getSignatureMimeType(session, EntityPermission.READ_ONLY); 504 } 505 506 public MimeType getSignatureMimeType() { 507 return getSignatureMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 508 } 509 510 public MimeType getSignatureMimeTypeForUpdate(Session session) { 511 return getSignatureMimeType(session, EntityPermission.READ_WRITE); 512 } 513 514 public MimeType getSignatureMimeTypeForUpdate() { 515 return getSignatureMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 516 } 517 518 public void setSignatureMimeTypePK(MimeTypePK signatureMimeTypePK) 519 throws PersistenceNotNullException, PersistenceReadOnlyException { 520 checkReadWrite(); 521 _value.setSignatureMimeTypePK(signatureMimeTypePK); 522 } 523 524 public void setSignatureMimeType(MimeType entity) { 525 setSignatureMimeTypePK(entity == null? null: entity.getPrimaryKey()); 526 } 527 528 public boolean getSignatureMimeTypePKHasBeenModified() { 529 return _value.getSignatureMimeTypePKHasBeenModified(); 530 } 531 532 public String getSignature() { 533 return _value.getSignature(); 534 } 535 536 public void setSignature(String signature) 537 throws PersistenceNotNullException, PersistenceReadOnlyException { 538 checkReadWrite(); 539 _value.setSignature(signature); 540 } 541 542 public boolean getSignatureHasBeenModified() { 543 return _value.getSignatureHasBeenModified(); 544 } 545 546 public Long getFromTime() { 547 return _value.getFromTime(); 548 } 549 550 public void setFromTime(Long fromTime) 551 throws PersistenceNotNullException, PersistenceReadOnlyException { 552 checkReadWrite(); 553 _value.setFromTime(fromTime); 554 } 555 556 public boolean getFromTimeHasBeenModified() { 557 return _value.getFromTimeHasBeenModified(); 558 } 559 560 public Long getThruTime() { 561 return _value.getThruTime(); 562 } 563 564 public void setThruTime(Long thruTime) 565 throws PersistenceNotNullException, PersistenceReadOnlyException { 566 checkReadWrite(); 567 _value.setThruTime(thruTime); 568 } 569 570 public boolean getThruTimeHasBeenModified() { 571 return _value.getThruTimeHasBeenModified(); 572 } 573 574}