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 * ShipmentLineDetail.java
021 */
022
023package com.echothree.model.data.shipment.server.entity;
024
025import com.echothree.model.data.shipment.common.pk.ShipmentLineDetailPK;
026
027import com.echothree.model.data.shipment.common.pk.ShipmentLinePK;
028import com.echothree.model.data.shipment.common.pk.ShipmentPK;
029import com.echothree.model.data.order.common.pk.OrderLinePK;
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;
033
034import com.echothree.model.data.shipment.server.entity.ShipmentLine;
035import com.echothree.model.data.shipment.server.entity.Shipment;
036import com.echothree.model.data.order.server.entity.OrderLine;
037import com.echothree.model.data.item.server.entity.Item;
038import com.echothree.model.data.inventory.server.entity.InventoryCondition;
039import com.echothree.model.data.uom.server.entity.UnitOfMeasureType;
040
041import com.echothree.model.data.shipment.server.factory.ShipmentLineFactory;
042import com.echothree.model.data.shipment.server.factory.ShipmentFactory;
043import com.echothree.model.data.order.server.factory.OrderLineFactory;
044import com.echothree.model.data.item.server.factory.ItemFactory;
045import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory;
046import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory;
047
048import com.echothree.model.data.shipment.common.pk.ShipmentLineDetailPK;
049
050import com.echothree.model.data.shipment.server.value.ShipmentLineDetailValue;
051
052import com.echothree.model.data.shipment.server.factory.ShipmentLineDetailFactory;
053
054import com.echothree.util.common.exception.PersistenceException;
055import com.echothree.util.common.exception.PersistenceDatabaseException;
056import com.echothree.util.common.exception.PersistenceNotNullException;
057import com.echothree.util.common.exception.PersistenceReadOnlyException;
058
059import com.echothree.util.common.persistence.BasePK;
060
061import com.echothree.util.common.persistence.type.ByteArray;
062
063import com.echothree.util.server.persistence.BaseEntity;
064import com.echothree.util.server.persistence.EntityPermission;
065import com.echothree.util.server.persistence.Session;
066import com.echothree.util.server.persistence.ThreadSession;
067
068import java.io.Serializable;
069
070import javax.annotation.Nonnull;
071import javax.annotation.Nullable;
072
073public class ShipmentLineDetail
074        extends BaseEntity
075        implements Serializable {
076    
077    private ShipmentLineDetailPK _pk;
078    private ShipmentLineDetailValue _value;
079    
080    /** Creates a new instance of ShipmentLineDetail */
081    public ShipmentLineDetail()
082            throws PersistenceException {
083        super();
084    }
085    
086    /** Creates a new instance of ShipmentLineDetail */
087    public ShipmentLineDetail(ShipmentLineDetailValue value, EntityPermission entityPermission) {
088        super(entityPermission);
089        
090        _value = value;
091        _pk = value.getPrimaryKey();
092    }
093    
094    @Override
095    @Nonnull
096    public ShipmentLineDetailFactory getBaseFactoryInstance() {
097        return ShipmentLineDetailFactory.getInstance();
098    }
099    
100    @Override
101    public boolean hasBeenModified() {
102        return _value.hasBeenModified();
103    }
104    
105    @Override
106    public int hashCode() {
107        return _pk.hashCode();
108    }
109    
110    @Override
111    @Nonnull
112    public String toString() {
113        return _pk.toString();
114    }
115    
116    @Override
117    public boolean equals(Object other) {
118        if(this == other)
119            return true;
120        
121        if(other instanceof ShipmentLineDetail that) {
122            ShipmentLineDetailValue thatValue = that.getShipmentLineDetailValue();
123            return _value.equals(thatValue);
124        } else {
125            return false;
126        }
127    }
128    
129    @Override
130    public void store()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().store(this);
133    }
134    
135    @Override
136    public void remove()
137            throws PersistenceDatabaseException {
138        getBaseFactoryInstance().remove(this);
139    }
140    
141    @Nonnull
142    public ShipmentLineDetailValue getShipmentLineDetailValue() {
143        return _value;
144    }
145    
146    public void setShipmentLineDetailValue(@Nonnull ShipmentLineDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    @Nonnull
154    public ShipmentLineDetailPK getPrimaryKey() {
155        return _pk;
156    }
157    
158    @Nonnull
159    public ShipmentLinePK getShipmentLinePK() {
160        return _value.getShipmentLinePK();
161    }
162    
163    @Nonnull
164    public ShipmentLine getShipmentLine(EntityPermission entityPermission) {
165        return ShipmentLineFactory.getInstance().getEntityFromPK(entityPermission, getShipmentLinePK());
166    }
167    
168    @Nonnull
169    public ShipmentLine getShipmentLine() {
170        return getShipmentLine(EntityPermission.READ_ONLY);
171    }
172    
173    @Nonnull
174    public ShipmentLine getShipmentLineForUpdate() {
175        return getShipmentLine(EntityPermission.READ_WRITE);
176    }
177    
178    public void setShipmentLinePK(@Nonnull ShipmentLinePK shipmentLinePK)
179            throws PersistenceNotNullException, PersistenceReadOnlyException {
180        checkReadWrite();
181        _value.setShipmentLinePK(shipmentLinePK);
182    }
183    
184    public void setShipmentLine(@Nonnull ShipmentLine entity) {
185        setShipmentLinePK(entity == null ? null : entity.getPrimaryKey());
186    }
187    
188    public boolean getShipmentLinePKHasBeenModified() {
189        return _value.getShipmentLinePKHasBeenModified();
190    }
191    
192    @Nonnull
193    public ShipmentPK getShipmentPK() {
194        return _value.getShipmentPK();
195    }
196    
197    @Nonnull
198    public Shipment getShipment(EntityPermission entityPermission) {
199        return ShipmentFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPK());
200    }
201    
202    @Nonnull
203    public Shipment getShipment() {
204        return getShipment(EntityPermission.READ_ONLY);
205    }
206    
207    @Nonnull
208    public Shipment getShipmentForUpdate() {
209        return getShipment(EntityPermission.READ_WRITE);
210    }
211    
212    public void setShipmentPK(@Nonnull ShipmentPK shipmentPK)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setShipmentPK(shipmentPK);
216    }
217    
218    public void setShipment(@Nonnull Shipment entity) {
219        setShipmentPK(entity == null ? null : entity.getPrimaryKey());
220    }
221    
222    public boolean getShipmentPKHasBeenModified() {
223        return _value.getShipmentPKHasBeenModified();
224    }
225    
226    @Nonnull
227    public Integer getShipmentLineSequence() {
228        return _value.getShipmentLineSequence();
229    }
230    
231    public void setShipmentLineSequence(@Nonnull Integer shipmentLineSequence)
232            throws PersistenceNotNullException, PersistenceReadOnlyException {
233        checkReadWrite();
234        _value.setShipmentLineSequence(shipmentLineSequence);
235    }
236    
237    public boolean getShipmentLineSequenceHasBeenModified() {
238        return _value.getShipmentLineSequenceHasBeenModified();
239    }
240    
241    @Nullable
242    public ShipmentLinePK getParentShipmentLinePK() {
243        return _value.getParentShipmentLinePK();
244    }
245    
246    @Nullable
247    public ShipmentLine getParentShipmentLine(EntityPermission entityPermission) {
248        ShipmentLinePK pk = getParentShipmentLinePK();
249        ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(entityPermission, pk);
250        
251        return entity;
252    }
253    
254    @Nullable
255    public ShipmentLine getParentShipmentLine() {
256        return getParentShipmentLine(EntityPermission.READ_ONLY);
257    }
258    
259    @Nullable
260    public ShipmentLine getParentShipmentLineForUpdate() {
261        return getParentShipmentLine(EntityPermission.READ_WRITE);
262    }
263    
264    public void setParentShipmentLinePK(@Nullable ShipmentLinePK parentShipmentLinePK)
265            throws PersistenceNotNullException, PersistenceReadOnlyException {
266        checkReadWrite();
267        _value.setParentShipmentLinePK(parentShipmentLinePK);
268    }
269    
270    public void setParentShipmentLine(@Nullable ShipmentLine entity) {
271        setParentShipmentLinePK(entity == null ? null : entity.getPrimaryKey());
272    }
273    
274    public boolean getParentShipmentLinePKHasBeenModified() {
275        return _value.getParentShipmentLinePKHasBeenModified();
276    }
277    
278    @Nullable
279    public OrderLinePK getOrderLinePK() {
280        return _value.getOrderLinePK();
281    }
282    
283    @Nullable
284    public OrderLine getOrderLine(EntityPermission entityPermission) {
285        OrderLinePK pk = getOrderLinePK();
286        OrderLine entity = pk == null? null: OrderLineFactory.getInstance().getEntityFromPK(entityPermission, pk);
287        
288        return entity;
289    }
290    
291    @Nullable
292    public OrderLine getOrderLine() {
293        return getOrderLine(EntityPermission.READ_ONLY);
294    }
295    
296    @Nullable
297    public OrderLine getOrderLineForUpdate() {
298        return getOrderLine(EntityPermission.READ_WRITE);
299    }
300    
301    public void setOrderLinePK(@Nullable OrderLinePK orderLinePK)
302            throws PersistenceNotNullException, PersistenceReadOnlyException {
303        checkReadWrite();
304        _value.setOrderLinePK(orderLinePK);
305    }
306    
307    public void setOrderLine(@Nullable OrderLine entity) {
308        setOrderLinePK(entity == null ? null : entity.getPrimaryKey());
309    }
310    
311    public boolean getOrderLinePKHasBeenModified() {
312        return _value.getOrderLinePKHasBeenModified();
313    }
314    
315    @Nonnull
316    public ItemPK getItemPK() {
317        return _value.getItemPK();
318    }
319    
320    @Nonnull
321    public Item getItem(EntityPermission entityPermission) {
322        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
323    }
324    
325    @Nonnull
326    public Item getItem() {
327        return getItem(EntityPermission.READ_ONLY);
328    }
329    
330    @Nonnull
331    public Item getItemForUpdate() {
332        return getItem(EntityPermission.READ_WRITE);
333    }
334    
335    public void setItemPK(@Nonnull ItemPK itemPK)
336            throws PersistenceNotNullException, PersistenceReadOnlyException {
337        checkReadWrite();
338        _value.setItemPK(itemPK);
339    }
340    
341    public void setItem(@Nonnull Item entity) {
342        setItemPK(entity == null ? null : entity.getPrimaryKey());
343    }
344    
345    public boolean getItemPKHasBeenModified() {
346        return _value.getItemPKHasBeenModified();
347    }
348    
349    @Nonnull
350    public InventoryConditionPK getInventoryConditionPK() {
351        return _value.getInventoryConditionPK();
352    }
353    
354    @Nonnull
355    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
356        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
357    }
358    
359    @Nonnull
360    public InventoryCondition getInventoryCondition() {
361        return getInventoryCondition(EntityPermission.READ_ONLY);
362    }
363    
364    @Nonnull
365    public InventoryCondition getInventoryConditionForUpdate() {
366        return getInventoryCondition(EntityPermission.READ_WRITE);
367    }
368    
369    public void setInventoryConditionPK(@Nonnull InventoryConditionPK inventoryConditionPK)
370            throws PersistenceNotNullException, PersistenceReadOnlyException {
371        checkReadWrite();
372        _value.setInventoryConditionPK(inventoryConditionPK);
373    }
374    
375    public void setInventoryCondition(@Nonnull InventoryCondition entity) {
376        setInventoryConditionPK(entity == null ? null : entity.getPrimaryKey());
377    }
378    
379    public boolean getInventoryConditionPKHasBeenModified() {
380        return _value.getInventoryConditionPKHasBeenModified();
381    }
382    
383    @Nonnull
384    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
385        return _value.getUnitOfMeasureTypePK();
386    }
387    
388    @Nonnull
389    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
390        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, getUnitOfMeasureTypePK());
391    }
392    
393    @Nonnull
394    public UnitOfMeasureType getUnitOfMeasureType() {
395        return getUnitOfMeasureType(EntityPermission.READ_ONLY);
396    }
397    
398    @Nonnull
399    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
400        return getUnitOfMeasureType(EntityPermission.READ_WRITE);
401    }
402    
403    public void setUnitOfMeasureTypePK(@Nonnull UnitOfMeasureTypePK unitOfMeasureTypePK)
404            throws PersistenceNotNullException, PersistenceReadOnlyException {
405        checkReadWrite();
406        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
407    }
408    
409    public void setUnitOfMeasureType(@Nonnull UnitOfMeasureType entity) {
410        setUnitOfMeasureTypePK(entity == null ? null : entity.getPrimaryKey());
411    }
412    
413    public boolean getUnitOfMeasureTypePKHasBeenModified() {
414        return _value.getUnitOfMeasureTypePKHasBeenModified();
415    }
416    
417    @Nonnull
418    public Long getQuantity() {
419        return _value.getQuantity();
420    }
421    
422    public void setQuantity(@Nonnull Long quantity)
423            throws PersistenceNotNullException, PersistenceReadOnlyException {
424        checkReadWrite();
425        _value.setQuantity(quantity);
426    }
427    
428    public boolean getQuantityHasBeenModified() {
429        return _value.getQuantityHasBeenModified();
430    }
431    
432    @Nonnull
433    public Long getFromTime() {
434        return _value.getFromTime();
435    }
436    
437    public void setFromTime(@Nonnull Long fromTime)
438            throws PersistenceNotNullException, PersistenceReadOnlyException {
439        checkReadWrite();
440        _value.setFromTime(fromTime);
441    }
442    
443    public boolean getFromTimeHasBeenModified() {
444        return _value.getFromTimeHasBeenModified();
445    }
446    
447    @Nonnull
448    public Long getThruTime() {
449        return _value.getThruTime();
450    }
451    
452    public void setThruTime(@Nonnull Long thruTime)
453            throws PersistenceNotNullException, PersistenceReadOnlyException {
454        checkReadWrite();
455        _value.setThruTime(thruTime);
456    }
457    
458    public boolean getThruTimeHasBeenModified() {
459        return _value.getThruTimeHasBeenModified();
460    }
461    
462}