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