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 * ContactPostalAddressCorrection.java 021 */ 022 023package com.echothree.model.data.contact.server.entity; 024 025import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK; 026 027import com.echothree.model.data.contact.common.pk.ContactMechanismPK; 028import com.echothree.model.data.geo.common.pk.GeoCodePK; 029 030import com.echothree.model.data.contact.server.entity.ContactMechanism; 031import com.echothree.model.data.geo.server.entity.GeoCode; 032 033import com.echothree.model.data.contact.server.factory.ContactMechanismFactory; 034import com.echothree.model.data.geo.server.factory.GeoCodeFactory; 035 036import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK; 037 038import com.echothree.model.data.contact.server.value.ContactPostalAddressCorrectionValue; 039 040import com.echothree.model.data.contact.server.factory.ContactPostalAddressCorrectionFactory; 041 042import com.echothree.util.common.exception.PersistenceException; 043import com.echothree.util.common.exception.PersistenceDatabaseException; 044import com.echothree.util.common.exception.PersistenceNotNullException; 045import com.echothree.util.common.exception.PersistenceReadOnlyException; 046 047import com.echothree.util.common.persistence.BasePK; 048 049import com.echothree.util.common.persistence.type.ByteArray; 050 051import com.echothree.util.server.persistence.BaseEntity; 052import com.echothree.util.server.persistence.EntityPermission; 053import com.echothree.util.server.persistence.Session; 054import com.echothree.util.server.persistence.ThreadSession; 055 056import java.io.Serializable; 057 058public class ContactPostalAddressCorrection 059 extends BaseEntity 060 implements Serializable { 061 062 private ContactPostalAddressCorrectionPK _pk; 063 private ContactPostalAddressCorrectionValue _value; 064 065 /** Creates a new instance of ContactPostalAddressCorrection */ 066 public ContactPostalAddressCorrection() 067 throws PersistenceException { 068 super(); 069 } 070 071 /** Creates a new instance of ContactPostalAddressCorrection */ 072 public ContactPostalAddressCorrection(ContactPostalAddressCorrectionValue value, EntityPermission entityPermission) { 073 super(entityPermission); 074 075 _value = value; 076 _pk = value.getPrimaryKey(); 077 } 078 079 @Override 080 public ContactPostalAddressCorrectionFactory getBaseFactoryInstance() { 081 return ContactPostalAddressCorrectionFactory.getInstance(); 082 } 083 084 @Override 085 public boolean hasBeenModified() { 086 return _value.hasBeenModified(); 087 } 088 089 @Override 090 public int hashCode() { 091 return _pk.hashCode(); 092 } 093 094 @Override 095 public String toString() { 096 return _pk.toString(); 097 } 098 099 @Override 100 public boolean equals(Object other) { 101 if(this == other) 102 return true; 103 104 if(other instanceof ContactPostalAddressCorrection) { 105 ContactPostalAddressCorrection that = (ContactPostalAddressCorrection)other; 106 107 ContactPostalAddressCorrectionValue thatValue = that.getContactPostalAddressCorrectionValue(); 108 return _value.equals(thatValue); 109 } else { 110 return false; 111 } 112 } 113 114 @Override 115 public void store(Session session) 116 throws PersistenceDatabaseException { 117 getBaseFactoryInstance().store(session, this); 118 } 119 120 @Override 121 public void remove(Session session) 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().remove(session, this); 124 } 125 126 @Override 127 public void remove() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 130 } 131 132 public ContactPostalAddressCorrectionValue getContactPostalAddressCorrectionValue() { 133 return _value; 134 } 135 136 public void setContactPostalAddressCorrectionValue(ContactPostalAddressCorrectionValue value) 137 throws PersistenceReadOnlyException { 138 checkReadWrite(); 139 _value = value; 140 } 141 142 @Override 143 public ContactPostalAddressCorrectionPK getPrimaryKey() { 144 return _pk; 145 } 146 147 public ContactMechanismPK getContactMechanismPK() { 148 return _value.getContactMechanismPK(); 149 } 150 151 public ContactMechanism getContactMechanism(Session session, EntityPermission entityPermission) { 152 return ContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getContactMechanismPK()); 153 } 154 155 public ContactMechanism getContactMechanism(EntityPermission entityPermission) { 156 return getContactMechanism(ThreadSession.currentSession(), entityPermission); 157 } 158 159 public ContactMechanism getContactMechanism(Session session) { 160 return getContactMechanism(session, EntityPermission.READ_ONLY); 161 } 162 163 public ContactMechanism getContactMechanism() { 164 return getContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 165 } 166 167 public ContactMechanism getContactMechanismForUpdate(Session session) { 168 return getContactMechanism(session, EntityPermission.READ_WRITE); 169 } 170 171 public ContactMechanism getContactMechanismForUpdate() { 172 return getContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 173 } 174 175 public void setContactMechanismPK(ContactMechanismPK contactMechanismPK) 176 throws PersistenceNotNullException, PersistenceReadOnlyException { 177 checkReadWrite(); 178 _value.setContactMechanismPK(contactMechanismPK); 179 } 180 181 public void setContactMechanism(ContactMechanism entity) { 182 setContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 183 } 184 185 public boolean getContactMechanismPKHasBeenModified() { 186 return _value.getContactMechanismPKHasBeenModified(); 187 } 188 189 public String getAddress1() { 190 return _value.getAddress1(); 191 } 192 193 public void setAddress1(String address1) 194 throws PersistenceNotNullException, PersistenceReadOnlyException { 195 checkReadWrite(); 196 _value.setAddress1(address1); 197 } 198 199 public boolean getAddress1HasBeenModified() { 200 return _value.getAddress1HasBeenModified(); 201 } 202 203 public String getAddress2() { 204 return _value.getAddress2(); 205 } 206 207 public void setAddress2(String address2) 208 throws PersistenceNotNullException, PersistenceReadOnlyException { 209 checkReadWrite(); 210 _value.setAddress2(address2); 211 } 212 213 public boolean getAddress2HasBeenModified() { 214 return _value.getAddress2HasBeenModified(); 215 } 216 217 public String getAddress3() { 218 return _value.getAddress3(); 219 } 220 221 public void setAddress3(String address3) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setAddress3(address3); 225 } 226 227 public boolean getAddress3HasBeenModified() { 228 return _value.getAddress3HasBeenModified(); 229 } 230 231 public String getCity() { 232 return _value.getCity(); 233 } 234 235 public void setCity(String city) 236 throws PersistenceNotNullException, PersistenceReadOnlyException { 237 checkReadWrite(); 238 _value.setCity(city); 239 } 240 241 public boolean getCityHasBeenModified() { 242 return _value.getCityHasBeenModified(); 243 } 244 245 public GeoCodePK getCityGeoCodePK() { 246 return _value.getCityGeoCodePK(); 247 } 248 249 public GeoCode getCityGeoCode(Session session, EntityPermission entityPermission) { 250 GeoCodePK pk = getCityGeoCodePK(); 251 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 252 253 return entity; 254 } 255 256 public GeoCode getCityGeoCode(EntityPermission entityPermission) { 257 return getCityGeoCode(ThreadSession.currentSession(), entityPermission); 258 } 259 260 public GeoCode getCityGeoCode(Session session) { 261 return getCityGeoCode(session, EntityPermission.READ_ONLY); 262 } 263 264 public GeoCode getCityGeoCode() { 265 return getCityGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 266 } 267 268 public GeoCode getCityGeoCodeForUpdate(Session session) { 269 return getCityGeoCode(session, EntityPermission.READ_WRITE); 270 } 271 272 public GeoCode getCityGeoCodeForUpdate() { 273 return getCityGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 274 } 275 276 public void setCityGeoCodePK(GeoCodePK cityGeoCodePK) 277 throws PersistenceNotNullException, PersistenceReadOnlyException { 278 checkReadWrite(); 279 _value.setCityGeoCodePK(cityGeoCodePK); 280 } 281 282 public void setCityGeoCode(GeoCode entity) { 283 setCityGeoCodePK(entity == null? null: entity.getPrimaryKey()); 284 } 285 286 public boolean getCityGeoCodePKHasBeenModified() { 287 return _value.getCityGeoCodePKHasBeenModified(); 288 } 289 290 public GeoCodePK getCountyGeoCodePK() { 291 return _value.getCountyGeoCodePK(); 292 } 293 294 public GeoCode getCountyGeoCode(Session session, EntityPermission entityPermission) { 295 GeoCodePK pk = getCountyGeoCodePK(); 296 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 297 298 return entity; 299 } 300 301 public GeoCode getCountyGeoCode(EntityPermission entityPermission) { 302 return getCountyGeoCode(ThreadSession.currentSession(), entityPermission); 303 } 304 305 public GeoCode getCountyGeoCode(Session session) { 306 return getCountyGeoCode(session, EntityPermission.READ_ONLY); 307 } 308 309 public GeoCode getCountyGeoCode() { 310 return getCountyGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 311 } 312 313 public GeoCode getCountyGeoCodeForUpdate(Session session) { 314 return getCountyGeoCode(session, EntityPermission.READ_WRITE); 315 } 316 317 public GeoCode getCountyGeoCodeForUpdate() { 318 return getCountyGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 319 } 320 321 public void setCountyGeoCodePK(GeoCodePK countyGeoCodePK) 322 throws PersistenceNotNullException, PersistenceReadOnlyException { 323 checkReadWrite(); 324 _value.setCountyGeoCodePK(countyGeoCodePK); 325 } 326 327 public void setCountyGeoCode(GeoCode entity) { 328 setCountyGeoCodePK(entity == null? null: entity.getPrimaryKey()); 329 } 330 331 public boolean getCountyGeoCodePKHasBeenModified() { 332 return _value.getCountyGeoCodePKHasBeenModified(); 333 } 334 335 public String getState() { 336 return _value.getState(); 337 } 338 339 public void setState(String state) 340 throws PersistenceNotNullException, PersistenceReadOnlyException { 341 checkReadWrite(); 342 _value.setState(state); 343 } 344 345 public boolean getStateHasBeenModified() { 346 return _value.getStateHasBeenModified(); 347 } 348 349 public GeoCodePK getStateGeoCodePK() { 350 return _value.getStateGeoCodePK(); 351 } 352 353 public GeoCode getStateGeoCode(Session session, EntityPermission entityPermission) { 354 GeoCodePK pk = getStateGeoCodePK(); 355 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 356 357 return entity; 358 } 359 360 public GeoCode getStateGeoCode(EntityPermission entityPermission) { 361 return getStateGeoCode(ThreadSession.currentSession(), entityPermission); 362 } 363 364 public GeoCode getStateGeoCode(Session session) { 365 return getStateGeoCode(session, EntityPermission.READ_ONLY); 366 } 367 368 public GeoCode getStateGeoCode() { 369 return getStateGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 370 } 371 372 public GeoCode getStateGeoCodeForUpdate(Session session) { 373 return getStateGeoCode(session, EntityPermission.READ_WRITE); 374 } 375 376 public GeoCode getStateGeoCodeForUpdate() { 377 return getStateGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 378 } 379 380 public void setStateGeoCodePK(GeoCodePK stateGeoCodePK) 381 throws PersistenceNotNullException, PersistenceReadOnlyException { 382 checkReadWrite(); 383 _value.setStateGeoCodePK(stateGeoCodePK); 384 } 385 386 public void setStateGeoCode(GeoCode entity) { 387 setStateGeoCodePK(entity == null? null: entity.getPrimaryKey()); 388 } 389 390 public boolean getStateGeoCodePKHasBeenModified() { 391 return _value.getStateGeoCodePKHasBeenModified(); 392 } 393 394 public String getPostalCode() { 395 return _value.getPostalCode(); 396 } 397 398 public void setPostalCode(String postalCode) 399 throws PersistenceNotNullException, PersistenceReadOnlyException { 400 checkReadWrite(); 401 _value.setPostalCode(postalCode); 402 } 403 404 public boolean getPostalCodeHasBeenModified() { 405 return _value.getPostalCodeHasBeenModified(); 406 } 407 408 public GeoCodePK getPostalCodeGeoCodePK() { 409 return _value.getPostalCodeGeoCodePK(); 410 } 411 412 public GeoCode getPostalCodeGeoCode(Session session, EntityPermission entityPermission) { 413 GeoCodePK pk = getPostalCodeGeoCodePK(); 414 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 415 416 return entity; 417 } 418 419 public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) { 420 return getPostalCodeGeoCode(ThreadSession.currentSession(), entityPermission); 421 } 422 423 public GeoCode getPostalCodeGeoCode(Session session) { 424 return getPostalCodeGeoCode(session, EntityPermission.READ_ONLY); 425 } 426 427 public GeoCode getPostalCodeGeoCode() { 428 return getPostalCodeGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 429 } 430 431 public GeoCode getPostalCodeGeoCodeForUpdate(Session session) { 432 return getPostalCodeGeoCode(session, EntityPermission.READ_WRITE); 433 } 434 435 public GeoCode getPostalCodeGeoCodeForUpdate() { 436 return getPostalCodeGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 437 } 438 439 public void setPostalCodeGeoCodePK(GeoCodePK postalCodeGeoCodePK) 440 throws PersistenceNotNullException, PersistenceReadOnlyException { 441 checkReadWrite(); 442 _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK); 443 } 444 445 public void setPostalCodeGeoCode(GeoCode entity) { 446 setPostalCodeGeoCodePK(entity == null? null: entity.getPrimaryKey()); 447 } 448 449 public boolean getPostalCodeGeoCodePKHasBeenModified() { 450 return _value.getPostalCodeGeoCodePKHasBeenModified(); 451 } 452 453 public GeoCodePK getCountryGeoCodePK() { 454 return _value.getCountryGeoCodePK(); 455 } 456 457 public GeoCode getCountryGeoCode(Session session, EntityPermission entityPermission) { 458 return GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getCountryGeoCodePK()); 459 } 460 461 public GeoCode getCountryGeoCode(EntityPermission entityPermission) { 462 return getCountryGeoCode(ThreadSession.currentSession(), entityPermission); 463 } 464 465 public GeoCode getCountryGeoCode(Session session) { 466 return getCountryGeoCode(session, EntityPermission.READ_ONLY); 467 } 468 469 public GeoCode getCountryGeoCode() { 470 return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 471 } 472 473 public GeoCode getCountryGeoCodeForUpdate(Session session) { 474 return getCountryGeoCode(session, EntityPermission.READ_WRITE); 475 } 476 477 public GeoCode getCountryGeoCodeForUpdate() { 478 return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 479 } 480 481 public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK) 482 throws PersistenceNotNullException, PersistenceReadOnlyException { 483 checkReadWrite(); 484 _value.setCountryGeoCodePK(countryGeoCodePK); 485 } 486 487 public void setCountryGeoCode(GeoCode entity) { 488 setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey()); 489 } 490 491 public boolean getCountryGeoCodePKHasBeenModified() { 492 return _value.getCountryGeoCodePKHasBeenModified(); 493 } 494 495 public Long getFromTime() { 496 return _value.getFromTime(); 497 } 498 499 public void setFromTime(Long fromTime) 500 throws PersistenceNotNullException, PersistenceReadOnlyException { 501 checkReadWrite(); 502 _value.setFromTime(fromTime); 503 } 504 505 public boolean getFromTimeHasBeenModified() { 506 return _value.getFromTimeHasBeenModified(); 507 } 508 509 public Long getThruTime() { 510 return _value.getThruTime(); 511 } 512 513 public void setThruTime(Long thruTime) 514 throws PersistenceNotNullException, PersistenceReadOnlyException { 515 checkReadWrite(); 516 _value.setThruTime(thruTime); 517 } 518 519 public boolean getThruTimeHasBeenModified() { 520 return _value.getThruTimeHasBeenModified(); 521 } 522 523}