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