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