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 * 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) {
102            PaymentMethodCreditCard that = (PaymentMethodCreditCard)other;
103            
104            PaymentMethodCreditCardValue thatValue = that.getPaymentMethodCreditCardValue();
105            return _value.equals(thatValue);
106        } else {
107            return false;
108        }
109    }
110    
111    @Override
112    public void store(Session session)
113            throws PersistenceDatabaseException {
114        getBaseFactoryInstance().store(session, this);
115    }
116    
117    @Override
118    public void remove(Session session)
119            throws PersistenceDatabaseException {
120        getBaseFactoryInstance().remove(session, this);
121    }
122    
123    @Override
124    public void remove()
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
127    }
128    
129    public PaymentMethodCreditCardValue getPaymentMethodCreditCardValue() {
130        return _value;
131    }
132    
133    public void setPaymentMethodCreditCardValue(PaymentMethodCreditCardValue value)
134            throws PersistenceReadOnlyException {
135        checkReadWrite();
136        _value = value;
137    }
138    
139    @Override
140    public PaymentMethodCreditCardPK getPrimaryKey() {
141        return _pk;
142    }
143    
144    public PaymentMethodPK getPaymentMethodPK() {
145        return _value.getPaymentMethodPK();
146    }
147    
148    public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) {
149        return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK());
150    }
151    
152    public PaymentMethod getPaymentMethod(EntityPermission entityPermission) {
153        return getPaymentMethod(ThreadSession.currentSession(), entityPermission);
154    }
155    
156    public PaymentMethod getPaymentMethod(Session session) {
157        return getPaymentMethod(session, EntityPermission.READ_ONLY);
158    }
159    
160    public PaymentMethod getPaymentMethod() {
161        return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
162    }
163    
164    public PaymentMethod getPaymentMethodForUpdate(Session session) {
165        return getPaymentMethod(session, EntityPermission.READ_WRITE);
166    }
167    
168    public PaymentMethod getPaymentMethodForUpdate() {
169        return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
170    }
171    
172    public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setPaymentMethodPK(paymentMethodPK);
176    }
177    
178    public void setPaymentMethod(PaymentMethod entity) {
179        setPaymentMethodPK(entity == null? null: entity.getPrimaryKey());
180    }
181    
182    public boolean getPaymentMethodPKHasBeenModified() {
183        return _value.getPaymentMethodPKHasBeenModified();
184    }
185    
186    public Boolean getRequestNameOnCard() {
187        return _value.getRequestNameOnCard();
188    }
189    
190    public void setRequestNameOnCard(Boolean requestNameOnCard)
191            throws PersistenceNotNullException, PersistenceReadOnlyException {
192        checkReadWrite();
193        _value.setRequestNameOnCard(requestNameOnCard);
194    }
195    
196    public boolean getRequestNameOnCardHasBeenModified() {
197        return _value.getRequestNameOnCardHasBeenModified();
198    }
199    
200    public Boolean getRequireNameOnCard() {
201        return _value.getRequireNameOnCard();
202    }
203    
204    public void setRequireNameOnCard(Boolean requireNameOnCard)
205            throws PersistenceNotNullException, PersistenceReadOnlyException {
206        checkReadWrite();
207        _value.setRequireNameOnCard(requireNameOnCard);
208    }
209    
210    public boolean getRequireNameOnCardHasBeenModified() {
211        return _value.getRequireNameOnCardHasBeenModified();
212    }
213    
214    public Boolean getCheckCardNumber() {
215        return _value.getCheckCardNumber();
216    }
217    
218    public void setCheckCardNumber(Boolean checkCardNumber)
219            throws PersistenceNotNullException, PersistenceReadOnlyException {
220        checkReadWrite();
221        _value.setCheckCardNumber(checkCardNumber);
222    }
223    
224    public boolean getCheckCardNumberHasBeenModified() {
225        return _value.getCheckCardNumberHasBeenModified();
226    }
227    
228    public Boolean getRequestExpirationDate() {
229        return _value.getRequestExpirationDate();
230    }
231    
232    public void setRequestExpirationDate(Boolean requestExpirationDate)
233            throws PersistenceNotNullException, PersistenceReadOnlyException {
234        checkReadWrite();
235        _value.setRequestExpirationDate(requestExpirationDate);
236    }
237    
238    public boolean getRequestExpirationDateHasBeenModified() {
239        return _value.getRequestExpirationDateHasBeenModified();
240    }
241    
242    public Boolean getRequireExpirationDate() {
243        return _value.getRequireExpirationDate();
244    }
245    
246    public void setRequireExpirationDate(Boolean requireExpirationDate)
247            throws PersistenceNotNullException, PersistenceReadOnlyException {
248        checkReadWrite();
249        _value.setRequireExpirationDate(requireExpirationDate);
250    }
251    
252    public boolean getRequireExpirationDateHasBeenModified() {
253        return _value.getRequireExpirationDateHasBeenModified();
254    }
255    
256    public Boolean getCheckExpirationDate() {
257        return _value.getCheckExpirationDate();
258    }
259    
260    public void setCheckExpirationDate(Boolean checkExpirationDate)
261            throws PersistenceNotNullException, PersistenceReadOnlyException {
262        checkReadWrite();
263        _value.setCheckExpirationDate(checkExpirationDate);
264    }
265    
266    public boolean getCheckExpirationDateHasBeenModified() {
267        return _value.getCheckExpirationDateHasBeenModified();
268    }
269    
270    public Boolean getRequestSecurityCode() {
271        return _value.getRequestSecurityCode();
272    }
273    
274    public void setRequestSecurityCode(Boolean requestSecurityCode)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setRequestSecurityCode(requestSecurityCode);
278    }
279    
280    public boolean getRequestSecurityCodeHasBeenModified() {
281        return _value.getRequestSecurityCodeHasBeenModified();
282    }
283    
284    public Boolean getRequireSecurityCode() {
285        return _value.getRequireSecurityCode();
286    }
287    
288    public void setRequireSecurityCode(Boolean requireSecurityCode)
289            throws PersistenceNotNullException, PersistenceReadOnlyException {
290        checkReadWrite();
291        _value.setRequireSecurityCode(requireSecurityCode);
292    }
293    
294    public boolean getRequireSecurityCodeHasBeenModified() {
295        return _value.getRequireSecurityCodeHasBeenModified();
296    }
297    
298    public String getCardNumberValidationPattern() {
299        return _value.getCardNumberValidationPattern();
300    }
301    
302    public void setCardNumberValidationPattern(String cardNumberValidationPattern)
303            throws PersistenceNotNullException, PersistenceReadOnlyException {
304        checkReadWrite();
305        _value.setCardNumberValidationPattern(cardNumberValidationPattern);
306    }
307    
308    public boolean getCardNumberValidationPatternHasBeenModified() {
309        return _value.getCardNumberValidationPatternHasBeenModified();
310    }
311    
312    public String getSecurityCodeValidationPattern() {
313        return _value.getSecurityCodeValidationPattern();
314    }
315    
316    public void setSecurityCodeValidationPattern(String securityCodeValidationPattern)
317            throws PersistenceNotNullException, PersistenceReadOnlyException {
318        checkReadWrite();
319        _value.setSecurityCodeValidationPattern(securityCodeValidationPattern);
320    }
321    
322    public boolean getSecurityCodeValidationPatternHasBeenModified() {
323        return _value.getSecurityCodeValidationPatternHasBeenModified();
324    }
325    
326    public Boolean getRetainCreditCard() {
327        return _value.getRetainCreditCard();
328    }
329    
330    public void setRetainCreditCard(Boolean retainCreditCard)
331            throws PersistenceNotNullException, PersistenceReadOnlyException {
332        checkReadWrite();
333        _value.setRetainCreditCard(retainCreditCard);
334    }
335    
336    public boolean getRetainCreditCardHasBeenModified() {
337        return _value.getRetainCreditCardHasBeenModified();
338    }
339    
340    public Boolean getRetainSecurityCode() {
341        return _value.getRetainSecurityCode();
342    }
343    
344    public void setRetainSecurityCode(Boolean retainSecurityCode)
345            throws PersistenceNotNullException, PersistenceReadOnlyException {
346        checkReadWrite();
347        _value.setRetainSecurityCode(retainSecurityCode);
348    }
349    
350    public boolean getRetainSecurityCodeHasBeenModified() {
351        return _value.getRetainSecurityCodeHasBeenModified();
352    }
353    
354    public Boolean getRequestBilling() {
355        return _value.getRequestBilling();
356    }
357    
358    public void setRequestBilling(Boolean requestBilling)
359            throws PersistenceNotNullException, PersistenceReadOnlyException {
360        checkReadWrite();
361        _value.setRequestBilling(requestBilling);
362    }
363    
364    public boolean getRequestBillingHasBeenModified() {
365        return _value.getRequestBillingHasBeenModified();
366    }
367    
368    public Boolean getRequireBilling() {
369        return _value.getRequireBilling();
370    }
371    
372    public void setRequireBilling(Boolean requireBilling)
373            throws PersistenceNotNullException, PersistenceReadOnlyException {
374        checkReadWrite();
375        _value.setRequireBilling(requireBilling);
376    }
377    
378    public boolean getRequireBillingHasBeenModified() {
379        return _value.getRequireBillingHasBeenModified();
380    }
381    
382    public Boolean getRequestIssuer() {
383        return _value.getRequestIssuer();
384    }
385    
386    public void setRequestIssuer(Boolean requestIssuer)
387            throws PersistenceNotNullException, PersistenceReadOnlyException {
388        checkReadWrite();
389        _value.setRequestIssuer(requestIssuer);
390    }
391    
392    public boolean getRequestIssuerHasBeenModified() {
393        return _value.getRequestIssuerHasBeenModified();
394    }
395    
396    public Boolean getRequireIssuer() {
397        return _value.getRequireIssuer();
398    }
399    
400    public void setRequireIssuer(Boolean requireIssuer)
401            throws PersistenceNotNullException, PersistenceReadOnlyException {
402        checkReadWrite();
403        _value.setRequireIssuer(requireIssuer);
404    }
405    
406    public boolean getRequireIssuerHasBeenModified() {
407        return _value.getRequireIssuerHasBeenModified();
408    }
409    
410    public Long getFromTime() {
411        return _value.getFromTime();
412    }
413    
414    public void setFromTime(Long fromTime)
415            throws PersistenceNotNullException, PersistenceReadOnlyException {
416        checkReadWrite();
417        _value.setFromTime(fromTime);
418    }
419    
420    public boolean getFromTimeHasBeenModified() {
421        return _value.getFromTimeHasBeenModified();
422    }
423    
424    public Long getThruTime() {
425        return _value.getThruTime();
426    }
427    
428    public void setThruTime(Long thruTime)
429            throws PersistenceNotNullException, PersistenceReadOnlyException {
430        checkReadWrite();
431        _value.setThruTime(thruTime);
432    }
433    
434    public boolean getThruTimeHasBeenModified() {
435        return _value.getThruTimeHasBeenModified();
436    }
437    
438}