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 * PaymentMethodDetail.java
021 */
022
023package com.echothree.model.data.payment.server.entity;
024
025import com.echothree.model.data.payment.common.pk.PaymentMethodDetailPK;
026
027import com.echothree.model.data.payment.common.pk.PaymentMethodPK;
028import com.echothree.model.data.payment.common.pk.PaymentMethodTypePK;
029import com.echothree.model.data.payment.common.pk.PaymentProcessorPK;
030import com.echothree.model.data.selector.common.pk.SelectorPK;
031
032import com.echothree.model.data.payment.server.entity.PaymentMethod;
033import com.echothree.model.data.payment.server.entity.PaymentMethodType;
034import com.echothree.model.data.payment.server.entity.PaymentProcessor;
035import com.echothree.model.data.selector.server.entity.Selector;
036
037import com.echothree.model.data.payment.server.factory.PaymentMethodFactory;
038import com.echothree.model.data.payment.server.factory.PaymentMethodTypeFactory;
039import com.echothree.model.data.payment.server.factory.PaymentProcessorFactory;
040import com.echothree.model.data.selector.server.factory.SelectorFactory;
041
042import com.echothree.model.data.payment.common.pk.PaymentMethodDetailPK;
043
044import com.echothree.model.data.payment.server.value.PaymentMethodDetailValue;
045
046import com.echothree.model.data.payment.server.factory.PaymentMethodDetailFactory;
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 PaymentMethodDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private PaymentMethodDetailPK _pk;
069    private PaymentMethodDetailValue _value;
070    
071    /** Creates a new instance of PaymentMethodDetail */
072    public PaymentMethodDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of PaymentMethodDetail */
078    public PaymentMethodDetail(PaymentMethodDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public PaymentMethodDetailFactory getBaseFactoryInstance() {
087        return PaymentMethodDetailFactory.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 PaymentMethodDetail) {
111            PaymentMethodDetail that = (PaymentMethodDetail)other;
112            
113            PaymentMethodDetailValue thatValue = that.getPaymentMethodDetailValue();
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 PaymentMethodDetailValue getPaymentMethodDetailValue() {
139        return _value;
140    }
141    
142    public void setPaymentMethodDetailValue(PaymentMethodDetailValue value)
143            throws PersistenceReadOnlyException {
144        checkReadWrite();
145        _value = value;
146    }
147    
148    @Override
149    public PaymentMethodDetailPK getPrimaryKey() {
150        return _pk;
151    }
152    
153    public PaymentMethodPK getPaymentMethodPK() {
154        return _value.getPaymentMethodPK();
155    }
156    
157    public PaymentMethod getPaymentMethod(Session session, EntityPermission entityPermission) {
158        return PaymentMethodFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodPK());
159    }
160    
161    public PaymentMethod getPaymentMethod(EntityPermission entityPermission) {
162        return getPaymentMethod(ThreadSession.currentSession(), entityPermission);
163    }
164    
165    public PaymentMethod getPaymentMethod(Session session) {
166        return getPaymentMethod(session, EntityPermission.READ_ONLY);
167    }
168    
169    public PaymentMethod getPaymentMethod() {
170        return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
171    }
172    
173    public PaymentMethod getPaymentMethodForUpdate(Session session) {
174        return getPaymentMethod(session, EntityPermission.READ_WRITE);
175    }
176    
177    public PaymentMethod getPaymentMethodForUpdate() {
178        return getPaymentMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
179    }
180    
181    public void setPaymentMethodPK(PaymentMethodPK paymentMethodPK)
182            throws PersistenceNotNullException, PersistenceReadOnlyException {
183        checkReadWrite();
184        _value.setPaymentMethodPK(paymentMethodPK);
185    }
186    
187    public void setPaymentMethod(PaymentMethod entity) {
188        setPaymentMethodPK(entity == null? null: entity.getPrimaryKey());
189    }
190    
191    public boolean getPaymentMethodPKHasBeenModified() {
192        return _value.getPaymentMethodPKHasBeenModified();
193    }
194    
195    public String getPaymentMethodName() {
196        return _value.getPaymentMethodName();
197    }
198    
199    public void setPaymentMethodName(String paymentMethodName)
200            throws PersistenceNotNullException, PersistenceReadOnlyException {
201        checkReadWrite();
202        _value.setPaymentMethodName(paymentMethodName);
203    }
204    
205    public boolean getPaymentMethodNameHasBeenModified() {
206        return _value.getPaymentMethodNameHasBeenModified();
207    }
208    
209    public PaymentMethodTypePK getPaymentMethodTypePK() {
210        return _value.getPaymentMethodTypePK();
211    }
212    
213    public PaymentMethodType getPaymentMethodType(Session session, EntityPermission entityPermission) {
214        return PaymentMethodTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getPaymentMethodTypePK());
215    }
216    
217    public PaymentMethodType getPaymentMethodType(EntityPermission entityPermission) {
218        return getPaymentMethodType(ThreadSession.currentSession(), entityPermission);
219    }
220    
221    public PaymentMethodType getPaymentMethodType(Session session) {
222        return getPaymentMethodType(session, EntityPermission.READ_ONLY);
223    }
224    
225    public PaymentMethodType getPaymentMethodType() {
226        return getPaymentMethodType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
227    }
228    
229    public PaymentMethodType getPaymentMethodTypeForUpdate(Session session) {
230        return getPaymentMethodType(session, EntityPermission.READ_WRITE);
231    }
232    
233    public PaymentMethodType getPaymentMethodTypeForUpdate() {
234        return getPaymentMethodType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
235    }
236    
237    public void setPaymentMethodTypePK(PaymentMethodTypePK paymentMethodTypePK)
238            throws PersistenceNotNullException, PersistenceReadOnlyException {
239        checkReadWrite();
240        _value.setPaymentMethodTypePK(paymentMethodTypePK);
241    }
242    
243    public void setPaymentMethodType(PaymentMethodType entity) {
244        setPaymentMethodTypePK(entity == null? null: entity.getPrimaryKey());
245    }
246    
247    public boolean getPaymentMethodTypePKHasBeenModified() {
248        return _value.getPaymentMethodTypePKHasBeenModified();
249    }
250    
251    public PaymentProcessorPK getPaymentProcessorPK() {
252        return _value.getPaymentProcessorPK();
253    }
254    
255    public PaymentProcessor getPaymentProcessor(Session session, EntityPermission entityPermission) {
256        PaymentProcessorPK pk = getPaymentProcessorPK();
257        PaymentProcessor entity = pk == null? null: PaymentProcessorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
258        
259        return entity;
260    }
261    
262    public PaymentProcessor getPaymentProcessor(EntityPermission entityPermission) {
263        return getPaymentProcessor(ThreadSession.currentSession(), entityPermission);
264    }
265    
266    public PaymentProcessor getPaymentProcessor(Session session) {
267        return getPaymentProcessor(session, EntityPermission.READ_ONLY);
268    }
269    
270    public PaymentProcessor getPaymentProcessor() {
271        return getPaymentProcessor(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
272    }
273    
274    public PaymentProcessor getPaymentProcessorForUpdate(Session session) {
275        return getPaymentProcessor(session, EntityPermission.READ_WRITE);
276    }
277    
278    public PaymentProcessor getPaymentProcessorForUpdate() {
279        return getPaymentProcessor(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
280    }
281    
282    public void setPaymentProcessorPK(PaymentProcessorPK paymentProcessorPK)
283            throws PersistenceNotNullException, PersistenceReadOnlyException {
284        checkReadWrite();
285        _value.setPaymentProcessorPK(paymentProcessorPK);
286    }
287    
288    public void setPaymentProcessor(PaymentProcessor entity) {
289        setPaymentProcessorPK(entity == null? null: entity.getPrimaryKey());
290    }
291    
292    public boolean getPaymentProcessorPKHasBeenModified() {
293        return _value.getPaymentProcessorPKHasBeenModified();
294    }
295    
296    public SelectorPK getItemSelectorPK() {
297        return _value.getItemSelectorPK();
298    }
299    
300    public Selector getItemSelector(Session session, EntityPermission entityPermission) {
301        SelectorPK pk = getItemSelectorPK();
302        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
303        
304        return entity;
305    }
306    
307    public Selector getItemSelector(EntityPermission entityPermission) {
308        return getItemSelector(ThreadSession.currentSession(), entityPermission);
309    }
310    
311    public Selector getItemSelector(Session session) {
312        return getItemSelector(session, EntityPermission.READ_ONLY);
313    }
314    
315    public Selector getItemSelector() {
316        return getItemSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
317    }
318    
319    public Selector getItemSelectorForUpdate(Session session) {
320        return getItemSelector(session, EntityPermission.READ_WRITE);
321    }
322    
323    public Selector getItemSelectorForUpdate() {
324        return getItemSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
325    }
326    
327    public void setItemSelectorPK(SelectorPK itemSelectorPK)
328            throws PersistenceNotNullException, PersistenceReadOnlyException {
329        checkReadWrite();
330        _value.setItemSelectorPK(itemSelectorPK);
331    }
332    
333    public void setItemSelector(Selector entity) {
334        setItemSelectorPK(entity == null? null: entity.getPrimaryKey());
335    }
336    
337    public boolean getItemSelectorPKHasBeenModified() {
338        return _value.getItemSelectorPKHasBeenModified();
339    }
340    
341    public SelectorPK getSalesOrderItemSelectorPK() {
342        return _value.getSalesOrderItemSelectorPK();
343    }
344    
345    public Selector getSalesOrderItemSelector(Session session, EntityPermission entityPermission) {
346        SelectorPK pk = getSalesOrderItemSelectorPK();
347        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
348        
349        return entity;
350    }
351    
352    public Selector getSalesOrderItemSelector(EntityPermission entityPermission) {
353        return getSalesOrderItemSelector(ThreadSession.currentSession(), entityPermission);
354    }
355    
356    public Selector getSalesOrderItemSelector(Session session) {
357        return getSalesOrderItemSelector(session, EntityPermission.READ_ONLY);
358    }
359    
360    public Selector getSalesOrderItemSelector() {
361        return getSalesOrderItemSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
362    }
363    
364    public Selector getSalesOrderItemSelectorForUpdate(Session session) {
365        return getSalesOrderItemSelector(session, EntityPermission.READ_WRITE);
366    }
367    
368    public Selector getSalesOrderItemSelectorForUpdate() {
369        return getSalesOrderItemSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
370    }
371    
372    public void setSalesOrderItemSelectorPK(SelectorPK salesOrderItemSelectorPK)
373            throws PersistenceNotNullException, PersistenceReadOnlyException {
374        checkReadWrite();
375        _value.setSalesOrderItemSelectorPK(salesOrderItemSelectorPK);
376    }
377    
378    public void setSalesOrderItemSelector(Selector entity) {
379        setSalesOrderItemSelectorPK(entity == null? null: entity.getPrimaryKey());
380    }
381    
382    public boolean getSalesOrderItemSelectorPKHasBeenModified() {
383        return _value.getSalesOrderItemSelectorPKHasBeenModified();
384    }
385    
386    public Boolean getIsDefault() {
387        return _value.getIsDefault();
388    }
389    
390    public void setIsDefault(Boolean isDefault)
391            throws PersistenceNotNullException, PersistenceReadOnlyException {
392        checkReadWrite();
393        _value.setIsDefault(isDefault);
394    }
395    
396    public boolean getIsDefaultHasBeenModified() {
397        return _value.getIsDefaultHasBeenModified();
398    }
399    
400    public Integer getSortOrder() {
401        return _value.getSortOrder();
402    }
403    
404    public void setSortOrder(Integer sortOrder)
405            throws PersistenceNotNullException, PersistenceReadOnlyException {
406        checkReadWrite();
407        _value.setSortOrder(sortOrder);
408    }
409    
410    public boolean getSortOrderHasBeenModified() {
411        return _value.getSortOrderHasBeenModified();
412    }
413    
414    public Long getFromTime() {
415        return _value.getFromTime();
416    }
417    
418    public void setFromTime(Long fromTime)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setFromTime(fromTime);
422    }
423    
424    public boolean getFromTimeHasBeenModified() {
425        return _value.getFromTimeHasBeenModified();
426    }
427    
428    public Long getThruTime() {
429        return _value.getThruTime();
430    }
431    
432    public void setThruTime(Long thruTime)
433            throws PersistenceNotNullException, PersistenceReadOnlyException {
434        checkReadWrite();
435        _value.setThruTime(thruTime);
436    }
437    
438    public boolean getThruTimeHasBeenModified() {
439        return _value.getThruTimeHasBeenModified();
440    }
441    
442}