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 * ShipmentDetail.java
021 */
022
023package com.echothree.model.data.shipment.server.entity;
024
025import com.echothree.model.data.shipment.common.pk.ShipmentDetailPK;
026
027import com.echothree.model.data.shipment.common.pk.ShipmentPK;
028import com.echothree.model.data.shipment.common.pk.ShipmentTypePK;
029import com.echothree.model.data.party.common.pk.PartyPK;
030import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
031import com.echothree.model.data.shipping.common.pk.ShippingMethodPK;
032
033import com.echothree.model.data.shipment.server.entity.Shipment;
034import com.echothree.model.data.shipment.server.entity.ShipmentType;
035import com.echothree.model.data.party.server.entity.Party;
036import com.echothree.model.data.contact.server.entity.PartyContactMechanism;
037import com.echothree.model.data.shipping.server.entity.ShippingMethod;
038
039import com.echothree.model.data.shipment.server.factory.ShipmentFactory;
040import com.echothree.model.data.shipment.server.factory.ShipmentTypeFactory;
041import com.echothree.model.data.party.server.factory.PartyFactory;
042import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory;
043import com.echothree.model.data.shipping.server.factory.ShippingMethodFactory;
044
045import com.echothree.model.data.shipment.common.pk.ShipmentDetailPK;
046
047import com.echothree.model.data.shipment.server.value.ShipmentDetailValue;
048
049import com.echothree.model.data.shipment.server.factory.ShipmentDetailFactory;
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
067import javax.annotation.Nonnull;
068import javax.annotation.Nullable;
069
070public class ShipmentDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private ShipmentDetailPK _pk;
075    private ShipmentDetailValue _value;
076    
077    /** Creates a new instance of ShipmentDetail */
078    public ShipmentDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of ShipmentDetail */
084    public ShipmentDetail(ShipmentDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    @Nonnull
093    public ShipmentDetailFactory getBaseFactoryInstance() {
094        return ShipmentDetailFactory.getInstance();
095    }
096    
097    @Override
098    public boolean hasBeenModified() {
099        return _value.hasBeenModified();
100    }
101    
102    @Override
103    public int hashCode() {
104        return _pk.hashCode();
105    }
106    
107    @Override
108    @Nonnull
109    public String toString() {
110        return _pk.toString();
111    }
112    
113    @Override
114    public boolean equals(Object other) {
115        if(this == other)
116            return true;
117        
118        if(other instanceof ShipmentDetail that) {
119            ShipmentDetailValue thatValue = that.getShipmentDetailValue();
120            return _value.equals(thatValue);
121        } else {
122            return false;
123        }
124    }
125    
126    @Override
127    public void store()
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().store(this);
130    }
131    
132    @Override
133    public void remove()
134            throws PersistenceDatabaseException {
135        getBaseFactoryInstance().remove(this);
136    }
137    
138    @Nonnull
139    public ShipmentDetailValue getShipmentDetailValue() {
140        return _value;
141    }
142    
143    public void setShipmentDetailValue(@Nonnull ShipmentDetailValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    @Nonnull
151    public ShipmentDetailPK getPrimaryKey() {
152        return _pk;
153    }
154    
155    @Nonnull
156    public ShipmentPK getShipmentPK() {
157        return _value.getShipmentPK();
158    }
159    
160    @Nonnull
161    public Shipment getShipment(EntityPermission entityPermission) {
162        return ShipmentFactory.getInstance().getEntityFromPK(entityPermission, getShipmentPK());
163    }
164    
165    @Nonnull
166    public Shipment getShipment() {
167        return getShipment(EntityPermission.READ_ONLY);
168    }
169    
170    @Nonnull
171    public Shipment getShipmentForUpdate() {
172        return getShipment(EntityPermission.READ_WRITE);
173    }
174    
175    public void setShipmentPK(@Nonnull ShipmentPK shipmentPK)
176            throws PersistenceNotNullException, PersistenceReadOnlyException {
177        checkReadWrite();
178        _value.setShipmentPK(shipmentPK);
179    }
180    
181    public void setShipment(@Nonnull Shipment entity) {
182        setShipmentPK(entity == null ? null : entity.getPrimaryKey());
183    }
184    
185    public boolean getShipmentPKHasBeenModified() {
186        return _value.getShipmentPKHasBeenModified();
187    }
188    
189    @Nonnull
190    public ShipmentTypePK getShipmentTypePK() {
191        return _value.getShipmentTypePK();
192    }
193    
194    @Nonnull
195    public ShipmentType getShipmentType(EntityPermission entityPermission) {
196        return ShipmentTypeFactory.getInstance().getEntityFromPK(entityPermission, getShipmentTypePK());
197    }
198    
199    @Nonnull
200    public ShipmentType getShipmentType() {
201        return getShipmentType(EntityPermission.READ_ONLY);
202    }
203    
204    @Nonnull
205    public ShipmentType getShipmentTypeForUpdate() {
206        return getShipmentType(EntityPermission.READ_WRITE);
207    }
208    
209    public void setShipmentTypePK(@Nonnull ShipmentTypePK shipmentTypePK)
210            throws PersistenceNotNullException, PersistenceReadOnlyException {
211        checkReadWrite();
212        _value.setShipmentTypePK(shipmentTypePK);
213    }
214    
215    public void setShipmentType(@Nonnull ShipmentType entity) {
216        setShipmentTypePK(entity == null ? null : entity.getPrimaryKey());
217    }
218    
219    public boolean getShipmentTypePKHasBeenModified() {
220        return _value.getShipmentTypePKHasBeenModified();
221    }
222    
223    @Nonnull
224    public String getShipmentName() {
225        return _value.getShipmentName();
226    }
227    
228    public void setShipmentName(@Nonnull String shipmentName)
229            throws PersistenceNotNullException, PersistenceReadOnlyException {
230        checkReadWrite();
231        _value.setShipmentName(shipmentName);
232    }
233    
234    public boolean getShipmentNameHasBeenModified() {
235        return _value.getShipmentNameHasBeenModified();
236    }
237    
238    @Nonnull
239    public PartyPK getOriginPartyPK() {
240        return _value.getOriginPartyPK();
241    }
242    
243    @Nonnull
244    public Party getOriginParty(EntityPermission entityPermission) {
245        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getOriginPartyPK());
246    }
247    
248    @Nonnull
249    public Party getOriginParty() {
250        return getOriginParty(EntityPermission.READ_ONLY);
251    }
252    
253    @Nonnull
254    public Party getOriginPartyForUpdate() {
255        return getOriginParty(EntityPermission.READ_WRITE);
256    }
257    
258    public void setOriginPartyPK(@Nonnull PartyPK originPartyPK)
259            throws PersistenceNotNullException, PersistenceReadOnlyException {
260        checkReadWrite();
261        _value.setOriginPartyPK(originPartyPK);
262    }
263    
264    public void setOriginParty(@Nonnull Party entity) {
265        setOriginPartyPK(entity == null ? null : entity.getPrimaryKey());
266    }
267    
268    public boolean getOriginPartyPKHasBeenModified() {
269        return _value.getOriginPartyPKHasBeenModified();
270    }
271    
272    @Nullable
273    public PartyPK getOriginWarehousePartyPK() {
274        return _value.getOriginWarehousePartyPK();
275    }
276    
277    @Nullable
278    public Party getOriginWarehouseParty(EntityPermission entityPermission) {
279        PartyPK pk = getOriginWarehousePartyPK();
280        Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk);
281        
282        return entity;
283    }
284    
285    @Nullable
286    public Party getOriginWarehouseParty() {
287        return getOriginWarehouseParty(EntityPermission.READ_ONLY);
288    }
289    
290    @Nullable
291    public Party getOriginWarehousePartyForUpdate() {
292        return getOriginWarehouseParty(EntityPermission.READ_WRITE);
293    }
294    
295    public void setOriginWarehousePartyPK(@Nullable PartyPK originWarehousePartyPK)
296            throws PersistenceNotNullException, PersistenceReadOnlyException {
297        checkReadWrite();
298        _value.setOriginWarehousePartyPK(originWarehousePartyPK);
299    }
300    
301    public void setOriginWarehouseParty(@Nullable Party entity) {
302        setOriginWarehousePartyPK(entity == null ? null : entity.getPrimaryKey());
303    }
304    
305    public boolean getOriginWarehousePartyPKHasBeenModified() {
306        return _value.getOriginWarehousePartyPKHasBeenModified();
307    }
308    
309    @Nullable
310    public PartyContactMechanismPK getOriginPartyContactMechanismPK() {
311        return _value.getOriginPartyContactMechanismPK();
312    }
313    
314    @Nullable
315    public PartyContactMechanism getOriginPartyContactMechanism(EntityPermission entityPermission) {
316        PartyContactMechanismPK pk = getOriginPartyContactMechanismPK();
317        PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk);
318        
319        return entity;
320    }
321    
322    @Nullable
323    public PartyContactMechanism getOriginPartyContactMechanism() {
324        return getOriginPartyContactMechanism(EntityPermission.READ_ONLY);
325    }
326    
327    @Nullable
328    public PartyContactMechanism getOriginPartyContactMechanismForUpdate() {
329        return getOriginPartyContactMechanism(EntityPermission.READ_WRITE);
330    }
331    
332    public void setOriginPartyContactMechanismPK(@Nullable PartyContactMechanismPK originPartyContactMechanismPK)
333            throws PersistenceNotNullException, PersistenceReadOnlyException {
334        checkReadWrite();
335        _value.setOriginPartyContactMechanismPK(originPartyContactMechanismPK);
336    }
337    
338    public void setOriginPartyContactMechanism(@Nullable PartyContactMechanism entity) {
339        setOriginPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
340    }
341    
342    public boolean getOriginPartyContactMechanismPKHasBeenModified() {
343        return _value.getOriginPartyContactMechanismPKHasBeenModified();
344    }
345    
346    @Nonnull
347    public PartyPK getDestinationPartyPK() {
348        return _value.getDestinationPartyPK();
349    }
350    
351    @Nonnull
352    public Party getDestinationParty(EntityPermission entityPermission) {
353        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getDestinationPartyPK());
354    }
355    
356    @Nonnull
357    public Party getDestinationParty() {
358        return getDestinationParty(EntityPermission.READ_ONLY);
359    }
360    
361    @Nonnull
362    public Party getDestinationPartyForUpdate() {
363        return getDestinationParty(EntityPermission.READ_WRITE);
364    }
365    
366    public void setDestinationPartyPK(@Nonnull PartyPK destinationPartyPK)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setDestinationPartyPK(destinationPartyPK);
370    }
371    
372    public void setDestinationParty(@Nonnull Party entity) {
373        setDestinationPartyPK(entity == null ? null : entity.getPrimaryKey());
374    }
375    
376    public boolean getDestinationPartyPKHasBeenModified() {
377        return _value.getDestinationPartyPKHasBeenModified();
378    }
379    
380    @Nullable
381    public PartyPK getDestinationWarehousePartyPK() {
382        return _value.getDestinationWarehousePartyPK();
383    }
384    
385    @Nullable
386    public Party getDestinationWarehouseParty(EntityPermission entityPermission) {
387        PartyPK pk = getDestinationWarehousePartyPK();
388        Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk);
389        
390        return entity;
391    }
392    
393    @Nullable
394    public Party getDestinationWarehouseParty() {
395        return getDestinationWarehouseParty(EntityPermission.READ_ONLY);
396    }
397    
398    @Nullable
399    public Party getDestinationWarehousePartyForUpdate() {
400        return getDestinationWarehouseParty(EntityPermission.READ_WRITE);
401    }
402    
403    public void setDestinationWarehousePartyPK(@Nullable PartyPK destinationWarehousePartyPK)
404            throws PersistenceNotNullException, PersistenceReadOnlyException {
405        checkReadWrite();
406        _value.setDestinationWarehousePartyPK(destinationWarehousePartyPK);
407    }
408    
409    public void setDestinationWarehouseParty(@Nullable Party entity) {
410        setDestinationWarehousePartyPK(entity == null ? null : entity.getPrimaryKey());
411    }
412    
413    public boolean getDestinationWarehousePartyPKHasBeenModified() {
414        return _value.getDestinationWarehousePartyPKHasBeenModified();
415    }
416    
417    @Nullable
418    public PartyContactMechanismPK getDestinationPartyContactMechanismPK() {
419        return _value.getDestinationPartyContactMechanismPK();
420    }
421    
422    @Nullable
423    public PartyContactMechanism getDestinationPartyContactMechanism(EntityPermission entityPermission) {
424        PartyContactMechanismPK pk = getDestinationPartyContactMechanismPK();
425        PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk);
426        
427        return entity;
428    }
429    
430    @Nullable
431    public PartyContactMechanism getDestinationPartyContactMechanism() {
432        return getDestinationPartyContactMechanism(EntityPermission.READ_ONLY);
433    }
434    
435    @Nullable
436    public PartyContactMechanism getDestinationPartyContactMechanismForUpdate() {
437        return getDestinationPartyContactMechanism(EntityPermission.READ_WRITE);
438    }
439    
440    public void setDestinationPartyContactMechanismPK(@Nullable PartyContactMechanismPK destinationPartyContactMechanismPK)
441            throws PersistenceNotNullException, PersistenceReadOnlyException {
442        checkReadWrite();
443        _value.setDestinationPartyContactMechanismPK(destinationPartyContactMechanismPK);
444    }
445    
446    public void setDestinationPartyContactMechanism(@Nullable PartyContactMechanism entity) {
447        setDestinationPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
448    }
449    
450    public boolean getDestinationPartyContactMechanismPKHasBeenModified() {
451        return _value.getDestinationPartyContactMechanismPKHasBeenModified();
452    }
453    
454    @Nullable
455    public ShippingMethodPK getShippingMethodPK() {
456        return _value.getShippingMethodPK();
457    }
458    
459    @Nullable
460    public ShippingMethod getShippingMethod(EntityPermission entityPermission) {
461        ShippingMethodPK pk = getShippingMethodPK();
462        ShippingMethod entity = pk == null? null: ShippingMethodFactory.getInstance().getEntityFromPK(entityPermission, pk);
463        
464        return entity;
465    }
466    
467    @Nullable
468    public ShippingMethod getShippingMethod() {
469        return getShippingMethod(EntityPermission.READ_ONLY);
470    }
471    
472    @Nullable
473    public ShippingMethod getShippingMethodForUpdate() {
474        return getShippingMethod(EntityPermission.READ_WRITE);
475    }
476    
477    public void setShippingMethodPK(@Nullable ShippingMethodPK shippingMethodPK)
478            throws PersistenceNotNullException, PersistenceReadOnlyException {
479        checkReadWrite();
480        _value.setShippingMethodPK(shippingMethodPK);
481    }
482    
483    public void setShippingMethod(@Nullable ShippingMethod entity) {
484        setShippingMethodPK(entity == null ? null : entity.getPrimaryKey());
485    }
486    
487    public boolean getShippingMethodPKHasBeenModified() {
488        return _value.getShippingMethodPKHasBeenModified();
489    }
490    
491    @Nonnull
492    public Long getFromTime() {
493        return _value.getFromTime();
494    }
495    
496    public void setFromTime(@Nonnull Long fromTime)
497            throws PersistenceNotNullException, PersistenceReadOnlyException {
498        checkReadWrite();
499        _value.setFromTime(fromTime);
500    }
501    
502    public boolean getFromTimeHasBeenModified() {
503        return _value.getFromTimeHasBeenModified();
504    }
505    
506    @Nonnull
507    public Long getThruTime() {
508        return _value.getThruTime();
509    }
510    
511    public void setThruTime(@Nonnull Long thruTime)
512            throws PersistenceNotNullException, PersistenceReadOnlyException {
513        checkReadWrite();
514        _value.setThruTime(thruTime);
515    }
516    
517    public boolean getThruTimeHasBeenModified() {
518        return _value.getThruTimeHasBeenModified();
519    }
520    
521}