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 * OrderDetail.java
021 */
022
023package com.echothree.model.data.order.server.entity;
024
025import com.echothree.model.data.order.common.pk.OrderDetailPK;
026
027import com.echothree.model.data.order.common.pk.OrderPK;
028import com.echothree.model.data.order.common.pk.OrderTypePK;
029import com.echothree.model.data.order.common.pk.OrderPriorityPK;
030import com.echothree.model.data.accounting.common.pk.CurrencyPK;
031import com.echothree.model.data.term.common.pk.TermPK;
032import com.echothree.model.data.shipment.common.pk.FreeOnBoardPK;
033import com.echothree.model.data.cancellationpolicy.common.pk.CancellationPolicyPK;
034import com.echothree.model.data.returnpolicy.common.pk.ReturnPolicyPK;
035
036import com.echothree.model.data.order.server.entity.Order;
037import com.echothree.model.data.order.server.entity.OrderType;
038import com.echothree.model.data.order.server.entity.OrderPriority;
039import com.echothree.model.data.accounting.server.entity.Currency;
040import com.echothree.model.data.term.server.entity.Term;
041import com.echothree.model.data.shipment.server.entity.FreeOnBoard;
042import com.echothree.model.data.cancellationpolicy.server.entity.CancellationPolicy;
043import com.echothree.model.data.returnpolicy.server.entity.ReturnPolicy;
044
045import com.echothree.model.data.order.server.factory.OrderFactory;
046import com.echothree.model.data.order.server.factory.OrderTypeFactory;
047import com.echothree.model.data.order.server.factory.OrderPriorityFactory;
048import com.echothree.model.data.accounting.server.factory.CurrencyFactory;
049import com.echothree.model.data.term.server.factory.TermFactory;
050import com.echothree.model.data.shipment.server.factory.FreeOnBoardFactory;
051import com.echothree.model.data.cancellationpolicy.server.factory.CancellationPolicyFactory;
052import com.echothree.model.data.returnpolicy.server.factory.ReturnPolicyFactory;
053
054import com.echothree.model.data.order.common.pk.OrderDetailPK;
055
056import com.echothree.model.data.order.server.value.OrderDetailValue;
057
058import com.echothree.model.data.order.server.factory.OrderDetailFactory;
059
060import com.echothree.util.common.exception.PersistenceException;
061import com.echothree.util.common.exception.PersistenceDatabaseException;
062import com.echothree.util.common.exception.PersistenceNotNullException;
063import com.echothree.util.common.exception.PersistenceReadOnlyException;
064
065import com.echothree.util.common.persistence.BasePK;
066
067import com.echothree.util.common.persistence.type.ByteArray;
068
069import com.echothree.util.server.persistence.BaseEntity;
070import com.echothree.util.server.persistence.EntityPermission;
071import com.echothree.util.server.persistence.Session;
072import com.echothree.util.server.persistence.ThreadSession;
073
074import java.io.Serializable;
075
076public class OrderDetail
077        extends BaseEntity
078        implements Serializable {
079    
080    private OrderDetailPK _pk;
081    private OrderDetailValue _value;
082    
083    /** Creates a new instance of OrderDetail */
084    public OrderDetail()
085            throws PersistenceException {
086        super();
087    }
088    
089    /** Creates a new instance of OrderDetail */
090    public OrderDetail(OrderDetailValue value, EntityPermission entityPermission) {
091        super(entityPermission);
092        
093        _value = value;
094        _pk = value.getPrimaryKey();
095    }
096    
097    @Override
098    public OrderDetailFactory getBaseFactoryInstance() {
099        return OrderDetailFactory.getInstance();
100    }
101    
102    @Override
103    public boolean hasBeenModified() {
104        return _value.hasBeenModified();
105    }
106    
107    @Override
108    public int hashCode() {
109        return _pk.hashCode();
110    }
111    
112    @Override
113    public String toString() {
114        return _pk.toString();
115    }
116    
117    @Override
118    public boolean equals(Object other) {
119        if(this == other)
120            return true;
121        
122        if(other instanceof OrderDetail that) {
123            OrderDetailValue thatValue = that.getOrderDetailValue();
124            return _value.equals(thatValue);
125        } else {
126            return false;
127        }
128    }
129    
130    @Override
131    public void store()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().store(this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(this);
140    }
141    
142    public OrderDetailValue getOrderDetailValue() {
143        return _value;
144    }
145    
146    public void setOrderDetailValue(OrderDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public OrderDetailPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public OrderPK getOrderPK() {
158        return _value.getOrderPK();
159    }
160    
161    public Order getOrder(EntityPermission entityPermission) {
162        return OrderFactory.getInstance().getEntityFromPK(entityPermission, getOrderPK());
163    }
164    
165    public Order getOrder() {
166        return getOrder(EntityPermission.READ_ONLY);
167    }
168    
169    public Order getOrderForUpdate() {
170        return getOrder(EntityPermission.READ_WRITE);
171    }
172    
173    public void setOrderPK(OrderPK orderPK)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setOrderPK(orderPK);
177    }
178    
179    public void setOrder(Order entity) {
180        setOrderPK(entity == null? null: entity.getPrimaryKey());
181    }
182    
183    public boolean getOrderPKHasBeenModified() {
184        return _value.getOrderPKHasBeenModified();
185    }
186    
187    public OrderTypePK getOrderTypePK() {
188        return _value.getOrderTypePK();
189    }
190    
191    public OrderType getOrderType(EntityPermission entityPermission) {
192        return OrderTypeFactory.getInstance().getEntityFromPK(entityPermission, getOrderTypePK());
193    }
194    
195    public OrderType getOrderType() {
196        return getOrderType(EntityPermission.READ_ONLY);
197    }
198    
199    public OrderType getOrderTypeForUpdate() {
200        return getOrderType(EntityPermission.READ_WRITE);
201    }
202    
203    public void setOrderTypePK(OrderTypePK orderTypePK)
204            throws PersistenceNotNullException, PersistenceReadOnlyException {
205        checkReadWrite();
206        _value.setOrderTypePK(orderTypePK);
207    }
208    
209    public void setOrderType(OrderType entity) {
210        setOrderTypePK(entity == null? null: entity.getPrimaryKey());
211    }
212    
213    public boolean getOrderTypePKHasBeenModified() {
214        return _value.getOrderTypePKHasBeenModified();
215    }
216    
217    public String getOrderName() {
218        return _value.getOrderName();
219    }
220    
221    public void setOrderName(String orderName)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setOrderName(orderName);
225    }
226    
227    public boolean getOrderNameHasBeenModified() {
228        return _value.getOrderNameHasBeenModified();
229    }
230    
231    public OrderPriorityPK getOrderPriorityPK() {
232        return _value.getOrderPriorityPK();
233    }
234    
235    public OrderPriority getOrderPriority(EntityPermission entityPermission) {
236        OrderPriorityPK pk = getOrderPriorityPK();
237        OrderPriority entity = pk == null? null: OrderPriorityFactory.getInstance().getEntityFromPK(entityPermission, pk);
238        
239        return entity;
240    }
241    
242    public OrderPriority getOrderPriority() {
243        return getOrderPriority(EntityPermission.READ_ONLY);
244    }
245    
246    public OrderPriority getOrderPriorityForUpdate() {
247        return getOrderPriority(EntityPermission.READ_WRITE);
248    }
249    
250    public void setOrderPriorityPK(OrderPriorityPK orderPriorityPK)
251            throws PersistenceNotNullException, PersistenceReadOnlyException {
252        checkReadWrite();
253        _value.setOrderPriorityPK(orderPriorityPK);
254    }
255    
256    public void setOrderPriority(OrderPriority entity) {
257        setOrderPriorityPK(entity == null? null: entity.getPrimaryKey());
258    }
259    
260    public boolean getOrderPriorityPKHasBeenModified() {
261        return _value.getOrderPriorityPKHasBeenModified();
262    }
263    
264    public CurrencyPK getCurrencyPK() {
265        return _value.getCurrencyPK();
266    }
267    
268    public Currency getCurrency(EntityPermission entityPermission) {
269        return CurrencyFactory.getInstance().getEntityFromPK(entityPermission, getCurrencyPK());
270    }
271    
272    public Currency getCurrency() {
273        return getCurrency(EntityPermission.READ_ONLY);
274    }
275    
276    public Currency getCurrencyForUpdate() {
277        return getCurrency(EntityPermission.READ_WRITE);
278    }
279    
280    public void setCurrencyPK(CurrencyPK currencyPK)
281            throws PersistenceNotNullException, PersistenceReadOnlyException {
282        checkReadWrite();
283        _value.setCurrencyPK(currencyPK);
284    }
285    
286    public void setCurrency(Currency entity) {
287        setCurrencyPK(entity == null? null: entity.getPrimaryKey());
288    }
289    
290    public boolean getCurrencyPKHasBeenModified() {
291        return _value.getCurrencyPKHasBeenModified();
292    }
293    
294    public Boolean getHoldUntilComplete() {
295        return _value.getHoldUntilComplete();
296    }
297    
298    public void setHoldUntilComplete(Boolean holdUntilComplete)
299            throws PersistenceNotNullException, PersistenceReadOnlyException {
300        checkReadWrite();
301        _value.setHoldUntilComplete(holdUntilComplete);
302    }
303    
304    public boolean getHoldUntilCompleteHasBeenModified() {
305        return _value.getHoldUntilCompleteHasBeenModified();
306    }
307    
308    public Boolean getAllowBackorders() {
309        return _value.getAllowBackorders();
310    }
311    
312    public void setAllowBackorders(Boolean allowBackorders)
313            throws PersistenceNotNullException, PersistenceReadOnlyException {
314        checkReadWrite();
315        _value.setAllowBackorders(allowBackorders);
316    }
317    
318    public boolean getAllowBackordersHasBeenModified() {
319        return _value.getAllowBackordersHasBeenModified();
320    }
321    
322    public Boolean getAllowSubstitutions() {
323        return _value.getAllowSubstitutions();
324    }
325    
326    public void setAllowSubstitutions(Boolean allowSubstitutions)
327            throws PersistenceNotNullException, PersistenceReadOnlyException {
328        checkReadWrite();
329        _value.setAllowSubstitutions(allowSubstitutions);
330    }
331    
332    public boolean getAllowSubstitutionsHasBeenModified() {
333        return _value.getAllowSubstitutionsHasBeenModified();
334    }
335    
336    public Boolean getAllowCombiningShipments() {
337        return _value.getAllowCombiningShipments();
338    }
339    
340    public void setAllowCombiningShipments(Boolean allowCombiningShipments)
341            throws PersistenceNotNullException, PersistenceReadOnlyException {
342        checkReadWrite();
343        _value.setAllowCombiningShipments(allowCombiningShipments);
344    }
345    
346    public boolean getAllowCombiningShipmentsHasBeenModified() {
347        return _value.getAllowCombiningShipmentsHasBeenModified();
348    }
349    
350    public TermPK getTermPK() {
351        return _value.getTermPK();
352    }
353    
354    public Term getTerm(EntityPermission entityPermission) {
355        TermPK pk = getTermPK();
356        Term entity = pk == null? null: TermFactory.getInstance().getEntityFromPK(entityPermission, pk);
357        
358        return entity;
359    }
360    
361    public Term getTerm() {
362        return getTerm(EntityPermission.READ_ONLY);
363    }
364    
365    public Term getTermForUpdate() {
366        return getTerm(EntityPermission.READ_WRITE);
367    }
368    
369    public void setTermPK(TermPK termPK)
370            throws PersistenceNotNullException, PersistenceReadOnlyException {
371        checkReadWrite();
372        _value.setTermPK(termPK);
373    }
374    
375    public void setTerm(Term entity) {
376        setTermPK(entity == null? null: entity.getPrimaryKey());
377    }
378    
379    public boolean getTermPKHasBeenModified() {
380        return _value.getTermPKHasBeenModified();
381    }
382    
383    public FreeOnBoardPK getFreeOnBoardPK() {
384        return _value.getFreeOnBoardPK();
385    }
386    
387    public FreeOnBoard getFreeOnBoard(EntityPermission entityPermission) {
388        FreeOnBoardPK pk = getFreeOnBoardPK();
389        FreeOnBoard entity = pk == null? null: FreeOnBoardFactory.getInstance().getEntityFromPK(entityPermission, pk);
390        
391        return entity;
392    }
393    
394    public FreeOnBoard getFreeOnBoard() {
395        return getFreeOnBoard(EntityPermission.READ_ONLY);
396    }
397    
398    public FreeOnBoard getFreeOnBoardForUpdate() {
399        return getFreeOnBoard(EntityPermission.READ_WRITE);
400    }
401    
402    public void setFreeOnBoardPK(FreeOnBoardPK freeOnBoardPK)
403            throws PersistenceNotNullException, PersistenceReadOnlyException {
404        checkReadWrite();
405        _value.setFreeOnBoardPK(freeOnBoardPK);
406    }
407    
408    public void setFreeOnBoard(FreeOnBoard entity) {
409        setFreeOnBoardPK(entity == null? null: entity.getPrimaryKey());
410    }
411    
412    public boolean getFreeOnBoardPKHasBeenModified() {
413        return _value.getFreeOnBoardPKHasBeenModified();
414    }
415    
416    public String getReference() {
417        return _value.getReference();
418    }
419    
420    public void setReference(String reference)
421            throws PersistenceNotNullException, PersistenceReadOnlyException {
422        checkReadWrite();
423        _value.setReference(reference);
424    }
425    
426    public boolean getReferenceHasBeenModified() {
427        return _value.getReferenceHasBeenModified();
428    }
429    
430    public String getDescription() {
431        return _value.getDescription();
432    }
433    
434    public void setDescription(String description)
435            throws PersistenceNotNullException, PersistenceReadOnlyException {
436        checkReadWrite();
437        _value.setDescription(description);
438    }
439    
440    public boolean getDescriptionHasBeenModified() {
441        return _value.getDescriptionHasBeenModified();
442    }
443    
444    public CancellationPolicyPK getCancellationPolicyPK() {
445        return _value.getCancellationPolicyPK();
446    }
447    
448    public CancellationPolicy getCancellationPolicy(EntityPermission entityPermission) {
449        CancellationPolicyPK pk = getCancellationPolicyPK();
450        CancellationPolicy entity = pk == null? null: CancellationPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
451        
452        return entity;
453    }
454    
455    public CancellationPolicy getCancellationPolicy() {
456        return getCancellationPolicy(EntityPermission.READ_ONLY);
457    }
458    
459    public CancellationPolicy getCancellationPolicyForUpdate() {
460        return getCancellationPolicy(EntityPermission.READ_WRITE);
461    }
462    
463    public void setCancellationPolicyPK(CancellationPolicyPK cancellationPolicyPK)
464            throws PersistenceNotNullException, PersistenceReadOnlyException {
465        checkReadWrite();
466        _value.setCancellationPolicyPK(cancellationPolicyPK);
467    }
468    
469    public void setCancellationPolicy(CancellationPolicy entity) {
470        setCancellationPolicyPK(entity == null? null: entity.getPrimaryKey());
471    }
472    
473    public boolean getCancellationPolicyPKHasBeenModified() {
474        return _value.getCancellationPolicyPKHasBeenModified();
475    }
476    
477    public ReturnPolicyPK getReturnPolicyPK() {
478        return _value.getReturnPolicyPK();
479    }
480    
481    public ReturnPolicy getReturnPolicy(EntityPermission entityPermission) {
482        ReturnPolicyPK pk = getReturnPolicyPK();
483        ReturnPolicy entity = pk == null? null: ReturnPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
484        
485        return entity;
486    }
487    
488    public ReturnPolicy getReturnPolicy() {
489        return getReturnPolicy(EntityPermission.READ_ONLY);
490    }
491    
492    public ReturnPolicy getReturnPolicyForUpdate() {
493        return getReturnPolicy(EntityPermission.READ_WRITE);
494    }
495    
496    public void setReturnPolicyPK(ReturnPolicyPK returnPolicyPK)
497            throws PersistenceNotNullException, PersistenceReadOnlyException {
498        checkReadWrite();
499        _value.setReturnPolicyPK(returnPolicyPK);
500    }
501    
502    public void setReturnPolicy(ReturnPolicy entity) {
503        setReturnPolicyPK(entity == null? null: entity.getPrimaryKey());
504    }
505    
506    public boolean getReturnPolicyPKHasBeenModified() {
507        return _value.getReturnPolicyPKHasBeenModified();
508    }
509    
510    public Boolean getTaxable() {
511        return _value.getTaxable();
512    }
513    
514    public void setTaxable(Boolean taxable)
515            throws PersistenceNotNullException, PersistenceReadOnlyException {
516        checkReadWrite();
517        _value.setTaxable(taxable);
518    }
519    
520    public boolean getTaxableHasBeenModified() {
521        return _value.getTaxableHasBeenModified();
522    }
523    
524    public Long getFromTime() {
525        return _value.getFromTime();
526    }
527    
528    public void setFromTime(Long fromTime)
529            throws PersistenceNotNullException, PersistenceReadOnlyException {
530        checkReadWrite();
531        _value.setFromTime(fromTime);
532    }
533    
534    public boolean getFromTimeHasBeenModified() {
535        return _value.getFromTimeHasBeenModified();
536    }
537    
538    public Long getThruTime() {
539        return _value.getThruTime();
540    }
541    
542    public void setThruTime(Long thruTime)
543            throws PersistenceNotNullException, PersistenceReadOnlyException {
544        checkReadWrite();
545        _value.setThruTime(thruTime);
546    }
547    
548    public boolean getThruTimeHasBeenModified() {
549        return _value.getThruTimeHasBeenModified();
550    }
551    
552}