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 * 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 that) { 105 ContactPostalAddressCorrectionValue thatValue = that.getContactPostalAddressCorrectionValue(); 106 return _value.equals(thatValue); 107 } else { 108 return false; 109 } 110 } 111 112 @Override 113 public void store() 114 throws PersistenceDatabaseException { 115 getBaseFactoryInstance().store(this); 116 } 117 118 @Override 119 public void remove() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().remove(this); 122 } 123 124 public ContactPostalAddressCorrectionValue getContactPostalAddressCorrectionValue() { 125 return _value; 126 } 127 128 public void setContactPostalAddressCorrectionValue(ContactPostalAddressCorrectionValue value) 129 throws PersistenceReadOnlyException { 130 checkReadWrite(); 131 _value = value; 132 } 133 134 @Override 135 public ContactPostalAddressCorrectionPK getPrimaryKey() { 136 return _pk; 137 } 138 139 public ContactMechanismPK getContactMechanismPK() { 140 return _value.getContactMechanismPK(); 141 } 142 143 public ContactMechanism getContactMechanism(EntityPermission entityPermission) { 144 return ContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getContactMechanismPK()); 145 } 146 147 public ContactMechanism getContactMechanism() { 148 return getContactMechanism(EntityPermission.READ_ONLY); 149 } 150 151 public ContactMechanism getContactMechanismForUpdate() { 152 return getContactMechanism(EntityPermission.READ_WRITE); 153 } 154 155 public void setContactMechanismPK(ContactMechanismPK contactMechanismPK) 156 throws PersistenceNotNullException, PersistenceReadOnlyException { 157 checkReadWrite(); 158 _value.setContactMechanismPK(contactMechanismPK); 159 } 160 161 public void setContactMechanism(ContactMechanism entity) { 162 setContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 163 } 164 165 public boolean getContactMechanismPKHasBeenModified() { 166 return _value.getContactMechanismPKHasBeenModified(); 167 } 168 169 public String getAddress1() { 170 return _value.getAddress1(); 171 } 172 173 public void setAddress1(String address1) 174 throws PersistenceNotNullException, PersistenceReadOnlyException { 175 checkReadWrite(); 176 _value.setAddress1(address1); 177 } 178 179 public boolean getAddress1HasBeenModified() { 180 return _value.getAddress1HasBeenModified(); 181 } 182 183 public String getAddress2() { 184 return _value.getAddress2(); 185 } 186 187 public void setAddress2(String address2) 188 throws PersistenceNotNullException, PersistenceReadOnlyException { 189 checkReadWrite(); 190 _value.setAddress2(address2); 191 } 192 193 public boolean getAddress2HasBeenModified() { 194 return _value.getAddress2HasBeenModified(); 195 } 196 197 public String getAddress3() { 198 return _value.getAddress3(); 199 } 200 201 public void setAddress3(String address3) 202 throws PersistenceNotNullException, PersistenceReadOnlyException { 203 checkReadWrite(); 204 _value.setAddress3(address3); 205 } 206 207 public boolean getAddress3HasBeenModified() { 208 return _value.getAddress3HasBeenModified(); 209 } 210 211 public String getCity() { 212 return _value.getCity(); 213 } 214 215 public void setCity(String city) 216 throws PersistenceNotNullException, PersistenceReadOnlyException { 217 checkReadWrite(); 218 _value.setCity(city); 219 } 220 221 public boolean getCityHasBeenModified() { 222 return _value.getCityHasBeenModified(); 223 } 224 225 public GeoCodePK getCityGeoCodePK() { 226 return _value.getCityGeoCodePK(); 227 } 228 229 public GeoCode getCityGeoCode(EntityPermission entityPermission) { 230 GeoCodePK pk = getCityGeoCodePK(); 231 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 232 233 return entity; 234 } 235 236 public GeoCode getCityGeoCode() { 237 return getCityGeoCode(EntityPermission.READ_ONLY); 238 } 239 240 public GeoCode getCityGeoCodeForUpdate() { 241 return getCityGeoCode(EntityPermission.READ_WRITE); 242 } 243 244 public void setCityGeoCodePK(GeoCodePK cityGeoCodePK) 245 throws PersistenceNotNullException, PersistenceReadOnlyException { 246 checkReadWrite(); 247 _value.setCityGeoCodePK(cityGeoCodePK); 248 } 249 250 public void setCityGeoCode(GeoCode entity) { 251 setCityGeoCodePK(entity == null? null: entity.getPrimaryKey()); 252 } 253 254 public boolean getCityGeoCodePKHasBeenModified() { 255 return _value.getCityGeoCodePKHasBeenModified(); 256 } 257 258 public GeoCodePK getCountyGeoCodePK() { 259 return _value.getCountyGeoCodePK(); 260 } 261 262 public GeoCode getCountyGeoCode(EntityPermission entityPermission) { 263 GeoCodePK pk = getCountyGeoCodePK(); 264 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 265 266 return entity; 267 } 268 269 public GeoCode getCountyGeoCode() { 270 return getCountyGeoCode(EntityPermission.READ_ONLY); 271 } 272 273 public GeoCode getCountyGeoCodeForUpdate() { 274 return getCountyGeoCode(EntityPermission.READ_WRITE); 275 } 276 277 public void setCountyGeoCodePK(GeoCodePK countyGeoCodePK) 278 throws PersistenceNotNullException, PersistenceReadOnlyException { 279 checkReadWrite(); 280 _value.setCountyGeoCodePK(countyGeoCodePK); 281 } 282 283 public void setCountyGeoCode(GeoCode entity) { 284 setCountyGeoCodePK(entity == null? null: entity.getPrimaryKey()); 285 } 286 287 public boolean getCountyGeoCodePKHasBeenModified() { 288 return _value.getCountyGeoCodePKHasBeenModified(); 289 } 290 291 public String getState() { 292 return _value.getState(); 293 } 294 295 public void setState(String state) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setState(state); 299 } 300 301 public boolean getStateHasBeenModified() { 302 return _value.getStateHasBeenModified(); 303 } 304 305 public GeoCodePK getStateGeoCodePK() { 306 return _value.getStateGeoCodePK(); 307 } 308 309 public GeoCode getStateGeoCode(EntityPermission entityPermission) { 310 GeoCodePK pk = getStateGeoCodePK(); 311 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 312 313 return entity; 314 } 315 316 public GeoCode getStateGeoCode() { 317 return getStateGeoCode(EntityPermission.READ_ONLY); 318 } 319 320 public GeoCode getStateGeoCodeForUpdate() { 321 return getStateGeoCode(EntityPermission.READ_WRITE); 322 } 323 324 public void setStateGeoCodePK(GeoCodePK stateGeoCodePK) 325 throws PersistenceNotNullException, PersistenceReadOnlyException { 326 checkReadWrite(); 327 _value.setStateGeoCodePK(stateGeoCodePK); 328 } 329 330 public void setStateGeoCode(GeoCode entity) { 331 setStateGeoCodePK(entity == null? null: entity.getPrimaryKey()); 332 } 333 334 public boolean getStateGeoCodePKHasBeenModified() { 335 return _value.getStateGeoCodePKHasBeenModified(); 336 } 337 338 public String getPostalCode() { 339 return _value.getPostalCode(); 340 } 341 342 public void setPostalCode(String postalCode) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setPostalCode(postalCode); 346 } 347 348 public boolean getPostalCodeHasBeenModified() { 349 return _value.getPostalCodeHasBeenModified(); 350 } 351 352 public GeoCodePK getPostalCodeGeoCodePK() { 353 return _value.getPostalCodeGeoCodePK(); 354 } 355 356 public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) { 357 GeoCodePK pk = getPostalCodeGeoCodePK(); 358 GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, pk); 359 360 return entity; 361 } 362 363 public GeoCode getPostalCodeGeoCode() { 364 return getPostalCodeGeoCode(EntityPermission.READ_ONLY); 365 } 366 367 public GeoCode getPostalCodeGeoCodeForUpdate() { 368 return getPostalCodeGeoCode(EntityPermission.READ_WRITE); 369 } 370 371 public void setPostalCodeGeoCodePK(GeoCodePK postalCodeGeoCodePK) 372 throws PersistenceNotNullException, PersistenceReadOnlyException { 373 checkReadWrite(); 374 _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK); 375 } 376 377 public void setPostalCodeGeoCode(GeoCode entity) { 378 setPostalCodeGeoCodePK(entity == null? null: entity.getPrimaryKey()); 379 } 380 381 public boolean getPostalCodeGeoCodePKHasBeenModified() { 382 return _value.getPostalCodeGeoCodePKHasBeenModified(); 383 } 384 385 public GeoCodePK getCountryGeoCodePK() { 386 return _value.getCountryGeoCodePK(); 387 } 388 389 public GeoCode getCountryGeoCode(EntityPermission entityPermission) { 390 return GeoCodeFactory.getInstance().getEntityFromPK(entityPermission, getCountryGeoCodePK()); 391 } 392 393 public GeoCode getCountryGeoCode() { 394 return getCountryGeoCode(EntityPermission.READ_ONLY); 395 } 396 397 public GeoCode getCountryGeoCodeForUpdate() { 398 return getCountryGeoCode(EntityPermission.READ_WRITE); 399 } 400 401 public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK) 402 throws PersistenceNotNullException, PersistenceReadOnlyException { 403 checkReadWrite(); 404 _value.setCountryGeoCodePK(countryGeoCodePK); 405 } 406 407 public void setCountryGeoCode(GeoCode entity) { 408 setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey()); 409 } 410 411 public boolean getCountryGeoCodePKHasBeenModified() { 412 return _value.getCountryGeoCodePKHasBeenModified(); 413 } 414 415 public Long getFromTime() { 416 return _value.getFromTime(); 417 } 418 419 public void setFromTime(Long fromTime) 420 throws PersistenceNotNullException, PersistenceReadOnlyException { 421 checkReadWrite(); 422 _value.setFromTime(fromTime); 423 } 424 425 public boolean getFromTimeHasBeenModified() { 426 return _value.getFromTimeHasBeenModified(); 427 } 428 429 public Long getThruTime() { 430 return _value.getThruTime(); 431 } 432 433 public void setThruTime(Long thruTime) 434 throws PersistenceNotNullException, PersistenceReadOnlyException { 435 checkReadWrite(); 436 _value.setThruTime(thruTime); 437 } 438 439 public boolean getThruTimeHasBeenModified() { 440 return _value.getThruTimeHasBeenModified(); 441 } 442 443}