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 * 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(Session session)
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(session, this);
125    }
126    
127    @Override
128    public void remove(Session session)
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(session, this);
131    }
132    
133    @Override
134    public void remove()
135            throws PersistenceDatabaseException {
136        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
137    }
138    
139    public ShipmentPackageDetailValue getShipmentPackageDetailValue() {
140        return _value;
141    }
142    
143    public void setShipmentPackageDetailValue(ShipmentPackageDetailValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    public ShipmentPackageDetailPK getPrimaryKey() {
151        return _pk;
152    }
153    
154    public ShipmentPackagePK getShipmentPackagePK() {
155        return _value.getShipmentPackagePK();
156    }
157    
158    public ShipmentPackage getShipmentPackage(Session session, EntityPermission entityPermission) {
159        return ShipmentPackageFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPackagePK());
160    }
161    
162    public ShipmentPackage getShipmentPackage(EntityPermission entityPermission) {
163        return getShipmentPackage(ThreadSession.currentSession(), entityPermission);
164    }
165    
166    public ShipmentPackage getShipmentPackage(Session session) {
167        return getShipmentPackage(session, EntityPermission.READ_ONLY);
168    }
169    
170    public ShipmentPackage getShipmentPackage() {
171        return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
172    }
173    
174    public ShipmentPackage getShipmentPackageForUpdate(Session session) {
175        return getShipmentPackage(session, EntityPermission.READ_WRITE);
176    }
177    
178    public ShipmentPackage getShipmentPackageForUpdate() {
179        return getShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
180    }
181    
182    public void setShipmentPackagePK(ShipmentPackagePK shipmentPackagePK)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setShipmentPackagePK(shipmentPackagePK);
186    }
187    
188    public void setShipmentPackage(ShipmentPackage entity) {
189        setShipmentPackagePK(entity == null? null: entity.getPrimaryKey());
190    }
191    
192    public boolean getShipmentPackagePKHasBeenModified() {
193        return _value.getShipmentPackagePKHasBeenModified();
194    }
195    
196    public ShipmentTypePK getShipmentTypePK() {
197        return _value.getShipmentTypePK();
198    }
199    
200    public ShipmentType getShipmentType(Session session, EntityPermission entityPermission) {
201        return ShipmentTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentTypePK());
202    }
203    
204    public ShipmentType getShipmentType(EntityPermission entityPermission) {
205        return getShipmentType(ThreadSession.currentSession(), entityPermission);
206    }
207    
208    public ShipmentType getShipmentType(Session session) {
209        return getShipmentType(session, EntityPermission.READ_ONLY);
210    }
211    
212    public ShipmentType getShipmentType() {
213        return getShipmentType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
214    }
215    
216    public ShipmentType getShipmentTypeForUpdate(Session session) {
217        return getShipmentType(session, EntityPermission.READ_WRITE);
218    }
219    
220    public ShipmentType getShipmentTypeForUpdate() {
221        return getShipmentType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
222    }
223    
224    public void setShipmentTypePK(ShipmentTypePK shipmentTypePK)
225            throws PersistenceNotNullException, PersistenceReadOnlyException {
226        checkReadWrite();
227        _value.setShipmentTypePK(shipmentTypePK);
228    }
229    
230    public void setShipmentType(ShipmentType entity) {
231        setShipmentTypePK(entity == null? null: entity.getPrimaryKey());
232    }
233    
234    public boolean getShipmentTypePKHasBeenModified() {
235        return _value.getShipmentTypePKHasBeenModified();
236    }
237    
238    public String getShipmentPackageName() {
239        return _value.getShipmentPackageName();
240    }
241    
242    public void setShipmentPackageName(String shipmentPackageName)
243            throws PersistenceNotNullException, PersistenceReadOnlyException {
244        checkReadWrite();
245        _value.setShipmentPackageName(shipmentPackageName);
246    }
247    
248    public boolean getShipmentPackageNameHasBeenModified() {
249        return _value.getShipmentPackageNameHasBeenModified();
250    }
251    
252    public ShipmentPackagePK getParentShipmentPackagePK() {
253        return _value.getParentShipmentPackagePK();
254    }
255    
256    public ShipmentPackage getParentShipmentPackage(Session session, EntityPermission entityPermission) {
257        ShipmentPackagePK pk = getParentShipmentPackagePK();
258        ShipmentPackage entity = pk == null? null: ShipmentPackageFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
259        
260        return entity;
261    }
262    
263    public ShipmentPackage getParentShipmentPackage(EntityPermission entityPermission) {
264        return getParentShipmentPackage(ThreadSession.currentSession(), entityPermission);
265    }
266    
267    public ShipmentPackage getParentShipmentPackage(Session session) {
268        return getParentShipmentPackage(session, EntityPermission.READ_ONLY);
269    }
270    
271    public ShipmentPackage getParentShipmentPackage() {
272        return getParentShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
273    }
274    
275    public ShipmentPackage getParentShipmentPackageForUpdate(Session session) {
276        return getParentShipmentPackage(session, EntityPermission.READ_WRITE);
277    }
278    
279    public ShipmentPackage getParentShipmentPackageForUpdate() {
280        return getParentShipmentPackage(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
281    }
282    
283    public void setParentShipmentPackagePK(ShipmentPackagePK parentShipmentPackagePK)
284            throws PersistenceNotNullException, PersistenceReadOnlyException {
285        checkReadWrite();
286        _value.setParentShipmentPackagePK(parentShipmentPackagePK);
287    }
288    
289    public void setParentShipmentPackage(ShipmentPackage entity) {
290        setParentShipmentPackagePK(entity == null? null: entity.getPrimaryKey());
291    }
292    
293    public boolean getParentShipmentPackagePKHasBeenModified() {
294        return _value.getParentShipmentPackagePKHasBeenModified();
295    }
296    
297    public ShipmentPK getShipmentPK() {
298        return _value.getShipmentPK();
299    }
300    
301    public Shipment getShipment(Session session, EntityPermission entityPermission) {
302        ShipmentPK pk = getShipmentPK();
303        Shipment entity = pk == null? null: ShipmentFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
304        
305        return entity;
306    }
307    
308    public Shipment getShipment(EntityPermission entityPermission) {
309        return getShipment(ThreadSession.currentSession(), entityPermission);
310    }
311    
312    public Shipment getShipment(Session session) {
313        return getShipment(session, EntityPermission.READ_ONLY);
314    }
315    
316    public Shipment getShipment() {
317        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
318    }
319    
320    public Shipment getShipmentForUpdate(Session session) {
321        return getShipment(session, EntityPermission.READ_WRITE);
322    }
323    
324    public Shipment getShipmentForUpdate() {
325        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
326    }
327    
328    public void setShipmentPK(ShipmentPK shipmentPK)
329            throws PersistenceNotNullException, PersistenceReadOnlyException {
330        checkReadWrite();
331        _value.setShipmentPK(shipmentPK);
332    }
333    
334    public void setShipment(Shipment entity) {
335        setShipmentPK(entity == null? null: entity.getPrimaryKey());
336    }
337    
338    public boolean getShipmentPKHasBeenModified() {
339        return _value.getShipmentPKHasBeenModified();
340    }
341    
342    public PackageTypePK getPackageTypePK() {
343        return _value.getPackageTypePK();
344    }
345    
346    public PackageType getPackageType(Session session, EntityPermission entityPermission) {
347        PackageTypePK pk = getPackageTypePK();
348        PackageType entity = pk == null? null: PackageTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
349        
350        return entity;
351    }
352    
353    public PackageType getPackageType(EntityPermission entityPermission) {
354        return getPackageType(ThreadSession.currentSession(), entityPermission);
355    }
356    
357    public PackageType getPackageType(Session session) {
358        return getPackageType(session, EntityPermission.READ_ONLY);
359    }
360    
361    public PackageType getPackageType() {
362        return getPackageType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
363    }
364    
365    public PackageType getPackageTypeForUpdate(Session session) {
366        return getPackageType(session, EntityPermission.READ_WRITE);
367    }
368    
369    public PackageType getPackageTypeForUpdate() {
370        return getPackageType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
371    }
372    
373    public void setPackageTypePK(PackageTypePK packageTypePK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setPackageTypePK(packageTypePK);
377    }
378    
379    public void setPackageType(PackageType entity) {
380        setPackageTypePK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getPackageTypePKHasBeenModified() {
384        return _value.getPackageTypePKHasBeenModified();
385    }
386    
387    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
388        return _value.getUnitOfMeasureTypePK();
389    }
390    
391    public UnitOfMeasureType getUnitOfMeasureType(Session session, EntityPermission entityPermission) {
392        UnitOfMeasureTypePK pk = getUnitOfMeasureTypePK();
393        UnitOfMeasureType entity = pk == null? null: UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
394        
395        return entity;
396    }
397    
398    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
399        return getUnitOfMeasureType(ThreadSession.currentSession(), entityPermission);
400    }
401    
402    public UnitOfMeasureType getUnitOfMeasureType(Session session) {
403        return getUnitOfMeasureType(session, EntityPermission.READ_ONLY);
404    }
405    
406    public UnitOfMeasureType getUnitOfMeasureType() {
407        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
408    }
409    
410    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate(Session session) {
411        return getUnitOfMeasureType(session, EntityPermission.READ_WRITE);
412    }
413    
414    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
415        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
416    }
417    
418    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
422    }
423    
424    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
425        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
426    }
427    
428    public boolean getUnitOfMeasureTypePKHasBeenModified() {
429        return _value.getUnitOfMeasureTypePKHasBeenModified();
430    }
431    
432    public Long getWeight() {
433        return _value.getWeight();
434    }
435    
436    public void setWeight(Long weight)
437            throws PersistenceNotNullException, PersistenceReadOnlyException {
438        checkReadWrite();
439        _value.setWeight(weight);
440    }
441    
442    public boolean getWeightHasBeenModified() {
443        return _value.getWeightHasBeenModified();
444    }
445    
446    public Long getFromTime() {
447        return _value.getFromTime();
448    }
449    
450    public void setFromTime(Long fromTime)
451            throws PersistenceNotNullException, PersistenceReadOnlyException {
452        checkReadWrite();
453        _value.setFromTime(fromTime);
454    }
455    
456    public boolean getFromTimeHasBeenModified() {
457        return _value.getFromTimeHasBeenModified();
458    }
459    
460    public Long getThruTime() {
461        return _value.getThruTime();
462    }
463    
464    public void setThruTime(Long thruTime)
465            throws PersistenceNotNullException, PersistenceReadOnlyException {
466        checkReadWrite();
467        _value.setThruTime(thruTime);
468    }
469    
470    public boolean getThruTimeHasBeenModified() {
471        return _value.getThruTimeHasBeenModified();
472    }
473    
474}