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 * ShipmentPackageDetail.java
021 */
022
023package com.echothree.model.data.shipment.server.entity;
024
025import com.echothree.model.data.shipment.common.pk.ShipmentPackageDetailPK;
026
027import com.echothree.model.data.shipment.common.pk.ShipmentPackagePK;
028import com.echothree.model.data.shipment.common.pk.ShipmentTypePK;
029import com.echothree.model.data.shipment.common.pk.ShipmentPK;
030import com.echothree.model.data.warehouse.common.pk.PackageTypePK;
031import com.echothree.model.data.uom.common.pk.UnitOfMeasureTypePK;
032
033import com.echothree.model.data.shipment.server.entity.ShipmentPackage;
034import com.echothree.model.data.shipment.server.entity.ShipmentType;
035import com.echothree.model.data.shipment.server.entity.Shipment;
036import com.echothree.model.data.warehouse.server.entity.PackageType;
037import com.echothree.model.data.uom.server.entity.UnitOfMeasureType;
038
039import com.echothree.model.data.shipment.server.factory.ShipmentPackageFactory;
040import com.echothree.model.data.shipment.server.factory.ShipmentTypeFactory;
041import com.echothree.model.data.shipment.server.factory.ShipmentFactory;
042import com.echothree.model.data.warehouse.server.factory.PackageTypeFactory;
043import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory;
044
045import com.echothree.model.data.shipment.common.pk.ShipmentPackageDetailPK;
046
047import com.echothree.model.data.shipment.server.value.ShipmentPackageDetailValue;
048
049import com.echothree.model.data.shipment.server.factory.ShipmentPackageDetailFactory;
050
051import com.echothree.util.common.exception.PersistenceException;
052import com.echothree.util.common.exception.PersistenceDatabaseException;
053import com.echothree.util.common.exception.PersistenceNotNullException;
054import com.echothree.util.common.exception.PersistenceReadOnlyException;
055
056import com.echothree.util.common.persistence.BasePK;
057
058import com.echothree.util.common.persistence.type.ByteArray;
059
060import com.echothree.util.server.persistence.BaseEntity;
061import com.echothree.util.server.persistence.EntityPermission;
062import com.echothree.util.server.persistence.Session;
063import com.echothree.util.server.persistence.ThreadSession;
064
065import java.io.Serializable;
066
067public class ShipmentPackageDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private ShipmentPackageDetailPK _pk;
072    private ShipmentPackageDetailValue _value;
073    
074    /** Creates a new instance of ShipmentPackageDetail */
075    public ShipmentPackageDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of ShipmentPackageDetail */
081    public ShipmentPackageDetail(ShipmentPackageDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    public ShipmentPackageDetailFactory getBaseFactoryInstance() {
090        return ShipmentPackageDetailFactory.getInstance();
091    }
092    
093    @Override
094    public boolean hasBeenModified() {
095        return _value.hasBeenModified();
096    }
097    
098    @Override
099    public int hashCode() {
100        return _pk.hashCode();
101    }
102    
103    @Override
104    public String toString() {
105        return _pk.toString();
106    }
107    
108    @Override
109    public boolean equals(Object other) {
110        if(this == other)
111            return true;
112        
113        if(other instanceof ShipmentPackageDetail that) {
114            ShipmentPackageDetailValue thatValue = that.getShipmentPackageDetailValue();
115            return _value.equals(thatValue);
116        } else {
117            return false;
118        }
119    }
120    
121    @Override
122    public void store()
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(this);
125    }
126    
127    @Override
128    public void remove()
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(this);
131    }
132    
133    public ShipmentPackageDetailValue getShipmentPackageDetailValue() {
134        return _value;
135    }
136    
137    public void setShipmentPackageDetailValue(ShipmentPackageDetailValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    public ShipmentPackageDetailPK getPrimaryKey() {
145        return _pk;
146    }
147    
148    public ShipmentPackagePK getShipmentPackagePK() {
149        return _value.getShipmentPackagePK();
150    }
151    
152    public ShipmentPackage getShipmentPackage(EntityPermission entityPermission) {
153        return ShipmentPackageFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPackagePK());
154    }
155    
156    public ShipmentPackage getShipmentPackage() {
157        return getShipmentPackage(EntityPermission.READ_ONLY);
158    }
159    
160    public ShipmentPackage getShipmentPackageForUpdate() {
161        return getShipmentPackage(EntityPermission.READ_WRITE);
162    }
163    
164    public void setShipmentPackagePK(ShipmentPackagePK shipmentPackagePK)
165            throws PersistenceNotNullException, PersistenceReadOnlyException {
166        checkReadWrite();
167        _value.setShipmentPackagePK(shipmentPackagePK);
168    }
169    
170    public void setShipmentPackage(ShipmentPackage entity) {
171        setShipmentPackagePK(entity == null? null: entity.getPrimaryKey());
172    }
173    
174    public boolean getShipmentPackagePKHasBeenModified() {
175        return _value.getShipmentPackagePKHasBeenModified();
176    }
177    
178    public ShipmentTypePK getShipmentTypePK() {
179        return _value.getShipmentTypePK();
180    }
181    
182    public ShipmentType getShipmentType(EntityPermission entityPermission) {
183        return ShipmentTypeFactory.getInstance().getEntityFromPK(entityPermission, getShipmentTypePK());
184    }
185    
186    public ShipmentType getShipmentType() {
187        return getShipmentType(EntityPermission.READ_ONLY);
188    }
189    
190    public ShipmentType getShipmentTypeForUpdate() {
191        return getShipmentType(EntityPermission.READ_WRITE);
192    }
193    
194    public void setShipmentTypePK(ShipmentTypePK shipmentTypePK)
195            throws PersistenceNotNullException, PersistenceReadOnlyException {
196        checkReadWrite();
197        _value.setShipmentTypePK(shipmentTypePK);
198    }
199    
200    public void setShipmentType(ShipmentType entity) {
201        setShipmentTypePK(entity == null? null: entity.getPrimaryKey());
202    }
203    
204    public boolean getShipmentTypePKHasBeenModified() {
205        return _value.getShipmentTypePKHasBeenModified();
206    }
207    
208    public String getShipmentPackageName() {
209        return _value.getShipmentPackageName();
210    }
211    
212    public void setShipmentPackageName(String shipmentPackageName)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setShipmentPackageName(shipmentPackageName);
216    }
217    
218    public boolean getShipmentPackageNameHasBeenModified() {
219        return _value.getShipmentPackageNameHasBeenModified();
220    }
221    
222    public ShipmentPackagePK getParentShipmentPackagePK() {
223        return _value.getParentShipmentPackagePK();
224    }
225    
226    public ShipmentPackage getParentShipmentPackage(EntityPermission entityPermission) {
227        ShipmentPackagePK pk = getParentShipmentPackagePK();
228        ShipmentPackage entity = pk == null? null: ShipmentPackageFactory.getInstance().getEntityFromPK(entityPermission, pk);
229        
230        return entity;
231    }
232    
233    public ShipmentPackage getParentShipmentPackage() {
234        return getParentShipmentPackage(EntityPermission.READ_ONLY);
235    }
236    
237    public ShipmentPackage getParentShipmentPackageForUpdate() {
238        return getParentShipmentPackage(EntityPermission.READ_WRITE);
239    }
240    
241    public void setParentShipmentPackagePK(ShipmentPackagePK parentShipmentPackagePK)
242            throws PersistenceNotNullException, PersistenceReadOnlyException {
243        checkReadWrite();
244        _value.setParentShipmentPackagePK(parentShipmentPackagePK);
245    }
246    
247    public void setParentShipmentPackage(ShipmentPackage entity) {
248        setParentShipmentPackagePK(entity == null? null: entity.getPrimaryKey());
249    }
250    
251    public boolean getParentShipmentPackagePKHasBeenModified() {
252        return _value.getParentShipmentPackagePKHasBeenModified();
253    }
254    
255    public ShipmentPK getShipmentPK() {
256        return _value.getShipmentPK();
257    }
258    
259    public Shipment getShipment(EntityPermission entityPermission) {
260        ShipmentPK pk = getShipmentPK();
261        Shipment entity = pk == null? null: ShipmentFactory.getInstance().getEntityFromPK(entityPermission, pk);
262        
263        return entity;
264    }
265    
266    public Shipment getShipment() {
267        return getShipment(EntityPermission.READ_ONLY);
268    }
269    
270    public Shipment getShipmentForUpdate() {
271        return getShipment(EntityPermission.READ_WRITE);
272    }
273    
274    public void setShipmentPK(ShipmentPK shipmentPK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setShipmentPK(shipmentPK);
278    }
279    
280    public void setShipment(Shipment entity) {
281        setShipmentPK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getShipmentPKHasBeenModified() {
285        return _value.getShipmentPKHasBeenModified();
286    }
287    
288    public PackageTypePK getPackageTypePK() {
289        return _value.getPackageTypePK();
290    }
291    
292    public PackageType getPackageType(EntityPermission entityPermission) {
293        PackageTypePK pk = getPackageTypePK();
294        PackageType entity = pk == null? null: PackageTypeFactory.getInstance().getEntityFromPK(entityPermission, pk);
295        
296        return entity;
297    }
298    
299    public PackageType getPackageType() {
300        return getPackageType(EntityPermission.READ_ONLY);
301    }
302    
303    public PackageType getPackageTypeForUpdate() {
304        return getPackageType(EntityPermission.READ_WRITE);
305    }
306    
307    public void setPackageTypePK(PackageTypePK packageTypePK)
308            throws PersistenceNotNullException, PersistenceReadOnlyException {
309        checkReadWrite();
310        _value.setPackageTypePK(packageTypePK);
311    }
312    
313    public void setPackageType(PackageType entity) {
314        setPackageTypePK(entity == null? null: entity.getPrimaryKey());
315    }
316    
317    public boolean getPackageTypePKHasBeenModified() {
318        return _value.getPackageTypePKHasBeenModified();
319    }
320    
321    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
322        return _value.getUnitOfMeasureTypePK();
323    }
324    
325    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
326        UnitOfMeasureTypePK pk = getUnitOfMeasureTypePK();
327        UnitOfMeasureType entity = pk == null? null: UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(entityPermission, pk);
328        
329        return entity;
330    }
331    
332    public UnitOfMeasureType getUnitOfMeasureType() {
333        return getUnitOfMeasureType(EntityPermission.READ_ONLY);
334    }
335    
336    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
337        return getUnitOfMeasureType(EntityPermission.READ_WRITE);
338    }
339    
340    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
341            throws PersistenceNotNullException, PersistenceReadOnlyException {
342        checkReadWrite();
343        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
344    }
345    
346    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
347        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
348    }
349    
350    public boolean getUnitOfMeasureTypePKHasBeenModified() {
351        return _value.getUnitOfMeasureTypePKHasBeenModified();
352    }
353    
354    public Long getWeight() {
355        return _value.getWeight();
356    }
357    
358    public void setWeight(Long weight)
359            throws PersistenceNotNullException, PersistenceReadOnlyException {
360        checkReadWrite();
361        _value.setWeight(weight);
362    }
363    
364    public boolean getWeightHasBeenModified() {
365        return _value.getWeightHasBeenModified();
366    }
367    
368    public Long getFromTime() {
369        return _value.getFromTime();
370    }
371    
372    public void setFromTime(Long fromTime)
373            throws PersistenceNotNullException, PersistenceReadOnlyException {
374        checkReadWrite();
375        _value.setFromTime(fromTime);
376    }
377    
378    public boolean getFromTimeHasBeenModified() {
379        return _value.getFromTimeHasBeenModified();
380    }
381    
382    public Long getThruTime() {
383        return _value.getThruTime();
384    }
385    
386    public void setThruTime(Long thruTime)
387            throws PersistenceNotNullException, PersistenceReadOnlyException {
388        checkReadWrite();
389        _value.setThruTime(thruTime);
390    }
391    
392    public boolean getThruTimeHasBeenModified() {
393        return _value.getThruTimeHasBeenModified();
394    }
395    
396}