001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 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(Session session)
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().store(session, this);
128    }
129    
130    @Override
131    public void remove(Session session)
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(session, this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
140    }
141    
142    public ShipmentLineDetailValue getShipmentLineDetailValue() {
143        return _value;
144    }
145    
146    public void setShipmentLineDetailValue(ShipmentLineDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public ShipmentLineDetailPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public ShipmentLinePK getShipmentLinePK() {
158        return _value.getShipmentLinePK();
159    }
160    
161    public ShipmentLine getShipmentLine(Session session, EntityPermission entityPermission) {
162        return ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentLinePK());
163    }
164    
165    public ShipmentLine getShipmentLine(EntityPermission entityPermission) {
166        return getShipmentLine(ThreadSession.currentSession(), entityPermission);
167    }
168    
169    public ShipmentLine getShipmentLine(Session session) {
170        return getShipmentLine(session, EntityPermission.READ_ONLY);
171    }
172    
173    public ShipmentLine getShipmentLine() {
174        return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
175    }
176    
177    public ShipmentLine getShipmentLineForUpdate(Session session) {
178        return getShipmentLine(session, EntityPermission.READ_WRITE);
179    }
180    
181    public ShipmentLine getShipmentLineForUpdate() {
182        return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
183    }
184    
185    public void setShipmentLinePK(ShipmentLinePK shipmentLinePK)
186            throws PersistenceNotNullException, PersistenceReadOnlyException {
187        checkReadWrite();
188        _value.setShipmentLinePK(shipmentLinePK);
189    }
190    
191    public void setShipmentLine(ShipmentLine entity) {
192        setShipmentLinePK(entity == null? null: entity.getPrimaryKey());
193    }
194    
195    public boolean getShipmentLinePKHasBeenModified() {
196        return _value.getShipmentLinePKHasBeenModified();
197    }
198    
199    public ShipmentPK getShipmentPK() {
200        return _value.getShipmentPK();
201    }
202    
203    public Shipment getShipment(Session session, EntityPermission entityPermission) {
204        return ShipmentFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPK());
205    }
206    
207    public Shipment getShipment(EntityPermission entityPermission) {
208        return getShipment(ThreadSession.currentSession(), entityPermission);
209    }
210    
211    public Shipment getShipment(Session session) {
212        return getShipment(session, EntityPermission.READ_ONLY);
213    }
214    
215    public Shipment getShipment() {
216        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
217    }
218    
219    public Shipment getShipmentForUpdate(Session session) {
220        return getShipment(session, EntityPermission.READ_WRITE);
221    }
222    
223    public Shipment getShipmentForUpdate() {
224        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
225    }
226    
227    public void setShipmentPK(ShipmentPK shipmentPK)
228            throws PersistenceNotNullException, PersistenceReadOnlyException {
229        checkReadWrite();
230        _value.setShipmentPK(shipmentPK);
231    }
232    
233    public void setShipment(Shipment entity) {
234        setShipmentPK(entity == null? null: entity.getPrimaryKey());
235    }
236    
237    public boolean getShipmentPKHasBeenModified() {
238        return _value.getShipmentPKHasBeenModified();
239    }
240    
241    public Integer getShipmentLineSequence() {
242        return _value.getShipmentLineSequence();
243    }
244    
245    public void setShipmentLineSequence(Integer shipmentLineSequence)
246            throws PersistenceNotNullException, PersistenceReadOnlyException {
247        checkReadWrite();
248        _value.setShipmentLineSequence(shipmentLineSequence);
249    }
250    
251    public boolean getShipmentLineSequenceHasBeenModified() {
252        return _value.getShipmentLineSequenceHasBeenModified();
253    }
254    
255    public ShipmentLinePK getParentShipmentLinePK() {
256        return _value.getParentShipmentLinePK();
257    }
258    
259    public ShipmentLine getParentShipmentLine(Session session, EntityPermission entityPermission) {
260        ShipmentLinePK pk = getParentShipmentLinePK();
261        ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
262        
263        return entity;
264    }
265    
266    public ShipmentLine getParentShipmentLine(EntityPermission entityPermission) {
267        return getParentShipmentLine(ThreadSession.currentSession(), entityPermission);
268    }
269    
270    public ShipmentLine getParentShipmentLine(Session session) {
271        return getParentShipmentLine(session, EntityPermission.READ_ONLY);
272    }
273    
274    public ShipmentLine getParentShipmentLine() {
275        return getParentShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
276    }
277    
278    public ShipmentLine getParentShipmentLineForUpdate(Session session) {
279        return getParentShipmentLine(session, EntityPermission.READ_WRITE);
280    }
281    
282    public ShipmentLine getParentShipmentLineForUpdate() {
283        return getParentShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
284    }
285    
286    public void setParentShipmentLinePK(ShipmentLinePK parentShipmentLinePK)
287            throws PersistenceNotNullException, PersistenceReadOnlyException {
288        checkReadWrite();
289        _value.setParentShipmentLinePK(parentShipmentLinePK);
290    }
291    
292    public void setParentShipmentLine(ShipmentLine entity) {
293        setParentShipmentLinePK(entity == null? null: entity.getPrimaryKey());
294    }
295    
296    public boolean getParentShipmentLinePKHasBeenModified() {
297        return _value.getParentShipmentLinePKHasBeenModified();
298    }
299    
300    public OrderLinePK getOrderLinePK() {
301        return _value.getOrderLinePK();
302    }
303    
304    public OrderLine getOrderLine(Session session, EntityPermission entityPermission) {
305        OrderLinePK pk = getOrderLinePK();
306        OrderLine entity = pk == null? null: OrderLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
307        
308        return entity;
309    }
310    
311    public OrderLine getOrderLine(EntityPermission entityPermission) {
312        return getOrderLine(ThreadSession.currentSession(), entityPermission);
313    }
314    
315    public OrderLine getOrderLine(Session session) {
316        return getOrderLine(session, EntityPermission.READ_ONLY);
317    }
318    
319    public OrderLine getOrderLine() {
320        return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
321    }
322    
323    public OrderLine getOrderLineForUpdate(Session session) {
324        return getOrderLine(session, EntityPermission.READ_WRITE);
325    }
326    
327    public OrderLine getOrderLineForUpdate() {
328        return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
329    }
330    
331    public void setOrderLinePK(OrderLinePK orderLinePK)
332            throws PersistenceNotNullException, PersistenceReadOnlyException {
333        checkReadWrite();
334        _value.setOrderLinePK(orderLinePK);
335    }
336    
337    public void setOrderLine(OrderLine entity) {
338        setOrderLinePK(entity == null? null: entity.getPrimaryKey());
339    }
340    
341    public boolean getOrderLinePKHasBeenModified() {
342        return _value.getOrderLinePKHasBeenModified();
343    }
344    
345    public ItemPK getItemPK() {
346        return _value.getItemPK();
347    }
348    
349    public Item getItem(Session session, EntityPermission entityPermission) {
350        return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK());
351    }
352    
353    public Item getItem(EntityPermission entityPermission) {
354        return getItem(ThreadSession.currentSession(), entityPermission);
355    }
356    
357    public Item getItem(Session session) {
358        return getItem(session, EntityPermission.READ_ONLY);
359    }
360    
361    public Item getItem() {
362        return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
363    }
364    
365    public Item getItemForUpdate(Session session) {
366        return getItem(session, EntityPermission.READ_WRITE);
367    }
368    
369    public Item getItemForUpdate() {
370        return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
371    }
372    
373    public void setItemPK(ItemPK itemPK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setItemPK(itemPK);
377    }
378    
379    public void setItem(Item entity) {
380        setItemPK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getItemPKHasBeenModified() {
384        return _value.getItemPKHasBeenModified();
385    }
386    
387    public InventoryConditionPK getInventoryConditionPK() {
388        return _value.getInventoryConditionPK();
389    }
390    
391    public InventoryCondition getInventoryCondition(Session session, EntityPermission entityPermission) {
392        return InventoryConditionFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryConditionPK());
393    }
394    
395    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
396        return getInventoryCondition(ThreadSession.currentSession(), entityPermission);
397    }
398    
399    public InventoryCondition getInventoryCondition(Session session) {
400        return getInventoryCondition(session, EntityPermission.READ_ONLY);
401    }
402    
403    public InventoryCondition getInventoryCondition() {
404        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
405    }
406    
407    public InventoryCondition getInventoryConditionForUpdate(Session session) {
408        return getInventoryCondition(session, EntityPermission.READ_WRITE);
409    }
410    
411    public InventoryCondition getInventoryConditionForUpdate() {
412        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
413    }
414    
415    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
416            throws PersistenceNotNullException, PersistenceReadOnlyException {
417        checkReadWrite();
418        _value.setInventoryConditionPK(inventoryConditionPK);
419    }
420    
421    public void setInventoryCondition(InventoryCondition entity) {
422        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
423    }
424    
425    public boolean getInventoryConditionPKHasBeenModified() {
426        return _value.getInventoryConditionPKHasBeenModified();
427    }
428    
429    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
430        return _value.getUnitOfMeasureTypePK();
431    }
432    
433    public UnitOfMeasureType getUnitOfMeasureType(Session session, EntityPermission entityPermission) {
434        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getUnitOfMeasureTypePK());
435    }
436    
437    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
438        return getUnitOfMeasureType(ThreadSession.currentSession(), entityPermission);
439    }
440    
441    public UnitOfMeasureType getUnitOfMeasureType(Session session) {
442        return getUnitOfMeasureType(session, EntityPermission.READ_ONLY);
443    }
444    
445    public UnitOfMeasureType getUnitOfMeasureType() {
446        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
447    }
448    
449    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate(Session session) {
450        return getUnitOfMeasureType(session, EntityPermission.READ_WRITE);
451    }
452    
453    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
454        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
455    }
456    
457    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
458            throws PersistenceNotNullException, PersistenceReadOnlyException {
459        checkReadWrite();
460        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
461    }
462    
463    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
464        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
465    }
466    
467    public boolean getUnitOfMeasureTypePKHasBeenModified() {
468        return _value.getUnitOfMeasureTypePKHasBeenModified();
469    }
470    
471    public Long getQuantity() {
472        return _value.getQuantity();
473    }
474    
475    public void setQuantity(Long quantity)
476            throws PersistenceNotNullException, PersistenceReadOnlyException {
477        checkReadWrite();
478        _value.setQuantity(quantity);
479    }
480    
481    public boolean getQuantityHasBeenModified() {
482        return _value.getQuantityHasBeenModified();
483    }
484    
485    public Long getFromTime() {
486        return _value.getFromTime();
487    }
488    
489    public void setFromTime(Long fromTime)
490            throws PersistenceNotNullException, PersistenceReadOnlyException {
491        checkReadWrite();
492        _value.setFromTime(fromTime);
493    }
494    
495    public boolean getFromTimeHasBeenModified() {
496        return _value.getFromTimeHasBeenModified();
497    }
498    
499    public Long getThruTime() {
500        return _value.getThruTime();
501    }
502    
503    public void setThruTime(Long thruTime)
504            throws PersistenceNotNullException, PersistenceReadOnlyException {
505        checkReadWrite();
506        _value.setThruTime(thruTime);
507    }
508    
509    public boolean getThruTimeHasBeenModified() {
510        return _value.getThruTimeHasBeenModified();
511    }
512    
513}