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 * ShipmentPackageLineDetail.java
021 */
022
023package com.echothree.model.data.shipment.server.entity;
024
025import com.echothree.model.data.shipment.common.pk.ShipmentPackageLineDetailPK;
026
027import com.echothree.model.data.shipment.common.pk.ShipmentPackageLinePK;
028import com.echothree.model.data.shipment.common.pk.ShipmentPackagePK;
029import com.echothree.model.data.shipment.common.pk.ShipmentLinePK;
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.ShipmentPackageLine;
035import com.echothree.model.data.shipment.server.entity.ShipmentPackage;
036import com.echothree.model.data.shipment.server.entity.ShipmentLine;
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.ShipmentPackageLineFactory;
042import com.echothree.model.data.shipment.server.factory.ShipmentPackageFactory;
043import com.echothree.model.data.shipment.server.factory.ShipmentLineFactory;
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.ShipmentPackageLineDetailPK;
049
050import com.echothree.model.data.shipment.server.value.ShipmentPackageLineDetailValue;
051
052import com.echothree.model.data.shipment.server.factory.ShipmentPackageLineDetailFactory;
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 ShipmentPackageLineDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private ShipmentPackageLineDetailPK _pk;
075    private ShipmentPackageLineDetailValue _value;
076    
077    /** Creates a new instance of ShipmentPackageLineDetail */
078    public ShipmentPackageLineDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of ShipmentPackageLineDetail */
084    public ShipmentPackageLineDetail(ShipmentPackageLineDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    public ShipmentPackageLineDetailFactory getBaseFactoryInstance() {
093        return ShipmentPackageLineDetailFactory.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 ShipmentPackageLineDetail that) {
117            ShipmentPackageLineDetailValue thatValue = that.getShipmentPackageLineDetailValue();
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 ShipmentPackageLineDetailValue getShipmentPackageLineDetailValue() {
137        return _value;
138    }
139    
140    public void setShipmentPackageLineDetailValue(ShipmentPackageLineDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public ShipmentPackageLineDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public ShipmentPackageLinePK getShipmentPackageLinePK() {
152        return _value.getShipmentPackageLinePK();
153    }
154    
155    public ShipmentPackageLine getShipmentPackageLine(EntityPermission entityPermission) {
156        return ShipmentPackageLineFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPackageLinePK());
157    }
158    
159    public ShipmentPackageLine getShipmentPackageLine() {
160        return getShipmentPackageLine(EntityPermission.READ_ONLY);
161    }
162    
163    public ShipmentPackageLine getShipmentPackageLineForUpdate() {
164        return getShipmentPackageLine(EntityPermission.READ_WRITE);
165    }
166    
167    public void setShipmentPackageLinePK(ShipmentPackageLinePK shipmentPackageLinePK)
168            throws PersistenceNotNullException, PersistenceReadOnlyException {
169        checkReadWrite();
170        _value.setShipmentPackageLinePK(shipmentPackageLinePK);
171    }
172    
173    public void setShipmentPackageLine(ShipmentPackageLine entity) {
174        setShipmentPackageLinePK(entity == null? null: entity.getPrimaryKey());
175    }
176    
177    public boolean getShipmentPackageLinePKHasBeenModified() {
178        return _value.getShipmentPackageLinePKHasBeenModified();
179    }
180    
181    public ShipmentPackagePK getShipmentPackagePK() {
182        return _value.getShipmentPackagePK();
183    }
184    
185    public ShipmentPackage getShipmentPackage(EntityPermission entityPermission) {
186        return ShipmentPackageFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPackagePK());
187    }
188    
189    public ShipmentPackage getShipmentPackage() {
190        return getShipmentPackage(EntityPermission.READ_ONLY);
191    }
192    
193    public ShipmentPackage getShipmentPackageForUpdate() {
194        return getShipmentPackage(EntityPermission.READ_WRITE);
195    }
196    
197    public void setShipmentPackagePK(ShipmentPackagePK shipmentPackagePK)
198            throws PersistenceNotNullException, PersistenceReadOnlyException {
199        checkReadWrite();
200        _value.setShipmentPackagePK(shipmentPackagePK);
201    }
202    
203    public void setShipmentPackage(ShipmentPackage entity) {
204        setShipmentPackagePK(entity == null? null: entity.getPrimaryKey());
205    }
206    
207    public boolean getShipmentPackagePKHasBeenModified() {
208        return _value.getShipmentPackagePKHasBeenModified();
209    }
210    
211    public Integer getShipmentPackageLineSequence() {
212        return _value.getShipmentPackageLineSequence();
213    }
214    
215    public void setShipmentPackageLineSequence(Integer shipmentPackageLineSequence)
216            throws PersistenceNotNullException, PersistenceReadOnlyException {
217        checkReadWrite();
218        _value.setShipmentPackageLineSequence(shipmentPackageLineSequence);
219    }
220    
221    public boolean getShipmentPackageLineSequenceHasBeenModified() {
222        return _value.getShipmentPackageLineSequenceHasBeenModified();
223    }
224    
225    public ShipmentLinePK getShipmentLinePK() {
226        return _value.getShipmentLinePK();
227    }
228    
229    public ShipmentLine getShipmentLine(EntityPermission entityPermission) {
230        ShipmentLinePK pk = getShipmentLinePK();
231        ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(entityPermission, pk);
232        
233        return entity;
234    }
235    
236    public ShipmentLine getShipmentLine() {
237        return getShipmentLine(EntityPermission.READ_ONLY);
238    }
239    
240    public ShipmentLine getShipmentLineForUpdate() {
241        return getShipmentLine(EntityPermission.READ_WRITE);
242    }
243    
244    public void setShipmentLinePK(ShipmentLinePK shipmentLinePK)
245            throws PersistenceNotNullException, PersistenceReadOnlyException {
246        checkReadWrite();
247        _value.setShipmentLinePK(shipmentLinePK);
248    }
249    
250    public void setShipmentLine(ShipmentLine entity) {
251        setShipmentLinePK(entity == null? null: entity.getPrimaryKey());
252    }
253    
254    public boolean getShipmentLinePKHasBeenModified() {
255        return _value.getShipmentLinePKHasBeenModified();
256    }
257    
258    public ItemPK getItemPK() {
259        return _value.getItemPK();
260    }
261    
262    public Item getItem(EntityPermission entityPermission) {
263        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
264    }
265    
266    public Item getItem() {
267        return getItem(EntityPermission.READ_ONLY);
268    }
269    
270    public Item getItemForUpdate() {
271        return getItem(EntityPermission.READ_WRITE);
272    }
273    
274    public void setItemPK(ItemPK itemPK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setItemPK(itemPK);
278    }
279    
280    public void setItem(Item entity) {
281        setItemPK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getItemPKHasBeenModified() {
285        return _value.getItemPKHasBeenModified();
286    }
287    
288    public InventoryConditionPK getInventoryConditionPK() {
289        return _value.getInventoryConditionPK();
290    }
291    
292    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
293        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
294    }
295    
296    public InventoryCondition getInventoryCondition() {
297        return getInventoryCondition(EntityPermission.READ_ONLY);
298    }
299    
300    public InventoryCondition getInventoryConditionForUpdate() {
301        return getInventoryCondition(EntityPermission.READ_WRITE);
302    }
303    
304    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
305            throws PersistenceNotNullException, PersistenceReadOnlyException {
306        checkReadWrite();
307        _value.setInventoryConditionPK(inventoryConditionPK);
308    }
309    
310    public void setInventoryCondition(InventoryCondition entity) {
311        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
312    }
313    
314    public boolean getInventoryConditionPKHasBeenModified() {
315        return _value.getInventoryConditionPKHasBeenModified();
316    }
317    
318    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
319        return _value.getUnitOfMeasureTypePK();
320    }
321    
322    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
323        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, getUnitOfMeasureTypePK());
324    }
325    
326    public UnitOfMeasureType getUnitOfMeasureType() {
327        return getUnitOfMeasureType(EntityPermission.READ_ONLY);
328    }
329    
330    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
331        return getUnitOfMeasureType(EntityPermission.READ_WRITE);
332    }
333    
334    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
335            throws PersistenceNotNullException, PersistenceReadOnlyException {
336        checkReadWrite();
337        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
338    }
339    
340    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
341        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
342    }
343    
344    public boolean getUnitOfMeasureTypePKHasBeenModified() {
345        return _value.getUnitOfMeasureTypePKHasBeenModified();
346    }
347    
348    public Long getQuantity() {
349        return _value.getQuantity();
350    }
351    
352    public void setQuantity(Long quantity)
353            throws PersistenceNotNullException, PersistenceReadOnlyException {
354        checkReadWrite();
355        _value.setQuantity(quantity);
356    }
357    
358    public boolean getQuantityHasBeenModified() {
359        return _value.getQuantityHasBeenModified();
360    }
361    
362    public Long getFromTime() {
363        return _value.getFromTime();
364    }
365    
366    public void setFromTime(Long fromTime)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setFromTime(fromTime);
370    }
371    
372    public boolean getFromTimeHasBeenModified() {
373        return _value.getFromTimeHasBeenModified();
374    }
375    
376    public Long getThruTime() {
377        return _value.getThruTime();
378    }
379    
380    public void setThruTime(Long thruTime)
381            throws PersistenceNotNullException, PersistenceReadOnlyException {
382        checkReadWrite();
383        _value.setThruTime(thruTime);
384    }
385    
386    public boolean getThruTimeHasBeenModified() {
387        return _value.getThruTimeHasBeenModified();
388    }
389    
390}