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
076public class OrderLineDetail
077        extends BaseEntity
078        implements Serializable {
079    
080    private OrderLineDetailPK _pk;
081    private OrderLineDetailValue _value;
082    
083    /** Creates a new instance of OrderLineDetail */
084    public OrderLineDetail()
085            throws PersistenceException {
086        super();
087    }
088    
089    /** Creates a new instance of OrderLineDetail */
090    public OrderLineDetail(OrderLineDetailValue value, EntityPermission entityPermission) {
091        super(entityPermission);
092        
093        _value = value;
094        _pk = value.getPrimaryKey();
095    }
096    
097    @Override
098    public OrderLineDetailFactory getBaseFactoryInstance() {
099        return OrderLineDetailFactory.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 OrderLineDetail that) {
123            OrderLineDetailValue thatValue = that.getOrderLineDetailValue();
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 OrderLineDetailValue getOrderLineDetailValue() {
143        return _value;
144    }
145    
146    public void setOrderLineDetailValue(OrderLineDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public OrderLineDetailPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public OrderLinePK getOrderLinePK() {
158        return _value.getOrderLinePK();
159    }
160    
161    public OrderLine getOrderLine(EntityPermission entityPermission) {
162        return OrderLineFactory.getInstance().getEntityFromPK(entityPermission, getOrderLinePK());
163    }
164    
165    public OrderLine getOrderLine() {
166        return getOrderLine(EntityPermission.READ_ONLY);
167    }
168    
169    public OrderLine getOrderLineForUpdate() {
170        return getOrderLine(EntityPermission.READ_WRITE);
171    }
172    
173    public void setOrderLinePK(OrderLinePK orderLinePK)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setOrderLinePK(orderLinePK);
177    }
178    
179    public void setOrderLine(OrderLine entity) {
180        setOrderLinePK(entity == null? null: entity.getPrimaryKey());
181    }
182    
183    public boolean getOrderLinePKHasBeenModified() {
184        return _value.getOrderLinePKHasBeenModified();
185    }
186    
187    public OrderPK getOrderPK() {
188        return _value.getOrderPK();
189    }
190    
191    public Order getOrder(EntityPermission entityPermission) {
192        return OrderFactory.getInstance().getEntityFromPK(entityPermission, getOrderPK());
193    }
194    
195    public Order getOrder() {
196        return getOrder(EntityPermission.READ_ONLY);
197    }
198    
199    public Order getOrderForUpdate() {
200        return getOrder(EntityPermission.READ_WRITE);
201    }
202    
203    public void setOrderPK(OrderPK orderPK)
204            throws PersistenceNotNullException, PersistenceReadOnlyException {
205        checkReadWrite();
206        _value.setOrderPK(orderPK);
207    }
208    
209    public void setOrder(Order entity) {
210        setOrderPK(entity == null? null: entity.getPrimaryKey());
211    }
212    
213    public boolean getOrderPKHasBeenModified() {
214        return _value.getOrderPKHasBeenModified();
215    }
216    
217    public Integer getOrderLineSequence() {
218        return _value.getOrderLineSequence();
219    }
220    
221    public void setOrderLineSequence(Integer orderLineSequence)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setOrderLineSequence(orderLineSequence);
225    }
226    
227    public boolean getOrderLineSequenceHasBeenModified() {
228        return _value.getOrderLineSequenceHasBeenModified();
229    }
230    
231    public OrderLinePK getParentOrderLinePK() {
232        return _value.getParentOrderLinePK();
233    }
234    
235    public OrderLine getParentOrderLine(EntityPermission entityPermission) {
236        OrderLinePK pk = getParentOrderLinePK();
237        OrderLine entity = pk == null? null: OrderLineFactory.getInstance().getEntityFromPK(entityPermission, pk);
238        
239        return entity;
240    }
241    
242    public OrderLine getParentOrderLine() {
243        return getParentOrderLine(EntityPermission.READ_ONLY);
244    }
245    
246    public OrderLine getParentOrderLineForUpdate() {
247        return getParentOrderLine(EntityPermission.READ_WRITE);
248    }
249    
250    public void setParentOrderLinePK(OrderLinePK parentOrderLinePK)
251            throws PersistenceNotNullException, PersistenceReadOnlyException {
252        checkReadWrite();
253        _value.setParentOrderLinePK(parentOrderLinePK);
254    }
255    
256    public void setParentOrderLine(OrderLine entity) {
257        setParentOrderLinePK(entity == null? null: entity.getPrimaryKey());
258    }
259    
260    public boolean getParentOrderLinePKHasBeenModified() {
261        return _value.getParentOrderLinePKHasBeenModified();
262    }
263    
264    public OrderShipmentGroupPK getOrderShipmentGroupPK() {
265        return _value.getOrderShipmentGroupPK();
266    }
267    
268    public OrderShipmentGroup getOrderShipmentGroup(EntityPermission entityPermission) {
269        OrderShipmentGroupPK pk = getOrderShipmentGroupPK();
270        OrderShipmentGroup entity = pk == null? null: OrderShipmentGroupFactory.getInstance().getEntityFromPK(entityPermission, pk);
271        
272        return entity;
273    }
274    
275    public OrderShipmentGroup getOrderShipmentGroup() {
276        return getOrderShipmentGroup(EntityPermission.READ_ONLY);
277    }
278    
279    public OrderShipmentGroup getOrderShipmentGroupForUpdate() {
280        return getOrderShipmentGroup(EntityPermission.READ_WRITE);
281    }
282    
283    public void setOrderShipmentGroupPK(OrderShipmentGroupPK orderShipmentGroupPK)
284            throws PersistenceNotNullException, PersistenceReadOnlyException {
285        checkReadWrite();
286        _value.setOrderShipmentGroupPK(orderShipmentGroupPK);
287    }
288    
289    public void setOrderShipmentGroup(OrderShipmentGroup entity) {
290        setOrderShipmentGroupPK(entity == null? null: entity.getPrimaryKey());
291    }
292    
293    public boolean getOrderShipmentGroupPKHasBeenModified() {
294        return _value.getOrderShipmentGroupPKHasBeenModified();
295    }
296    
297    public ItemPK getItemPK() {
298        return _value.getItemPK();
299    }
300    
301    public Item getItem(EntityPermission entityPermission) {
302        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
303    }
304    
305    public Item getItem() {
306        return getItem(EntityPermission.READ_ONLY);
307    }
308    
309    public Item getItemForUpdate() {
310        return getItem(EntityPermission.READ_WRITE);
311    }
312    
313    public void setItemPK(ItemPK itemPK)
314            throws PersistenceNotNullException, PersistenceReadOnlyException {
315        checkReadWrite();
316        _value.setItemPK(itemPK);
317    }
318    
319    public void setItem(Item entity) {
320        setItemPK(entity == null? null: entity.getPrimaryKey());
321    }
322    
323    public boolean getItemPKHasBeenModified() {
324        return _value.getItemPKHasBeenModified();
325    }
326    
327    public InventoryConditionPK getInventoryConditionPK() {
328        return _value.getInventoryConditionPK();
329    }
330    
331    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
332        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
333    }
334    
335    public InventoryCondition getInventoryCondition() {
336        return getInventoryCondition(EntityPermission.READ_ONLY);
337    }
338    
339    public InventoryCondition getInventoryConditionForUpdate() {
340        return getInventoryCondition(EntityPermission.READ_WRITE);
341    }
342    
343    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
344            throws PersistenceNotNullException, PersistenceReadOnlyException {
345        checkReadWrite();
346        _value.setInventoryConditionPK(inventoryConditionPK);
347    }
348    
349    public void setInventoryCondition(InventoryCondition entity) {
350        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
351    }
352    
353    public boolean getInventoryConditionPKHasBeenModified() {
354        return _value.getInventoryConditionPKHasBeenModified();
355    }
356    
357    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
358        return _value.getUnitOfMeasureTypePK();
359    }
360    
361    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
362        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, getUnitOfMeasureTypePK());
363    }
364    
365    public UnitOfMeasureType getUnitOfMeasureType() {
366        return getUnitOfMeasureType(EntityPermission.READ_ONLY);
367    }
368    
369    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
370        return getUnitOfMeasureType(EntityPermission.READ_WRITE);
371    }
372    
373    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
377    }
378    
379    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
380        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getUnitOfMeasureTypePKHasBeenModified() {
384        return _value.getUnitOfMeasureTypePKHasBeenModified();
385    }
386    
387    public Long getQuantity() {
388        return _value.getQuantity();
389    }
390    
391    public void setQuantity(Long quantity)
392            throws PersistenceNotNullException, PersistenceReadOnlyException {
393        checkReadWrite();
394        _value.setQuantity(quantity);
395    }
396    
397    public boolean getQuantityHasBeenModified() {
398        return _value.getQuantityHasBeenModified();
399    }
400    
401    public Long getUnitAmount() {
402        return _value.getUnitAmount();
403    }
404    
405    public void setUnitAmount(Long unitAmount)
406            throws PersistenceNotNullException, PersistenceReadOnlyException {
407        checkReadWrite();
408        _value.setUnitAmount(unitAmount);
409    }
410    
411    public boolean getUnitAmountHasBeenModified() {
412        return _value.getUnitAmountHasBeenModified();
413    }
414    
415    public String getDescription() {
416        return _value.getDescription();
417    }
418    
419    public void setDescription(String description)
420            throws PersistenceNotNullException, PersistenceReadOnlyException {
421        checkReadWrite();
422        _value.setDescription(description);
423    }
424    
425    public boolean getDescriptionHasBeenModified() {
426        return _value.getDescriptionHasBeenModified();
427    }
428    
429    public CancellationPolicyPK getCancellationPolicyPK() {
430        return _value.getCancellationPolicyPK();
431    }
432    
433    public CancellationPolicy getCancellationPolicy(EntityPermission entityPermission) {
434        CancellationPolicyPK pk = getCancellationPolicyPK();
435        CancellationPolicy entity = pk == null? null: CancellationPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
436        
437        return entity;
438    }
439    
440    public CancellationPolicy getCancellationPolicy() {
441        return getCancellationPolicy(EntityPermission.READ_ONLY);
442    }
443    
444    public CancellationPolicy getCancellationPolicyForUpdate() {
445        return getCancellationPolicy(EntityPermission.READ_WRITE);
446    }
447    
448    public void setCancellationPolicyPK(CancellationPolicyPK cancellationPolicyPK)
449            throws PersistenceNotNullException, PersistenceReadOnlyException {
450        checkReadWrite();
451        _value.setCancellationPolicyPK(cancellationPolicyPK);
452    }
453    
454    public void setCancellationPolicy(CancellationPolicy entity) {
455        setCancellationPolicyPK(entity == null? null: entity.getPrimaryKey());
456    }
457    
458    public boolean getCancellationPolicyPKHasBeenModified() {
459        return _value.getCancellationPolicyPKHasBeenModified();
460    }
461    
462    public ReturnPolicyPK getReturnPolicyPK() {
463        return _value.getReturnPolicyPK();
464    }
465    
466    public ReturnPolicy getReturnPolicy(EntityPermission entityPermission) {
467        ReturnPolicyPK pk = getReturnPolicyPK();
468        ReturnPolicy entity = pk == null? null: ReturnPolicyFactory.getInstance().getEntityFromPK(entityPermission, pk);
469        
470        return entity;
471    }
472    
473    public ReturnPolicy getReturnPolicy() {
474        return getReturnPolicy(EntityPermission.READ_ONLY);
475    }
476    
477    public ReturnPolicy getReturnPolicyForUpdate() {
478        return getReturnPolicy(EntityPermission.READ_WRITE);
479    }
480    
481    public void setReturnPolicyPK(ReturnPolicyPK returnPolicyPK)
482            throws PersistenceNotNullException, PersistenceReadOnlyException {
483        checkReadWrite();
484        _value.setReturnPolicyPK(returnPolicyPK);
485    }
486    
487    public void setReturnPolicy(ReturnPolicy entity) {
488        setReturnPolicyPK(entity == null? null: entity.getPrimaryKey());
489    }
490    
491    public boolean getReturnPolicyPKHasBeenModified() {
492        return _value.getReturnPolicyPKHasBeenModified();
493    }
494    
495    public Boolean getTaxable() {
496        return _value.getTaxable();
497    }
498    
499    public void setTaxable(Boolean taxable)
500            throws PersistenceNotNullException, PersistenceReadOnlyException {
501        checkReadWrite();
502        _value.setTaxable(taxable);
503    }
504    
505    public boolean getTaxableHasBeenModified() {
506        return _value.getTaxableHasBeenModified();
507    }
508    
509    public Long getFromTime() {
510        return _value.getFromTime();
511    }
512    
513    public void setFromTime(Long fromTime)
514            throws PersistenceNotNullException, PersistenceReadOnlyException {
515        checkReadWrite();
516        _value.setFromTime(fromTime);
517    }
518    
519    public boolean getFromTimeHasBeenModified() {
520        return _value.getFromTimeHasBeenModified();
521    }
522    
523    public Long getThruTime() {
524        return _value.getThruTime();
525    }
526    
527    public void setThruTime(Long thruTime)
528            throws PersistenceNotNullException, PersistenceReadOnlyException {
529        checkReadWrite();
530        _value.setThruTime(thruTime);
531    }
532    
533    public boolean getThruTimeHasBeenModified() {
534        return _value.getThruTimeHasBeenModified();
535    }
536    
537}