001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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 * PaymentMethodCreditCard.java 021 */ 022 023package com.echothree.model.data.payment.server.entity; 024 025import com.echothree.model.data.payment.common.pk.PaymentMethodCreditCardPK; 026 027import com.echothree.model.data.payment.common.pk.PaymentMethodPK; 028 029import com.echothree.model.data.payment.server.entity.PaymentMethod; 030 031import com.echothree.model.data.payment.server.factory.PaymentMethodFactory; 032 033import com.echothree.model.data.payment.common.pk.PaymentMethodCreditCardPK; 034 035import com.echothree.model.data.payment.server.value.PaymentMethodCreditCardValue; 036 037import com.echothree.model.data.payment.server.factory.PaymentMethodCreditCardFactory; 038 039import com.echothree.util.common.exception.PersistenceException; 040import com.echothree.util.common.exception.PersistenceDatabaseException; 041import com.echothree.util.common.exception.PersistenceNotNullException; 042import com.echothree.util.common.exception.PersistenceReadOnlyException; 043 044import com.echothree.util.common.persistence.BasePK; 045 046import com.echothree.util.common.persistence.type.ByteArray; 047 048import com.echothree.util.server.persistence.BaseEntity; 049import com.echothree.util.server.persistence.EntityPermission; 050import com.echothree.util.server.persistence.Session; 051import com.echothree.util.server.persistence.ThreadSession; 052 053import java.io.Serializable; 054 055public class PaymentMethodCreditCard 056 extends BaseEntity 057 implements Serializable { 058 059 private PaymentMethodCreditCardPK _pk; 060 private PaymentMethodCreditCardValue _value; 061 062 /** Creates a new instance of PaymentMethodCreditCard */ 063 public PaymentMethodCreditCard() 064 throws PersistenceException { 065 super(); 066 } 067 068 /** Creates a new instance of PaymentMethodCreditCard */ 069 public PaymentMethodCreditCard(PaymentMethodCreditCardValue value, EntityPermission entityPermission) { 070 super(entityPermission); 071 072 _value = value; 073 _pk = value.getPrimaryKey(); 074 } 075 076 @Override 077 public PaymentMethodCreditCardFactory getBaseFactoryInstance() { 078 return PaymentMethodCreditCardFactory.getInstance(); 079 } 080 081 @Override 082 public boolean hasBeenModified() { 083 return _value.hasBeenModified(); 084 } 085 086 @Override 087 public int hashCode() { 088 return _pk.hashCode(); 089 } 090 091 @Override 092 public String toString() { 093 return _pk.toString(); 094 } 095 096 @Override 097 public boolean equals(Object other) { 098 if(this == other) 099 return true; 100 101 if(other instanceof PaymentMethodCreditCard that) { 102 PaymentMethodCreditCardValue thatValue = that.getPaymentMethodCreditCardValue(); 103 return _value.equals(thatValue); 104 } else { 105 return false; 106 } 107 } 108 109 @Override 110 public void store(Session session) 111 throws PersistenceDatabaseException { 112 getBaseFactoryInstance().store(session, this); 113 } 114 115 @Override 116 public void remove(Session session) 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().remove(session, this); 119 } 120 121 @Override 122 public void remove() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 125 } 126 127 public PaymentMethodCreditCardValue getPaymentMethodCreditCardValue() { 128 return _value; 129 } 130 131 public void setPaymentMethodCreditCardValue(PaymentMethodCreditCardValue value) 132 throws PersistenceReadOnlyException { 133 checkReadWrite(); 134 _value = value; 135 } 136 137 @Override 138 public PaymentMethodCreditCardPK getPrimaryKey() { 139 return _pk; 140 } 141 142 public PaymentMethodPK getPaymentMethodPK() { 143 return _value.getPaymentMethodPK(); 144 } 145 146 public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) { 147 return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK()); 148 } 149 150 public PaymentMethod getPaymentMethod(EntityPermission entityPermission) { 151 return getPaymentMethod(ThreadSession.currentSession(), entityPermission); 152 } 153 154 public PaymentMethod getPaymentMethod(Session session) { 155 return getPaymentMethod(session, EntityPermission.READ_ONLY); 156 } 157 158 public PaymentMethod getPaymentMethod() { 159 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 160 } 161 162 public PaymentMethod getPaymentMethodForUpdate(Session session) { 163 return getPaymentMethod(session, EntityPermission.READ_WRITE); 164 } 165 166 public PaymentMethod getPaymentMethodForUpdate() { 167 return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 168 } 169 170 public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK) 171 throws PersistenceNotNullException, PersistenceReadOnlyException { 172 checkReadWrite(); 173 _value.setPaymentMethodPK(paymentMethodPK); 174 } 175 176 public void setPaymentMethod(PaymentMethod entity) { 177 setPaymentMethodPK(entity == null? null: entity.getPrimaryKey()); 178 } 179 180 public boolean getPaymentMethodPKHasBeenModified() { 181 return _value.getPaymentMethodPKHasBeenModified(); 182 } 183 184 public Boolean getRequestNameOnCard() { 185 return _value.getRequestNameOnCard(); 186 } 187 188 public void setRequestNameOnCard(Boolean requestNameOnCard) 189 throws PersistenceNotNullException, PersistenceReadOnlyException { 190 checkReadWrite(); 191 _value.setRequestNameOnCard(requestNameOnCard); 192 } 193 194 public boolean getRequestNameOnCardHasBeenModified() { 195 return _value.getRequestNameOnCardHasBeenModified(); 196 } 197 198 public Boolean getRequireNameOnCard() { 199 return _value.getRequireNameOnCard(); 200 } 201 202 public void setRequireNameOnCard(Boolean requireNameOnCard) 203 throws PersistenceNotNullException, PersistenceReadOnlyException { 204 checkReadWrite(); 205 _value.setRequireNameOnCard(requireNameOnCard); 206 } 207 208 public boolean getRequireNameOnCardHasBeenModified() { 209 return _value.getRequireNameOnCardHasBeenModified(); 210 } 211 212 public Boolean getCheckCardNumber() { 213 return _value.getCheckCardNumber(); 214 } 215 216 public void setCheckCardNumber(Boolean checkCardNumber) 217 throws PersistenceNotNullException, PersistenceReadOnlyException { 218 checkReadWrite(); 219 _value.setCheckCardNumber(checkCardNumber); 220 } 221 222 public boolean getCheckCardNumberHasBeenModified() { 223 return _value.getCheckCardNumberHasBeenModified(); 224 } 225 226 public Boolean getRequestExpirationDate() { 227 return _value.getRequestExpirationDate(); 228 } 229 230 public void setRequestExpirationDate(Boolean requestExpirationDate) 231 throws PersistenceNotNullException, PersistenceReadOnlyException { 232 checkReadWrite(); 233 _value.setRequestExpirationDate(requestExpirationDate); 234 } 235 236 public boolean getRequestExpirationDateHasBeenModified() { 237 return _value.getRequestExpirationDateHasBeenModified(); 238 } 239 240 public Boolean getRequireExpirationDate() { 241 return _value.getRequireExpirationDate(); 242 } 243 244 public void setRequireExpirationDate(Boolean requireExpirationDate) 245 throws PersistenceNotNullException, PersistenceReadOnlyException { 246 checkReadWrite(); 247 _value.setRequireExpirationDate(requireExpirationDate); 248 } 249 250 public boolean getRequireExpirationDateHasBeenModified() { 251 return _value.getRequireExpirationDateHasBeenModified(); 252 } 253 254 public Boolean getCheckExpirationDate() { 255 return _value.getCheckExpirationDate(); 256 } 257 258 public void setCheckExpirationDate(Boolean checkExpirationDate) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setCheckExpirationDate(checkExpirationDate); 262 } 263 264 public boolean getCheckExpirationDateHasBeenModified() { 265 return _value.getCheckExpirationDateHasBeenModified(); 266 } 267 268 public Boolean getRequestSecurityCode() { 269 return _value.getRequestSecurityCode(); 270 } 271 272 public void setRequestSecurityCode(Boolean requestSecurityCode) 273 throws PersistenceNotNullException, PersistenceReadOnlyException { 274 checkReadWrite(); 275 _value.setRequestSecurityCode(requestSecurityCode); 276 } 277 278 public boolean getRequestSecurityCodeHasBeenModified() { 279 return _value.getRequestSecurityCodeHasBeenModified(); 280 } 281 282 public Boolean getRequireSecurityCode() { 283 return _value.getRequireSecurityCode(); 284 } 285 286 public void setRequireSecurityCode(Boolean requireSecurityCode) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setRequireSecurityCode(requireSecurityCode); 290 } 291 292 public boolean getRequireSecurityCodeHasBeenModified() { 293 return _value.getRequireSecurityCodeHasBeenModified(); 294 } 295 296 public String getCardNumberValidationPattern() { 297 return _value.getCardNumberValidationPattern(); 298 } 299 300 public void setCardNumberValidationPattern(String cardNumberValidationPattern) 301 throws PersistenceNotNullException, PersistenceReadOnlyException { 302 checkReadWrite(); 303 _value.setCardNumberValidationPattern(cardNumberValidationPattern); 304 } 305 306 public boolean getCardNumberValidationPatternHasBeenModified() { 307 return _value.getCardNumberValidationPatternHasBeenModified(); 308 } 309 310 public String getSecurityCodeValidationPattern() { 311 return _value.getSecurityCodeValidationPattern(); 312 } 313 314 public void setSecurityCodeValidationPattern(String securityCodeValidationPattern) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setSecurityCodeValidationPattern(securityCodeValidationPattern); 318 } 319 320 public boolean getSecurityCodeValidationPatternHasBeenModified() { 321 return _value.getSecurityCodeValidationPatternHasBeenModified(); 322 } 323 324 public Boolean getRetainCreditCard() { 325 return _value.getRetainCreditCard(); 326 } 327 328 public void setRetainCreditCard(Boolean retainCreditCard) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setRetainCreditCard(retainCreditCard); 332 } 333 334 public boolean getRetainCreditCardHasBeenModified() { 335 return _value.getRetainCreditCardHasBeenModified(); 336 } 337 338 public Boolean getRetainSecurityCode() { 339 return _value.getRetainSecurityCode(); 340 } 341 342 public void setRetainSecurityCode(Boolean retainSecurityCode) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setRetainSecurityCode(retainSecurityCode); 346 } 347 348 public boolean getRetainSecurityCodeHasBeenModified() { 349 return _value.getRetainSecurityCodeHasBeenModified(); 350 } 351 352 public Boolean getRequestBilling() { 353 return _value.getRequestBilling(); 354 } 355 356 public void setRequestBilling(Boolean requestBilling) 357 throws PersistenceNotNullException, PersistenceReadOnlyException { 358 checkReadWrite(); 359 _value.setRequestBilling(requestBilling); 360 } 361 362 public boolean getRequestBillingHasBeenModified() { 363 return _value.getRequestBillingHasBeenModified(); 364 } 365 366 public Boolean getRequireBilling() { 367 return _value.getRequireBilling(); 368 } 369 370 public void setRequireBilling(Boolean requireBilling) 371 throws PersistenceNotNullException, PersistenceReadOnlyException { 372 checkReadWrite(); 373 _value.setRequireBilling(requireBilling); 374 } 375 376 public boolean getRequireBillingHasBeenModified() { 377 return _value.getRequireBillingHasBeenModified(); 378 } 379 380 public Boolean getRequestIssuer() { 381 return _value.getRequestIssuer(); 382 } 383 384 public void setRequestIssuer(Boolean requestIssuer) 385 throws PersistenceNotNullException, PersistenceReadOnlyException { 386 checkReadWrite(); 387 _value.setRequestIssuer(requestIssuer); 388 } 389 390 public boolean getRequestIssuerHasBeenModified() { 391 return _value.getRequestIssuerHasBeenModified(); 392 } 393 394 public Boolean getRequireIssuer() { 395 return _value.getRequireIssuer(); 396 } 397 398 public void setRequireIssuer(Boolean requireIssuer) 399 throws PersistenceNotNullException, PersistenceReadOnlyException { 400 checkReadWrite(); 401 _value.setRequireIssuer(requireIssuer); 402 } 403 404 public boolean getRequireIssuerHasBeenModified() { 405 return _value.getRequireIssuerHasBeenModified(); 406 } 407 408 public Long getFromTime() { 409 return _value.getFromTime(); 410 } 411 412 public void setFromTime(Long fromTime) 413 throws PersistenceNotNullException, PersistenceReadOnlyException { 414 checkReadWrite(); 415 _value.setFromTime(fromTime); 416 } 417 418 public boolean getFromTimeHasBeenModified() { 419 return _value.getFromTimeHasBeenModified(); 420 } 421 422 public Long getThruTime() { 423 return _value.getThruTime(); 424 } 425 426 public void setThruTime(Long thruTime) 427 throws PersistenceNotNullException, PersistenceReadOnlyException { 428 checkReadWrite(); 429 _value.setThruTime(thruTime); 430 } 431 432 public boolean getThruTimeHasBeenModified() { 433 return _value.getThruTimeHasBeenModified(); 434 } 435 436}