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 * PartyPaymentMethodCreditCard.java 021 */ 022 023package com.echothree.model.data.payment.server.entity; 024 025import com.echothree.model.data.payment.common.pk.PartyPaymentMethodCreditCardPK; 026 027import com.echothree.model.data.payment.common.pk.PartyPaymentMethodPK; 028import com.echothree.model.data.party.common.pk.PersonalTitlePK; 029import com.echothree.model.data.party.common.pk.NameSuffixPK; 030import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK; 031 032import com.echothree.model.data.payment.server.entity.PartyPaymentMethod; 033import com.echothree.model.data.party.server.entity.PersonalTitle; 034import com.echothree.model.data.party.server.entity.NameSuffix; 035import com.echothree.model.data.contact.server.entity.PartyContactMechanism; 036 037import com.echothree.model.data.payment.server.factory.PartyPaymentMethodFactory; 038import com.echothree.model.data.party.server.factory.PersonalTitleFactory; 039import com.echothree.model.data.party.server.factory.NameSuffixFactory; 040import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory; 041 042import com.echothree.model.data.payment.common.pk.PartyPaymentMethodCreditCardPK; 043 044import com.echothree.model.data.payment.server.value.PartyPaymentMethodCreditCardValue; 045 046import com.echothree.model.data.payment.server.factory.PartyPaymentMethodCreditCardFactory; 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 064import javax.annotation.Nonnull; 065import javax.annotation.Nullable; 066 067public class PartyPaymentMethodCreditCard 068 extends BaseEntity 069 implements Serializable { 070 071 private PartyPaymentMethodCreditCardPK _pk; 072 private PartyPaymentMethodCreditCardValue _value; 073 074 /** Creates a new instance of PartyPaymentMethodCreditCard */ 075 public PartyPaymentMethodCreditCard() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of PartyPaymentMethodCreditCard */ 081 public PartyPaymentMethodCreditCard(PartyPaymentMethodCreditCardValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 @Nonnull 090 public PartyPaymentMethodCreditCardFactory getBaseFactoryInstance() { 091 return PartyPaymentMethodCreditCardFactory.getInstance(); 092 } 093 094 @Override 095 public boolean hasBeenModified() { 096 return _value.hasBeenModified(); 097 } 098 099 @Override 100 public int hashCode() { 101 return _pk.hashCode(); 102 } 103 104 @Override 105 @Nonnull 106 public String toString() { 107 return _pk.toString(); 108 } 109 110 @Override 111 public boolean equals(Object other) { 112 if(this == other) 113 return true; 114 115 if(other instanceof PartyPaymentMethodCreditCard that) { 116 PartyPaymentMethodCreditCardValue thatValue = that.getPartyPaymentMethodCreditCardValue(); 117 return _value.equals(thatValue); 118 } else { 119 return false; 120 } 121 } 122 123 @Override 124 public void store() 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().store(this); 127 } 128 129 @Override 130 public void remove() 131 throws PersistenceDatabaseException { 132 getBaseFactoryInstance().remove(this); 133 } 134 135 @Nonnull 136 public PartyPaymentMethodCreditCardValue getPartyPaymentMethodCreditCardValue() { 137 return _value; 138 } 139 140 public void setPartyPaymentMethodCreditCardValue(@Nonnull PartyPaymentMethodCreditCardValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 @Nonnull 148 public PartyPaymentMethodCreditCardPK getPrimaryKey() { 149 return _pk; 150 } 151 152 @Nonnull 153 public PartyPaymentMethodPK getPartyPaymentMethodPK() { 154 return _value.getPartyPaymentMethodPK(); 155 } 156 157 @Nonnull 158 public PartyPaymentMethod getPartyPaymentMethod(EntityPermission entityPermission) { 159 return PartyPaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, getPartyPaymentMethodPK()); 160 } 161 162 @Nonnull 163 public PartyPaymentMethod getPartyPaymentMethod() { 164 return getPartyPaymentMethod(EntityPermission.READ_ONLY); 165 } 166 167 @Nonnull 168 public PartyPaymentMethod getPartyPaymentMethodForUpdate() { 169 return getPartyPaymentMethod(EntityPermission.READ_WRITE); 170 } 171 172 public void setPartyPaymentMethodPK(@Nonnull PartyPaymentMethodPK partyPaymentMethodPK) 173 throws PersistenceNotNullException, PersistenceReadOnlyException { 174 checkReadWrite(); 175 _value.setPartyPaymentMethodPK(partyPaymentMethodPK); 176 } 177 178 public void setPartyPaymentMethod(@Nonnull PartyPaymentMethod entity) { 179 setPartyPaymentMethodPK(entity == null ? null : entity.getPrimaryKey()); 180 } 181 182 public boolean getPartyPaymentMethodPKHasBeenModified() { 183 return _value.getPartyPaymentMethodPKHasBeenModified(); 184 } 185 186 @Nullable 187 public String getNumber() { 188 return _value.getNumber(); 189 } 190 191 public void setNumber(@Nullable String number) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setNumber(number); 195 } 196 197 public boolean getNumberHasBeenModified() { 198 return _value.getNumberHasBeenModified(); 199 } 200 201 @Nullable 202 public Integer getExpirationMonth() { 203 return _value.getExpirationMonth(); 204 } 205 206 public void setExpirationMonth(@Nullable Integer expirationMonth) 207 throws PersistenceNotNullException, PersistenceReadOnlyException { 208 checkReadWrite(); 209 _value.setExpirationMonth(expirationMonth); 210 } 211 212 public boolean getExpirationMonthHasBeenModified() { 213 return _value.getExpirationMonthHasBeenModified(); 214 } 215 216 @Nullable 217 public Integer getExpirationYear() { 218 return _value.getExpirationYear(); 219 } 220 221 public void setExpirationYear(@Nullable Integer expirationYear) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setExpirationYear(expirationYear); 225 } 226 227 public boolean getExpirationYearHasBeenModified() { 228 return _value.getExpirationYearHasBeenModified(); 229 } 230 231 @Nullable 232 public PersonalTitlePK getPersonalTitlePK() { 233 return _value.getPersonalTitlePK(); 234 } 235 236 @Nullable 237 public PersonalTitle getPersonalTitle(EntityPermission entityPermission) { 238 PersonalTitlePK pk = getPersonalTitlePK(); 239 PersonalTitle entity = pk == null? null: PersonalTitleFactory.getInstance().getEntityFromPK(entityPermission, pk); 240 241 return entity; 242 } 243 244 @Nullable 245 public PersonalTitle getPersonalTitle() { 246 return getPersonalTitle(EntityPermission.READ_ONLY); 247 } 248 249 @Nullable 250 public PersonalTitle getPersonalTitleForUpdate() { 251 return getPersonalTitle(EntityPermission.READ_WRITE); 252 } 253 254 public void setPersonalTitlePK(@Nullable PersonalTitlePK personalTitlePK) 255 throws PersistenceNotNullException, PersistenceReadOnlyException { 256 checkReadWrite(); 257 _value.setPersonalTitlePK(personalTitlePK); 258 } 259 260 public void setPersonalTitle(@Nullable PersonalTitle entity) { 261 setPersonalTitlePK(entity == null ? null : entity.getPrimaryKey()); 262 } 263 264 public boolean getPersonalTitlePKHasBeenModified() { 265 return _value.getPersonalTitlePKHasBeenModified(); 266 } 267 268 @Nullable 269 public String getFirstName() { 270 return _value.getFirstName(); 271 } 272 273 public void setFirstName(@Nullable String firstName) 274 throws PersistenceNotNullException, PersistenceReadOnlyException { 275 checkReadWrite(); 276 _value.setFirstName(firstName); 277 } 278 279 public boolean getFirstNameHasBeenModified() { 280 return _value.getFirstNameHasBeenModified(); 281 } 282 283 @Nullable 284 public String getFirstNameSdx() { 285 return _value.getFirstNameSdx(); 286 } 287 288 public void setFirstNameSdx(@Nullable String firstNameSdx) 289 throws PersistenceNotNullException, PersistenceReadOnlyException { 290 checkReadWrite(); 291 _value.setFirstNameSdx(firstNameSdx); 292 } 293 294 public boolean getFirstNameSdxHasBeenModified() { 295 return _value.getFirstNameSdxHasBeenModified(); 296 } 297 298 @Nullable 299 public String getMiddleName() { 300 return _value.getMiddleName(); 301 } 302 303 public void setMiddleName(@Nullable String middleName) 304 throws PersistenceNotNullException, PersistenceReadOnlyException { 305 checkReadWrite(); 306 _value.setMiddleName(middleName); 307 } 308 309 public boolean getMiddleNameHasBeenModified() { 310 return _value.getMiddleNameHasBeenModified(); 311 } 312 313 @Nullable 314 public String getMiddleNameSdx() { 315 return _value.getMiddleNameSdx(); 316 } 317 318 public void setMiddleNameSdx(@Nullable String middleNameSdx) 319 throws PersistenceNotNullException, PersistenceReadOnlyException { 320 checkReadWrite(); 321 _value.setMiddleNameSdx(middleNameSdx); 322 } 323 324 public boolean getMiddleNameSdxHasBeenModified() { 325 return _value.getMiddleNameSdxHasBeenModified(); 326 } 327 328 @Nullable 329 public String getLastName() { 330 return _value.getLastName(); 331 } 332 333 public void setLastName(@Nullable String lastName) 334 throws PersistenceNotNullException, PersistenceReadOnlyException { 335 checkReadWrite(); 336 _value.setLastName(lastName); 337 } 338 339 public boolean getLastNameHasBeenModified() { 340 return _value.getLastNameHasBeenModified(); 341 } 342 343 @Nullable 344 public String getLastNameSdx() { 345 return _value.getLastNameSdx(); 346 } 347 348 public void setLastNameSdx(@Nullable String lastNameSdx) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setLastNameSdx(lastNameSdx); 352 } 353 354 public boolean getLastNameSdxHasBeenModified() { 355 return _value.getLastNameSdxHasBeenModified(); 356 } 357 358 @Nullable 359 public NameSuffixPK getNameSuffixPK() { 360 return _value.getNameSuffixPK(); 361 } 362 363 @Nullable 364 public NameSuffix getNameSuffix(EntityPermission entityPermission) { 365 NameSuffixPK pk = getNameSuffixPK(); 366 NameSuffix entity = pk == null? null: NameSuffixFactory.getInstance().getEntityFromPK(entityPermission, pk); 367 368 return entity; 369 } 370 371 @Nullable 372 public NameSuffix getNameSuffix() { 373 return getNameSuffix(EntityPermission.READ_ONLY); 374 } 375 376 @Nullable 377 public NameSuffix getNameSuffixForUpdate() { 378 return getNameSuffix(EntityPermission.READ_WRITE); 379 } 380 381 public void setNameSuffixPK(@Nullable NameSuffixPK nameSuffixPK) 382 throws PersistenceNotNullException, PersistenceReadOnlyException { 383 checkReadWrite(); 384 _value.setNameSuffixPK(nameSuffixPK); 385 } 386 387 public void setNameSuffix(@Nullable NameSuffix entity) { 388 setNameSuffixPK(entity == null ? null : entity.getPrimaryKey()); 389 } 390 391 public boolean getNameSuffixPKHasBeenModified() { 392 return _value.getNameSuffixPKHasBeenModified(); 393 } 394 395 @Nullable 396 public String getName() { 397 return _value.getName(); 398 } 399 400 public void setName(@Nullable String name) 401 throws PersistenceNotNullException, PersistenceReadOnlyException { 402 checkReadWrite(); 403 _value.setName(name); 404 } 405 406 public boolean getNameHasBeenModified() { 407 return _value.getNameHasBeenModified(); 408 } 409 410 @Nullable 411 public PartyContactMechanismPK getBillingPartyContactMechanismPK() { 412 return _value.getBillingPartyContactMechanismPK(); 413 } 414 415 @Nullable 416 public PartyContactMechanism getBillingPartyContactMechanism(EntityPermission entityPermission) { 417 PartyContactMechanismPK pk = getBillingPartyContactMechanismPK(); 418 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk); 419 420 return entity; 421 } 422 423 @Nullable 424 public PartyContactMechanism getBillingPartyContactMechanism() { 425 return getBillingPartyContactMechanism(EntityPermission.READ_ONLY); 426 } 427 428 @Nullable 429 public PartyContactMechanism getBillingPartyContactMechanismForUpdate() { 430 return getBillingPartyContactMechanism(EntityPermission.READ_WRITE); 431 } 432 433 public void setBillingPartyContactMechanismPK(@Nullable PartyContactMechanismPK billingPartyContactMechanismPK) 434 throws PersistenceNotNullException, PersistenceReadOnlyException { 435 checkReadWrite(); 436 _value.setBillingPartyContactMechanismPK(billingPartyContactMechanismPK); 437 } 438 439 public void setBillingPartyContactMechanism(@Nullable PartyContactMechanism entity) { 440 setBillingPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey()); 441 } 442 443 public boolean getBillingPartyContactMechanismPKHasBeenModified() { 444 return _value.getBillingPartyContactMechanismPKHasBeenModified(); 445 } 446 447 @Nullable 448 public String getIssuerName() { 449 return _value.getIssuerName(); 450 } 451 452 public void setIssuerName(@Nullable String issuerName) 453 throws PersistenceNotNullException, PersistenceReadOnlyException { 454 checkReadWrite(); 455 _value.setIssuerName(issuerName); 456 } 457 458 public boolean getIssuerNameHasBeenModified() { 459 return _value.getIssuerNameHasBeenModified(); 460 } 461 462 @Nullable 463 public PartyContactMechanismPK getIssuerPartyContactMechanismPK() { 464 return _value.getIssuerPartyContactMechanismPK(); 465 } 466 467 @Nullable 468 public PartyContactMechanism getIssuerPartyContactMechanism(EntityPermission entityPermission) { 469 PartyContactMechanismPK pk = getIssuerPartyContactMechanismPK(); 470 PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk); 471 472 return entity; 473 } 474 475 @Nullable 476 public PartyContactMechanism getIssuerPartyContactMechanism() { 477 return getIssuerPartyContactMechanism(EntityPermission.READ_ONLY); 478 } 479 480 @Nullable 481 public PartyContactMechanism getIssuerPartyContactMechanismForUpdate() { 482 return getIssuerPartyContactMechanism(EntityPermission.READ_WRITE); 483 } 484 485 public void setIssuerPartyContactMechanismPK(@Nullable PartyContactMechanismPK issuerPartyContactMechanismPK) 486 throws PersistenceNotNullException, PersistenceReadOnlyException { 487 checkReadWrite(); 488 _value.setIssuerPartyContactMechanismPK(issuerPartyContactMechanismPK); 489 } 490 491 public void setIssuerPartyContactMechanism(@Nullable PartyContactMechanism entity) { 492 setIssuerPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey()); 493 } 494 495 public boolean getIssuerPartyContactMechanismPKHasBeenModified() { 496 return _value.getIssuerPartyContactMechanismPKHasBeenModified(); 497 } 498 499 @Nonnull 500 public Long getFromTime() { 501 return _value.getFromTime(); 502 } 503 504 public void setFromTime(@Nonnull Long fromTime) 505 throws PersistenceNotNullException, PersistenceReadOnlyException { 506 checkReadWrite(); 507 _value.setFromTime(fromTime); 508 } 509 510 public boolean getFromTimeHasBeenModified() { 511 return _value.getFromTimeHasBeenModified(); 512 } 513 514 @Nonnull 515 public Long getThruTime() { 516 return _value.getThruTime(); 517 } 518 519 public void setThruTime(@Nonnull Long thruTime) 520 throws PersistenceNotNullException, PersistenceReadOnlyException { 521 checkReadWrite(); 522 _value.setThruTime(thruTime); 523 } 524 525 public boolean getThruTimeHasBeenModified() { 526 return _value.getThruTimeHasBeenModified(); 527 } 528 529}