001// --------------------------------------------------------------------------------
002// Copyright 2002-2026 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 * OrderPaymentPreferenceDetail.java
021 */
022
023package com.echothree.model.data.order.server.entity;
024
025import com.echothree.model.data.order.common.pk.OrderPaymentPreferenceDetailPK;
026
027import com.echothree.model.data.order.common.pk.OrderPaymentPreferencePK;
028import com.echothree.model.data.order.common.pk.OrderPK;
029import com.echothree.model.data.payment.common.pk.PaymentMethodPK;
030import com.echothree.model.data.payment.common.pk.PartyPaymentMethodPK;
031
032import com.echothree.model.data.order.server.entity.OrderPaymentPreference;
033import com.echothree.model.data.order.server.entity.Order;
034import com.echothree.model.data.payment.server.entity.PaymentMethod;
035import com.echothree.model.data.payment.server.entity.PartyPaymentMethod;
036
037import com.echothree.model.data.order.server.factory.OrderPaymentPreferenceFactory;
038import com.echothree.model.data.order.server.factory.OrderFactory;
039import com.echothree.model.data.payment.server.factory.PaymentMethodFactory;
040import com.echothree.model.data.payment.server.factory.PartyPaymentMethodFactory;
041
042import com.echothree.model.data.order.common.pk.OrderPaymentPreferenceDetailPK;
043
044import com.echothree.model.data.order.server.value.OrderPaymentPreferenceDetailValue;
045
046import com.echothree.model.data.order.server.factory.OrderPaymentPreferenceDetailFactory;
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
064import javax.annotation.Nonnull;
065import javax.annotation.Nullable;
066
067public class OrderPaymentPreferenceDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private OrderPaymentPreferenceDetailPK _pk;
072    private OrderPaymentPreferenceDetailValue _value;
073    
074    /** Creates a new instance of OrderPaymentPreferenceDetail */
075    public OrderPaymentPreferenceDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of OrderPaymentPreferenceDetail */
081    public OrderPaymentPreferenceDetail(OrderPaymentPreferenceDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    @Nonnull
090    public OrderPaymentPreferenceDetailFactory getBaseFactoryInstance() {
091        return OrderPaymentPreferenceDetailFactory.getInstance();
092    }
093    
094    @Override
095    public boolean hasBeenModified() {
096        return _value.hasBeenModified();
097    }
098    
099    @Override
100    public int hashCode() {
101        return _pk.hashCode();
102    }
103    
104    @Override
105    @Nonnull
106    public String toString() {
107        return _pk.toString();
108    }
109    
110    @Override
111    public boolean equals(Object other) {
112        if(this == other)
113            return true;
114        
115        if(other instanceof OrderPaymentPreferenceDetail that) {
116            OrderPaymentPreferenceDetailValue thatValue = that.getOrderPaymentPreferenceDetailValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store()
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(this);
133    }
134    
135    @Nonnull
136    public OrderPaymentPreferenceDetailValue getOrderPaymentPreferenceDetailValue() {
137        return _value;
138    }
139    
140    public void setOrderPaymentPreferenceDetailValue(@Nonnull OrderPaymentPreferenceDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    @Nonnull
148    public OrderPaymentPreferenceDetailPK getPrimaryKey() {
149        return _pk;
150    }
151    
152    @Nonnull
153    public OrderPaymentPreferencePK getOrderPaymentPreferencePK() {
154        return _value.getOrderPaymentPreferencePK();
155    }
156    
157    @Nonnull
158    public OrderPaymentPreference getOrderPaymentPreference(EntityPermission entityPermission) {
159        return OrderPaymentPreferenceFactory.getInstance().getEntityFromPK(entityPermission, getOrderPaymentPreferencePK());
160    }
161    
162    @Nonnull
163    public OrderPaymentPreference getOrderPaymentPreference() {
164        return getOrderPaymentPreference(EntityPermission.READ_ONLY);
165    }
166    
167    @Nonnull
168    public OrderPaymentPreference getOrderPaymentPreferenceForUpdate() {
169        return getOrderPaymentPreference(EntityPermission.READ_WRITE);
170    }
171    
172    public void setOrderPaymentPreferencePK(@Nonnull OrderPaymentPreferencePK orderPaymentPreferencePK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setOrderPaymentPreferencePK(orderPaymentPreferencePK);
176    }
177    
178    public void setOrderPaymentPreference(@Nonnull OrderPaymentPreference entity) {
179        setOrderPaymentPreferencePK(entity == null ? null : entity.getPrimaryKey());
180    }
181    
182    public boolean getOrderPaymentPreferencePKHasBeenModified() {
183        return _value.getOrderPaymentPreferencePKHasBeenModified();
184    }
185    
186    @Nonnull
187    public OrderPK getOrderPK() {
188        return _value.getOrderPK();
189    }
190    
191    @Nonnull
192    public Order getOrder(EntityPermission entityPermission) {
193        return OrderFactory.getInstance().getEntityFromPK(entityPermission, getOrderPK());
194    }
195    
196    @Nonnull
197    public Order getOrder() {
198        return getOrder(EntityPermission.READ_ONLY);
199    }
200    
201    @Nonnull
202    public Order getOrderForUpdate() {
203        return getOrder(EntityPermission.READ_WRITE);
204    }
205    
206    public void setOrderPK(@Nonnull OrderPK orderPK)
207            throws PersistenceNotNullException, PersistenceReadOnlyException {
208        checkReadWrite();
209        _value.setOrderPK(orderPK);
210    }
211    
212    public void setOrder(@Nonnull Order entity) {
213        setOrderPK(entity == null ? null : entity.getPrimaryKey());
214    }
215    
216    public boolean getOrderPKHasBeenModified() {
217        return _value.getOrderPKHasBeenModified();
218    }
219    
220    @Nonnull
221    public Integer getOrderPaymentPreferenceSequence() {
222        return _value.getOrderPaymentPreferenceSequence();
223    }
224    
225    public void setOrderPaymentPreferenceSequence(@Nonnull Integer orderPaymentPreferenceSequence)
226            throws PersistenceNotNullException, PersistenceReadOnlyException {
227        checkReadWrite();
228        _value.setOrderPaymentPreferenceSequence(orderPaymentPreferenceSequence);
229    }
230    
231    public boolean getOrderPaymentPreferenceSequenceHasBeenModified() {
232        return _value.getOrderPaymentPreferenceSequenceHasBeenModified();
233    }
234    
235    @Nonnull
236    public PaymentMethodPK getPaymentMethodPK() {
237        return _value.getPaymentMethodPK();
238    }
239    
240    @Nonnull
241    public PaymentMethod getPaymentMethod(EntityPermission entityPermission) {
242        return PaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, getPaymentMethodPK());
243    }
244    
245    @Nonnull
246    public PaymentMethod getPaymentMethod() {
247        return getPaymentMethod(EntityPermission.READ_ONLY);
248    }
249    
250    @Nonnull
251    public PaymentMethod getPaymentMethodForUpdate() {
252        return getPaymentMethod(EntityPermission.READ_WRITE);
253    }
254    
255    public void setPaymentMethodPK(@Nonnull PaymentMethodPK paymentMethodPK)
256            throws PersistenceNotNullException, PersistenceReadOnlyException {
257        checkReadWrite();
258        _value.setPaymentMethodPK(paymentMethodPK);
259    }
260    
261    public void setPaymentMethod(@Nonnull PaymentMethod entity) {
262        setPaymentMethodPK(entity == null ? null : entity.getPrimaryKey());
263    }
264    
265    public boolean getPaymentMethodPKHasBeenModified() {
266        return _value.getPaymentMethodPKHasBeenModified();
267    }
268    
269    @Nullable
270    public PartyPaymentMethodPK getPartyPaymentMethodPK() {
271        return _value.getPartyPaymentMethodPK();
272    }
273    
274    @Nullable
275    public PartyPaymentMethod getPartyPaymentMethod(EntityPermission entityPermission) {
276        PartyPaymentMethodPK pk = getPartyPaymentMethodPK();
277        PartyPaymentMethod entity = pk == null? null: PartyPaymentMethodFactory.getInstance().getEntityFromPK(entityPermission, pk);
278        
279        return entity;
280    }
281    
282    @Nullable
283    public PartyPaymentMethod getPartyPaymentMethod() {
284        return getPartyPaymentMethod(EntityPermission.READ_ONLY);
285    }
286    
287    @Nullable
288    public PartyPaymentMethod getPartyPaymentMethodForUpdate() {
289        return getPartyPaymentMethod(EntityPermission.READ_WRITE);
290    }
291    
292    public void setPartyPaymentMethodPK(@Nullable PartyPaymentMethodPK partyPaymentMethodPK)
293            throws PersistenceNotNullException, PersistenceReadOnlyException {
294        checkReadWrite();
295        _value.setPartyPaymentMethodPK(partyPaymentMethodPK);
296    }
297    
298    public void setPartyPaymentMethod(@Nullable PartyPaymentMethod entity) {
299        setPartyPaymentMethodPK(entity == null ? null : entity.getPrimaryKey());
300    }
301    
302    public boolean getPartyPaymentMethodPKHasBeenModified() {
303        return _value.getPartyPaymentMethodPKHasBeenModified();
304    }
305    
306    @Nullable
307    public Boolean getWasPresent() {
308        return _value.getWasPresent();
309    }
310    
311    public void setWasPresent(@Nullable Boolean wasPresent)
312            throws PersistenceNotNullException, PersistenceReadOnlyException {
313        checkReadWrite();
314        _value.setWasPresent(wasPresent);
315    }
316    
317    public boolean getWasPresentHasBeenModified() {
318        return _value.getWasPresentHasBeenModified();
319    }
320    
321    @Nullable
322    public Long getMaximumAmount() {
323        return _value.getMaximumAmount();
324    }
325    
326    public void setMaximumAmount(@Nullable Long maximumAmount)
327            throws PersistenceNotNullException, PersistenceReadOnlyException {
328        checkReadWrite();
329        _value.setMaximumAmount(maximumAmount);
330    }
331    
332    public boolean getMaximumAmountHasBeenModified() {
333        return _value.getMaximumAmountHasBeenModified();
334    }
335    
336    @Nonnull
337    public Integer getSortOrder() {
338        return _value.getSortOrder();
339    }
340    
341    public void setSortOrder(@Nonnull Integer sortOrder)
342            throws PersistenceNotNullException, PersistenceReadOnlyException {
343        checkReadWrite();
344        _value.setSortOrder(sortOrder);
345    }
346    
347    public boolean getSortOrderHasBeenModified() {
348        return _value.getSortOrderHasBeenModified();
349    }
350    
351    @Nonnull
352    public Long getFromTime() {
353        return _value.getFromTime();
354    }
355    
356    public void setFromTime(@Nonnull Long fromTime)
357            throws PersistenceNotNullException, PersistenceReadOnlyException {
358        checkReadWrite();
359        _value.setFromTime(fromTime);
360    }
361    
362    public boolean getFromTimeHasBeenModified() {
363        return _value.getFromTimeHasBeenModified();
364    }
365    
366    @Nonnull
367    public Long getThruTime() {
368        return _value.getThruTime();
369    }
370    
371    public void setThruTime(@Nonnull Long thruTime)
372            throws PersistenceNotNullException, PersistenceReadOnlyException {
373        checkReadWrite();
374        _value.setThruTime(thruTime);
375    }
376    
377    public boolean getThruTimeHasBeenModified() {
378        return _value.getThruTimeHasBeenModified();
379    }
380    
381}