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