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 * ContactPostalAddress.java 021 */ 022 023package com.echothree.model.data.contact.server.entity; 024 025import com.echothree.model.data.contact.common.pk.ContactPostalAddressPK; 026 027import com.echothree.model.data.contact.common.pk.ContactMechanismPK; 028import com.echothree.model.data.party.common.pk.PersonalTitlePK; 029import com.echothree.model.data.party.common.pk.NameSuffixPK; 030import com.echothree.model.data.geo.common.pk.GeoCodePK; 031 032import com.echothree.model.data.contact.server.entity.ContactMechanism; 033import com.echothree.model.data.party.server.entity.PersonalTitle; 034import com.echothree.model.data.party.server.entity.NameSuffix; 035import com.echothree.model.data.geo.server.entity.GeoCode; 036 037import com.echothree.model.data.contact.server.factory.ContactMechanismFactory; 038import com.echothree.model.data.party.server.factory.PersonalTitleFactory; 039import com.echothree.model.data.party.server.factory.NameSuffixFactory; 040import com.echothree.model.data.geo.server.factory.GeoCodeFactory; 041 042import com.echothree.model.data.contact.common.pk.ContactPostalAddressPK; 043 044import com.echothree.model.data.contact.server.value.ContactPostalAddressValue; 045 046import com.echothree.model.data.contact.server.factory.ContactPostalAddressFactory; 047 048import com.echothree.util.common.exception.PersistenceException; 049import com.echothree.util.common.exception.PersistenceDatabaseException; 050import com.echothree.util.common.exception.PersistenceNotNullException; 051import com.echothree.util.common.exception.PersistenceReadOnlyException; 052 053import com.echothree.util.common.persistence.BasePK; 054 055import com.echothree.util.common.persistence.type.ByteArray; 056 057import com.echothree.util.server.persistence.BaseEntity; 058import com.echothree.util.server.persistence.EntityPermission; 059import com.echothree.util.server.persistence.Session; 060import com.echothree.util.server.persistence.ThreadSession; 061 062import java.io.Serializable; 063 064public class ContactPostalAddress 065 extends BaseEntity 066 implements Serializable { 067 068 private ContactPostalAddressPK _pk; 069 private ContactPostalAddressValue _value; 070 071 /** Creates a new instance of ContactPostalAddress */ 072 public ContactPostalAddress() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of ContactPostalAddress */ 078 public ContactPostalAddress(ContactPostalAddressValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public ContactPostalAddressFactory getBaseFactoryInstance() { 087 return ContactPostalAddressFactory.getInstance(); 088 } 089 090 @Override 091 public boolean hasBeenModified() { 092 return _value.hasBeenModified(); 093 } 094 095 @Override 096 public int hashCode() { 097 return _pk.hashCode(); 098 } 099 100 @Override 101 public String toString() { 102 return _pk.toString(); 103 } 104 105 @Override 106 public boolean equals(Object other) { 107 if(this == other) 108 return true; 109 110 if(other instanceof ContactPostalAddress that) { 111 ContactPostalAddressValue thatValue = that.getContactPostalAddressValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public ContactPostalAddressValue getContactPostalAddressValue() { 131 return _value; 132 } 133 134 public void setContactPostalAddressValue(ContactPostalAddressValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public ContactPostalAddressPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public ContactMechanismPK getContactMechanismPK() { 146 return _value.getContactMechanismPK(); 147 } 148 149 public ContactMechanism getContactMechanism(EntityPermission entityPermission) { 150 return ContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getContactMechanismPK()); 151 } 152 153 public ContactMechanism getContactMechanism() { 154 return getContactMechanism(EntityPermission.READ_ONLY); 155 } 156 157 public ContactMechanism getContactMechanismForUpdate() { 158 return getContactMechanism(EntityPermission.READ_WRITE); 159 } 160 161 public void setContactMechanismPK(ContactMechanismPK contactMechanismPK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setContactMechanismPK(contactMechanismPK); 165 } 166 167 public void setContactMechanism(ContactMechanism entity) { 168 setContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getContactMechanismPKHasBeenModified() { 172 return _value.getContactMechanismPKHasBeenModified(); 173 } 174 175 public PersonalTitlePK getPersonalTitlePK() { 176 return _value.getPersonalTitlePK(); 177 } 178 179 public PersonalTitle getPersonalTitle(EntityPermission entityPermission) { 180 PersonalTitlePK pk = getPersonalTitlePK(); 181 PersonalTitle entity = pk == null? null: PersonalTitleFactory.getInstance().getEntityFromPK(entityPermission, pk); 182 183 return entity; 184 } 185 186 public PersonalTitle getPersonalTitle() { 187 return getPersonalTitle(EntityPermission.READ_ONLY); 188 } 189 190 public PersonalTitle getPersonalTitleForUpdate() { 191 return getPersonalTitle(EntityPermission.READ_WRITE); 192 } 193 194 public void setPersonalTitlePK(PersonalTitlePK personalTitlePK) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setPersonalTitlePK(personalTitlePK); 198 } 199 200 public void setPersonalTitle(PersonalTitle entity) { 201 setPersonalTitlePK(entity == null? null: entity.getPrimaryKey()); 202 } 203 204 public boolean getPersonalTitlePKHasBeenModified() { 205 return _value.getPersonalTitlePKHasBeenModified(); 206 } 207 208 public String getFirstName() { 209 return _value.getFirstName(); 210 } 211 212 public void setFirstName(String firstName) 213 throws PersistenceNotNullException, PersistenceReadOnlyException { 214 checkReadWrite(); 215 _value.setFirstName(firstName); 216 } 217 218 public boolean getFirstNameHasBeenModified() { 219 return _value.getFirstNameHasBeenModified(); 220 } 221 222 public String getFirstNameSdx() { 223 return _value.getFirstNameSdx(); 224 } 225 226 public void setFirstNameSdx(String firstNameSdx) 227 throws PersistenceNotNullException, PersistenceReadOnlyException { 228 checkReadWrite(); 229 _value.setFirstNameSdx(firstNameSdx); 230 } 231 232 public boolean getFirstNameSdxHasBeenModified() { 233 return _value.getFirstNameSdxHasBeenModified(); 234 } 235 236 public String getMiddleName() { 237 return _value.getMiddleName(); 238 } 239 240 public void setMiddleName(String middleName) 241 throws PersistenceNotNullException, PersistenceReadOnlyException { 242 checkReadWrite(); 243 _value.setMiddleName(middleName); 244 } 245 246 public boolean getMiddleNameHasBeenModified() { 247 return _value.getMiddleNameHasBeenModified(); 248 } 249 250 public String getMiddleNameSdx() { 251 return _value.getMiddleNameSdx(); 252 } 253 254 public void setMiddleNameSdx(String middleNameSdx) 255 throws PersistenceNotNullException, PersistenceReadOnlyException { 256 checkReadWrite(); 257 _value.setMiddleNameSdx(middleNameSdx); 258 } 259 260 public boolean getMiddleNameSdxHasBeenModified() { 261 return _value.getMiddleNameSdxHasBeenModified(); 262 } 263 264 public String getLastName() { 265 return _value.getLastName(); 266 } 267 268 public void setLastName(String lastName) 269 throws PersistenceNotNullException, PersistenceReadOnlyException { 270 checkReadWrite(); 271 _value.setLastName(lastName); 272 } 273 274 public boolean getLastNameHasBeenModified() { 275 return _value.getLastNameHasBeenModified(); 276 } 277 278 public String getLastNameSdx() { 279 return _value.getLastNameSdx(); 280 } 281 282 public void setLastNameSdx(String lastNameSdx) 283 throws PersistenceNotNullException, PersistenceReadOnlyException { 284 checkReadWrite(); 285 _value.setLastNameSdx(lastNameSdx); 286 } 287 288 public boolean getLastNameSdxHasBeenModified() { 289 return _value.getLastNameSdxHasBeenModified(); 290 } 291 292 public NameSuffixPK getNameSuffixPK() { 293 return _value.getNameSuffixPK(); 294 } 295 296 public NameSuffix getNameSuffix(EntityPermission entityPermission) { 297 NameSuffixPK pk = getNameSuffixPK(); 298 NameSuffix entity = pk == null? null: NameSuffixFactory.getInstance().getEntityFromPK(entityPermission, pk); 299 300 return entity; 301 } 302 303 public NameSuffix getNameSuffix() { 304 return getNameSuffix(EntityPermission.READ_ONLY); 305 } 306 307 public NameSuffix getNameSuffixForUpdate() { 308 return getNameSuffix(EntityPermission.READ_WRITE); 309 } 310 311 public void setNameSuffixPK(NameSuffixPK nameSuffixPK) 312 throws PersistenceNotNullException, PersistenceReadOnlyException { 313 checkReadWrite(); 314 _value.setNameSuffixPK(nameSuffixPK); 315 } 316 317 public void setNameSuffix(NameSuffix entity) { 318 setNameSuffixPK(entity == null? null: entity.getPrimaryKey()); 319 } 320 321 public boolean getNameSuffixPKHasBeenModified() { 322 return _value.getNameSuffixPKHasBeenModified(); 323 } 324 325 public String getCompanyName() { 326 return _value.getCompanyName(); 327 } 328 329 public void setCompanyName(String companyName) 330 throws PersistenceNotNullException, PersistenceReadOnlyException { 331 checkReadWrite(); 332 _value.setCompanyName(companyName); 333 } 334 335 public boolean getCompanyNameHasBeenModified() { 336 return _value.getCompanyNameHasBeenModified(); 337 } 338 339 public String getAttention() { 340 return _value.getAttention(); 341 } 342 343 public void setAttention(String attention) 344 throws PersistenceNotNullException, PersistenceReadOnlyException { 345 checkReadWrite(); 346 _value.setAttention(attention); 347 } 348 349 public boolean getAttentionHasBeenModified() { 350 return _value.getAttentionHasBeenModified(); 351 } 352 353 public String getAddress1() { 354 return _value.getAddress1(); 355 } 356 357 public void setAddress1(String address1) 358 throws PersistenceNotNullException, PersistenceReadOnlyException { 359 checkReadWrite(); 360 _value.setAddress1(address1); 361 } 362 363 public boolean getAddress1HasBeenModified() { 364 return _value.getAddress1HasBeenModified(); 365 } 366 367 public String getAddress2() { 368 return _value.getAddress2(); 369 } 370 371 public void setAddress2(String address2) 372 throws PersistenceNotNullException, PersistenceReadOnlyException { 373 checkReadWrite(); 374 _value.setAddress2(address2); 375 } 376 377 public boolean getAddress2HasBeenModified() { 378 return _value.getAddress2HasBeenModified(); 379 } 380 381 public String getAddress3() { 382 return _value.getAddress3(); 383 } 384 385 public void setAddress3(String address3) 386 throws PersistenceNotNullException, PersistenceReadOnlyException { 387 checkReadWrite(); 388 _value.setAddress3(address3); 389 } 390 391 public boolean getAddress3HasBeenModified() { 392 return _value.getAddress3HasBeenModified(); 393 } 394 395 public String getCity() { 396 return _value.getCity(); 397 } 398 399 public void setCity(String city) 400 throws PersistenceNotNullException, PersistenceReadOnlyException { 401 checkReadWrite(); 402 _value.setCity(city); 403 } 404 405 public boolean getCityHasBeenModified() { 406 return _value.getCityHasBeenModified(); 407 } 408 409 public GeoCodePK getCityGeoCodePK() { 410 return _value.getCityGeoCodePK(); 411 } 412 413 public GeoCode getCityGeoCode(EntityPermission entityPermission) { 414 GeoCodePK pk = getCityGeoCodePK(); 415 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 416 417 return entity; 418 } 419 420 public GeoCode getCityGeoCode() { 421 return getCityGeoCode(EntityPermission.READ_ONLY); 422 } 423 424 public GeoCode getCityGeoCodeForUpdate() { 425 return getCityGeoCode(EntityPermission.READ_WRITE); 426 } 427 428 public void setCityGeoCodePK(GeoCodePK cityGeoCodePK) 429 throws PersistenceNotNullException, PersistenceReadOnlyException { 430 checkReadWrite(); 431 _value.setCityGeoCodePK(cityGeoCodePK); 432 } 433 434 public void setCityGeoCode(GeoCode entity) { 435 setCityGeoCodePK(entity == null? null: entity.getPrimaryKey()); 436 } 437 438 public boolean getCityGeoCodePKHasBeenModified() { 439 return _value.getCityGeoCodePKHasBeenModified(); 440 } 441 442 public GeoCodePK getCountyGeoCodePK() { 443 return _value.getCountyGeoCodePK(); 444 } 445 446 public GeoCode getCountyGeoCode(EntityPermission entityPermission) { 447 GeoCodePK pk = getCountyGeoCodePK(); 448 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 449 450 return entity; 451 } 452 453 public GeoCode getCountyGeoCode() { 454 return getCountyGeoCode(EntityPermission.READ_ONLY); 455 } 456 457 public GeoCode getCountyGeoCodeForUpdate() { 458 return getCountyGeoCode(EntityPermission.READ_WRITE); 459 } 460 461 public void setCountyGeoCodePK(GeoCodePK countyGeoCodePK) 462 throws PersistenceNotNullException, PersistenceReadOnlyException { 463 checkReadWrite(); 464 _value.setCountyGeoCodePK(countyGeoCodePK); 465 } 466 467 public void setCountyGeoCode(GeoCode entity) { 468 setCountyGeoCodePK(entity == null? null: entity.getPrimaryKey()); 469 } 470 471 public boolean getCountyGeoCodePKHasBeenModified() { 472 return _value.getCountyGeoCodePKHasBeenModified(); 473 } 474 475 public String getState() { 476 return _value.getState(); 477 } 478 479 public void setState(String state) 480 throws PersistenceNotNullException, PersistenceReadOnlyException { 481 checkReadWrite(); 482 _value.setState(state); 483 } 484 485 public boolean getStateHasBeenModified() { 486 return _value.getStateHasBeenModified(); 487 } 488 489 public GeoCodePK getStateGeoCodePK() { 490 return _value.getStateGeoCodePK(); 491 } 492 493 public GeoCode getStateGeoCode(EntityPermission entityPermission) { 494 GeoCodePK pk = getStateGeoCodePK(); 495 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 496 497 return entity; 498 } 499 500 public GeoCode getStateGeoCode() { 501 return getStateGeoCode(EntityPermission.READ_ONLY); 502 } 503 504 public GeoCode getStateGeoCodeForUpdate() { 505 return getStateGeoCode(EntityPermission.READ_WRITE); 506 } 507 508 public void setStateGeoCodePK(GeoCodePK stateGeoCodePK) 509 throws PersistenceNotNullException, PersistenceReadOnlyException { 510 checkReadWrite(); 511 _value.setStateGeoCodePK(stateGeoCodePK); 512 } 513 514 public void setStateGeoCode(GeoCode entity) { 515 setStateGeoCodePK(entity == null? null: entity.getPrimaryKey()); 516 } 517 518 public boolean getStateGeoCodePKHasBeenModified() { 519 return _value.getStateGeoCodePKHasBeenModified(); 520 } 521 522 public String getPostalCode() { 523 return _value.getPostalCode(); 524 } 525 526 public void setPostalCode(String postalCode) 527 throws PersistenceNotNullException, PersistenceReadOnlyException { 528 checkReadWrite(); 529 _value.setPostalCode(postalCode); 530 } 531 532 public boolean getPostalCodeHasBeenModified() { 533 return _value.getPostalCodeHasBeenModified(); 534 } 535 536 public GeoCodePK getPostalCodeGeoCodePK() { 537 return _value.getPostalCodeGeoCodePK(); 538 } 539 540 public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) { 541 GeoCodePK pk = getPostalCodeGeoCodePK(); 542 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 543 544 return entity; 545 } 546 547 public GeoCode getPostalCodeGeoCode() { 548 return getPostalCodeGeoCode(EntityPermission.READ_ONLY); 549 } 550 551 public GeoCode getPostalCodeGeoCodeForUpdate() { 552 return getPostalCodeGeoCode(EntityPermission.READ_WRITE); 553 } 554 555 public void setPostalCodeGeoCodePK(GeoCodePK postalCodeGeoCodePK) 556 throws PersistenceNotNullException, PersistenceReadOnlyException { 557 checkReadWrite(); 558 _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK); 559 } 560 561 public void setPostalCodeGeoCode(GeoCode entity) { 562 setPostalCodeGeoCodePK(entity == null? null: entity.getPrimaryKey()); 563 } 564 565 public boolean getPostalCodeGeoCodePKHasBeenModified() { 566 return _value.getPostalCodeGeoCodePKHasBeenModified(); 567 } 568 569 public GeoCodePK getCountryGeoCodePK() { 570 return _value.getCountryGeoCodePK(); 571 } 572 573 public GeoCode getCountryGeoCode(EntityPermission entityPermission) { 574 return GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, getCountryGeoCodePK()); 575 } 576 577 public GeoCode getCountryGeoCode() { 578 return getCountryGeoCode(EntityPermission.READ_ONLY); 579 } 580 581 public GeoCode getCountryGeoCodeForUpdate() { 582 return getCountryGeoCode(EntityPermission.READ_WRITE); 583 } 584 585 public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK) 586 throws PersistenceNotNullException, PersistenceReadOnlyException { 587 checkReadWrite(); 588 _value.setCountryGeoCodePK(countryGeoCodePK); 589 } 590 591 public void setCountryGeoCode(GeoCode entity) { 592 setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey()); 593 } 594 595 public boolean getCountryGeoCodePKHasBeenModified() { 596 return _value.getCountryGeoCodePKHasBeenModified(); 597 } 598 599 public Boolean getIsCommercial() { 600 return _value.getIsCommercial(); 601 } 602 603 public void setIsCommercial(Boolean isCommercial) 604 throws PersistenceNotNullException, PersistenceReadOnlyException { 605 checkReadWrite(); 606 _value.setIsCommercial(isCommercial); 607 } 608 609 public boolean getIsCommercialHasBeenModified() { 610 return _value.getIsCommercialHasBeenModified(); 611 } 612 613 public Long getFromTime() { 614 return _value.getFromTime(); 615 } 616 617 public void setFromTime(Long fromTime) 618 throws PersistenceNotNullException, PersistenceReadOnlyException { 619 checkReadWrite(); 620 _value.setFromTime(fromTime); 621 } 622 623 public boolean getFromTimeHasBeenModified() { 624 return _value.getFromTimeHasBeenModified(); 625 } 626 627 public Long getThruTime() { 628 return _value.getThruTime(); 629 } 630 631 public void setThruTime(Long thruTime) 632 throws PersistenceNotNullException, PersistenceReadOnlyException { 633 checkReadWrite(); 634 _value.setThruTime(thruTime); 635 } 636 637 public boolean getThruTimeHasBeenModified() { 638 return _value.getThruTimeHasBeenModified(); 639 } 640 641}