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 * OrderLineDetail.java
021 */
022
023package com.echothree.model.data.order.server.entity;
024
025import com.echothree.model.data.order.common.pk.OrderLineDetailPK;
026
027import com.echothree.model.data.order.common.pk.OrderLinePK;
028import com.echothree.model.data.order.common.pk.OrderPK;
029import com.echothree.model.data.order.common.pk.OrderShipmentGroupPK;
030import com.echothree.model.data.item.common.pk.ItemPK;
031import com.echothree.model.data.inventory.common.pk.InventoryConditionPK;
032import com.echothree.model.data.uom.common.pk.UnitOfMeasureTypePK;
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.OrderLine;
037import com.echothree.model.data.order.server.entity.Order;
038import com.echothree.model.data.order.server.entity.OrderShipmentGroup;
039import com.echothree.model.data.item.server.entity.Item;
040import com.echothree.model.data.inventory.server.entity.InventoryCondition;
041import com.echothree.model.data.uom.server.entity.UnitOfMeasureType;
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.OrderLineFactory;
046import com.echothree.model.data.order.server.factory.OrderFactory;
047import com.echothree.model.data.order.server.factory.OrderShipmentGroupFactory;
048import com.echothree.model.data.item.server.factory.ItemFactory;
049import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory;
050import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory;
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.OrderLineDetailPK;
055
056import com.echothree.model.data.order.server.value.OrderLineDetailValue;
057
058import com.echothree.model.data.order.server.factory.OrderLineDetailFactory;
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
076import javax.annotation.Nonnull;
077import javax.annotation.Nullable;
078
079public class OrderLineDetail
080        extends BaseEntity
081        implements Serializable {
082    
083    private OrderLineDetailPK _pk;
084    private OrderLineDetailValue _value;
085    
086    /** Creates a new instance of OrderLineDetail */
087    public OrderLineDetail()
088            throws PersistenceException {
089        super();
090    }
091    
092    /** Creates a new instance of OrderLineDetail */
093    public OrderLineDetail(OrderLineDetailValue value, EntityPermission entityPermission) {
094        super(entityPermission);
095        
096        _value = value;
097        _pk = value.getPrimaryKey();
098    }
099    
100    @Override
101    @Nonnull
102    public OrderLineDetailFactory getBaseFactoryInstance() {
103        return OrderLineDetailFactory.getInstance();
104    }
105    
106    @Override
107    public boolean hasBeenModified() {
108        return _value.hasBeenModified();
109    }
110    
111    @Override
112    public int hashCode() {
113        return _pk.hashCode();
114    }
115    
116    @Override
117    @Nonnull
118    public String toString() {
119        return _pk.toString();
120    }
121    
122    @Override
123    public boolean equals(Object other) {
124        if(this == other)
125            return true;
126        
127        if(other instanceof OrderLineDetail that) {
128            OrderLineDetailValue thatValue = that.getOrderLineDetailValue();
129            return _value.equals(thatValue);
130        } else {
131            return false;
132        }
133    }
134    
135    @Override
136    public void store()
137            throws PersistenceDatabaseException {
138        getBaseFactoryInstance().store(this);
139    }
140    
141    @Override
142    public void remove()
143            throws PersistenceDatabaseException {
144        getBaseFactoryInstance().remove(this);
145    }
146    
147    @Nonnull
148    public OrderLineDetailValue getOrderLineDetailValue() {
149        return _value;
150    }
151    
152    public void setOrderLineDetailValue(@Nonnull OrderLineDetailValue value)
153            throws PersistenceReadOnlyException {
154        checkReadWrite();
155        _value = value;
156    }
157    
158    @Override
159    @Nonnull
160    public OrderLineDetailPK getPrimaryKey() {
161        return _pk;
162    }
163    
164    @Nonnull
165    public OrderLinePK getOrderLinePK() {
166        return _value.getOrderLinePK();
167    }
168    
169    @Nonnull
170    public OrderLine getOrderLine(EntityPermission entityPermission) {
171        return OrderLineFactory.getInstance().getEntityFromPK(entityPermission, getOrderLinePK());
172    }
173    
174    @Nonnull
175    public OrderLine getOrderLine() {
176        return getOrderLine(EntityPermission.READ_ONLY);
177    }
178    
179    @Nonnull
180    public OrderLine getOrderLineForUpdate() {
181        return getOrderLine(EntityPermission.READ_WRITE);
182    }
183    
184    public void setOrderLinePK(@Nonnull OrderLinePK orderLinePK)
185            throws PersistenceNotNullException, PersistenceReadOnlyException {
186        checkReadWrite();
187        _value.setOrderLinePK(orderLinePK);
188    }
189    
190    public void setOrderLine(@Nonnull OrderLine entity) {
191        setOrderLinePK(entity == null ? null : entity.getPrimaryKey());
192    }
193    
194    public boolean getOrderLinePKHasBeenModified() {
195        return _value.getOrderLinePKHasBeenModified();
196    }
197    
198    @Nonnull
199    public OrderPK getOrderPK() {
200        return _value.getOrderPK();
201    }
202    
203    @Nonnull
204    public Order getOrder(EntityPermission entityPermission) {
205        return OrderFactory.getInstance().getEntityFromPK(entityPermission, getOrderPK());
206    }
207    
208    @Nonnull
209    public Order getOrder() {
210        return getOrder(EntityPermission.READ_ONLY);
211    }
212    
213    @Nonnull
214    public Order getOrderForUpdate() {
215        return getOrder(EntityPermission.READ_WRITE);
216    }
217    
218    public void setOrderPK(@Nonnull OrderPK orderPK)
219            throws PersistenceNotNullException, PersistenceReadOnlyException {
220        checkReadWrite();
221        _value.setOrderPK(orderPK);
222    }
223    
224    public void setOrder(@Nonnull Order entity) {
225        setOrderPK(entity == null ? null : entity.getPrimaryKey());
226    }
227    
228    public boolean getOrderPKHasBeenModified() {
229        return _value.getOrderPKHasBeenModified();
230    }
231    
232    @Nonnull
233    public Integer getOrderLineSequence() {
234        return _value.getOrderLineSequence();
235    }
236    
237    public void setOrderLineSequence(@Nonnull Integer orderLineSequence)
238            throws PersistenceNotNullException, PersistenceReadOnlyException {
239        checkReadWrite();
240        _value.setOrderLineSequence(orderLineSequence);
241    }
242    
243    public boolean getOrderLineSequenceHasBeenModified() {
244        return _value.getOrderLineSequenceHasBeenModified();
245    }
246    
247    @Nullable
248    public OrderLinePK getParentOrderLinePK() {
249        return _value.getParentOrderLinePK();
250    }
251    
252    @Nullable
253    public OrderLine getParentOrderLine(EntityPermission entityPermission) {
254        OrderLinePK pk = getParentOrderLinePK();
255        OrderLine entity = pk == null? null: OrderLineFactory.getInstance().getEntityFromPK(entityPermission, pk);
256        
257        return entity;
258    }
259    
260    @Nullable
261    public OrderLine getParentOrderLine() {
262        return getParentOrderLine(EntityPermission.READ_ONLY);
263    }
264    
265    @Nullable
266    public OrderLine getParentOrderLineForUpdate() {
267        return getParentOrderLine(EntityPermission.READ_WRITE);
268    }
269    
270    public void setParentOrderLinePK(@Nullable OrderLinePK parentOrderLinePK)
271            throws PersistenceNotNullException, PersistenceReadOnlyException {
272        checkReadWrite();
273        _value.setParentOrderLinePK(parentOrderLinePK);
274    }
275    
276    public void setParentOrderLine(@Nullable OrderLine entity) {
277        setParentOrderLinePK(entity == null ? null : entity.getPrimaryKey());
278    }
279    
280    public boolean getParentOrderLinePKHasBeenModified() {
281        return _value.getParentOrderLinePKHasBeenModified();
282    }
283    
284    @Nullable
285    public OrderShipmentGroupPK getOrderShipmentGroupPK() {
286        return _value.getOrderShipmentGroupPK();
287    }
288    
289    @Nullable
290    public OrderShipmentGroup getOrderShipmentGroup(EntityPermission entityPermission) {
291        OrderShipmentGroupPK pk = getOrderShipmentGroupPK();
292        OrderShipmentGroup entity = pk == null? null: OrderShipmentGroupFactory.getInstance().getEntityFromPK(entityPermission, pk);
293        
294        return entity;
295    }
296    
297    @Nullable
298    public OrderShipmentGroup getOrderShipmentGroup() {
299        return getOrderShipmentGroup(EntityPermission.READ_ONLY);
300    }
301    
302    @Nullable
303    public OrderShipmentGroup getOrderShipmentGroupForUpdate() {
304        return getOrderShipmentGroup(EntityPermission.READ_WRITE);
305    }
306    
307    public void setOrderShipmentGroupPK(@Nullable OrderShipmentGroupPK orderShipmentGroupPK)
308            throws PersistenceNotNullException, PersistenceReadOnlyException {
309        checkReadWrite();
310        _value.setOrderShipmentGroupPK(orderShipmentGroupPK);
311    }
312    
313    public void setOrderShipmentGroup(@Nullable OrderShipmentGroup entity) {
314        setOrderShipmentGroupPK(entity == null ? null : entity.getPrimaryKey());
315    }
316    
317    public boolean getOrderShipmentGroupPKHasBeenModified() {
318        return _value.getOrderShipmentGroupPKHasBeenModified();
319    }
320    
321    @Nonnull
322    public ItemPK getItemPK() {
323        return _value.getItemPK();
324    }
325    
326    @Nonnull
327    public Item getItem(EntityPermission entityPermission) {
328        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
329    }
330    
331    @Nonnull
332    public Item getItem() {
333        return getItem(EntityPermission.READ_ONLY);
334    }
335    
336    @Nonnull
337    public Item getItemForUpdate() {
338        return getItem(EntityPermission.READ_WRITE);
339    }
340    
341    public void setItemPK(@Nonnull ItemPK itemPK)
342            throws PersistenceNotNullException, PersistenceReadOnlyException {
343        checkReadWrite();
344        _value.setItemPK(itemPK);
345    }
346    
347    public void setItem(@Nonnull Item entity) {
348        setItemPK(entity == null ? null : entity.getPrimaryKey());
349    }
350    
351    public boolean getItemPKHasBeenModified() {
352        return _value.getItemPKHasBeenModified();
353    }
354    
355    @Nonnull
356    public InventoryConditionPK getInventoryConditionPK() {
357        return _value.getInventoryConditionPK();
358    }
359    
360    @Nonnull
361    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
362        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
363    }
364    
365    @Nonnull
366    public InventoryCondition getInventoryCondition() {
367        return getInventoryCondition(EntityPermission.READ_ONLY);
368    }
369    
370    @Nonnull
371    public InventoryCondition getInventoryConditionForUpdate() {
372        return getInventoryCondition(EntityPermission.READ_WRITE);
373    }
374    
375    public void setInventoryConditionPK(@Nonnull InventoryConditionPK inventoryConditionPK)
376            throws PersistenceNotNullException, PersistenceReadOnlyException {
377        checkReadWrite();
378        _value.setInventoryConditionPK(inventoryConditionPK);
379    }
380    
381    public void setInventoryCondition(@Nonnull InventoryCondition entity) {
382        setInventoryConditionPK(entity == null ? null : entity.getPrimaryKey());
383    }
384    
385    public boolean getInventoryConditionPKHasBeenModified() {
386        return _value.getInventoryConditionPKHasBeenModified();
387    }
388    
389    @Nonnull
390    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
391        return _value.getUnitOfMeasureTypePK();
392    }
393    
394    @Nonnull
395    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
396        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, getUnitOfMeasureTypePK());
397    }
398    
399    @Nonnull
400    public UnitOfMeasureType getUnitOfMeasureType() {
401        return getUnitOfMeasureType(EntityPermission.READ_ONLY);
402    }
403    
404    @Nonnull
405    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
406        return getUnitOfMeasureType(EntityPermission.READ_WRITE);
407    }
408    
409    public void setUnitOfMeasureTypePK(@Nonnull UnitOfMeasureTypePK unitOfMeasureTypePK)
410            throws PersistenceNotNullException, PersistenceReadOnlyException {
411        checkReadWrite();
412        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
413    }
414    
415    public void setUnitOfMeasureType(@Nonnull UnitOfMeasureType entity) {
416        setUnitOfMeasureTypePK(entity == null ? null : entity.getPrimaryKey());
417    }
418    
419    public boolean getUnitOfMeasureTypePKHasBeenModified() {
420        return _value.getUnitOfMeasureTypePKHasBeenModified();
421    }
422    
423    @Nullable
424    public Long getQuantity() {
425        return _value.getQuantity();
426    }
427    
428    public void setQuantity(@Nullable Long quantity)
429            throws PersistenceNotNullException, PersistenceReadOnlyException {
430        checkReadWrite();
431        _value.setQuantity(quantity);
432    }
433    
434    public boolean getQuantityHasBeenModified() {
435        return _value.getQuantityHasBeenModified();
436    }
437    
438    @Nullable
439    public Long getUnitAmount() {
440        return _value.getUnitAmount();
441    }
442    
443    public void setUnitAmount(@Nullable Long unitAmount)
444            throws PersistenceNotNullException, PersistenceReadOnlyException {
445        checkReadWrite();
446        _value.setUnitAmount(unitAmount);
447    }
448    
449    public boolean getUnitAmountHasBeenModified() {
450        return _value.getUnitAmountHasBeenModified();
451    }
452    
453    @Nullable
454    public String getDescription() {
455        return _value.getDescription();
456    }
457    
458    public void setDescription(@Nullable String description)
459            throws PersistenceNotNullException, PersistenceReadOnlyException {
460        checkReadWrite();
461        _value.setDescription(description);
462    }
463    
464    public boolean getDescriptionHasBeenModified() {
465        return _value.getDescriptionHasBeenModified();
466    }
467    
468    @Nullable
469    public CancellationPolicyPK getCancellationPolicyPK() {
470        return _value.getCancellationPolicyPK();
471    }
472    
473    @Nullable
474    public CancellationPolicy getCancellationPolicy(EntityPermission entityPermission) {
475        CancellationPolicyPK pk = getCancellationPolicyPK();
476        CancellationPolicy entity = pk == null? null: CancellationPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
477        
478        return entity;
479    }
480    
481    @Nullable
482    public CancellationPolicy getCancellationPolicy() {
483        return getCancellationPolicy(EntityPermission.READ_ONLY);
484    }
485    
486    @Nullable
487    public CancellationPolicy getCancellationPolicyForUpdate() {
488        return getCancellationPolicy(EntityPermission.READ_WRITE);
489    }
490    
491    public void setCancellationPolicyPK(@Nullable CancellationPolicyPK cancellationPolicyPK)
492            throws PersistenceNotNullException, PersistenceReadOnlyException {
493        checkReadWrite();
494        _value.setCancellationPolicyPK(cancellationPolicyPK);
495    }
496    
497    public void setCancellationPolicy(@Nullable CancellationPolicy entity) {
498        setCancellationPolicyPK(entity == null ? null : entity.getPrimaryKey());
499    }
500    
501    public boolean getCancellationPolicyPKHasBeenModified() {
502        return _value.getCancellationPolicyPKHasBeenModified();
503    }
504    
505    @Nullable
506    public ReturnPolicyPK getReturnPolicyPK() {
507        return _value.getReturnPolicyPK();
508    }
509    
510    @Nullable
511    public ReturnPolicy getReturnPolicy(EntityPermission entityPermission) {
512        ReturnPolicyPK pk = getReturnPolicyPK();
513        ReturnPolicy entity = pk == null? null: ReturnPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
514        
515        return entity;
516    }
517    
518    @Nullable
519    public ReturnPolicy getReturnPolicy() {
520        return getReturnPolicy(EntityPermission.READ_ONLY);
521    }
522    
523    @Nullable
524    public ReturnPolicy getReturnPolicyForUpdate() {
525        return getReturnPolicy(EntityPermission.READ_WRITE);
526    }
527    
528    public void setReturnPolicyPK(@Nullable ReturnPolicyPK returnPolicyPK)
529            throws PersistenceNotNullException, PersistenceReadOnlyException {
530        checkReadWrite();
531        _value.setReturnPolicyPK(returnPolicyPK);
532    }
533    
534    public void setReturnPolicy(@Nullable ReturnPolicy entity) {
535        setReturnPolicyPK(entity == null ? null : entity.getPrimaryKey());
536    }
537    
538    public boolean getReturnPolicyPKHasBeenModified() {
539        return _value.getReturnPolicyPKHasBeenModified();
540    }
541    
542    @Nullable
543    public Boolean getTaxable() {
544        return _value.getTaxable();
545    }
546    
547    public void setTaxable(@Nullable Boolean taxable)
548            throws PersistenceNotNullException, PersistenceReadOnlyException {
549        checkReadWrite();
550        _value.setTaxable(taxable);
551    }
552    
553    public boolean getTaxableHasBeenModified() {
554        return _value.getTaxableHasBeenModified();
555    }
556    
557    @Nonnull
558    public Long getFromTime() {
559        return _value.getFromTime();
560    }
561    
562    public void setFromTime(@Nonnull Long fromTime)
563            throws PersistenceNotNullException, PersistenceReadOnlyException {
564        checkReadWrite();
565        _value.setFromTime(fromTime);
566    }
567    
568    public boolean getFromTimeHasBeenModified() {
569        return _value.getFromTimeHasBeenModified();
570    }
571    
572    @Nonnull
573    public Long getThruTime() {
574        return _value.getThruTime();
575    }
576    
577    public void setThruTime(@Nonnull Long thruTime)
578            throws PersistenceNotNullException, PersistenceReadOnlyException {
579        checkReadWrite();
580        _value.setThruTime(thruTime);
581    }
582    
583    public boolean getThruTimeHasBeenModified() {
584        return _value.getThruTimeHasBeenModified();
585    }
586    
587}