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 * OrderShipmentGroupDetail.java
021 */
022
023package com.echothree.model.data.order.server.entity;
024
025import com.echothree.model.data.order.common.pk.OrderShipmentGroupDetailPK;
026
027import com.echothree.model.data.order.common.pk.OrderShipmentGroupPK;
028import com.echothree.model.data.order.common.pk.OrderPK;
029import com.echothree.model.data.item.common.pk.ItemDeliveryTypePK;
030import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
031import com.echothree.model.data.shipping.common.pk.ShippingMethodPK;
032
033import com.echothree.model.data.order.server.entity.OrderShipmentGroup;
034import com.echothree.model.data.order.server.entity.Order;
035import com.echothree.model.data.item.server.entity.ItemDeliveryType;
036import com.echothree.model.data.contact.server.entity.PartyContactMechanism;
037import com.echothree.model.data.shipping.server.entity.ShippingMethod;
038
039import com.echothree.model.data.order.server.factory.OrderShipmentGroupFactory;
040import com.echothree.model.data.order.server.factory.OrderFactory;
041import com.echothree.model.data.item.server.factory.ItemDeliveryTypeFactory;
042import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory;
043import com.echothree.model.data.shipping.server.factory.ShippingMethodFactory;
044
045import com.echothree.model.data.order.common.pk.OrderShipmentGroupDetailPK;
046
047import com.echothree.model.data.order.server.value.OrderShipmentGroupDetailValue;
048
049import com.echothree.model.data.order.server.factory.OrderShipmentGroupDetailFactory;
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 OrderShipmentGroupDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private OrderShipmentGroupDetailPK _pk;
075    private OrderShipmentGroupDetailValue _value;
076    
077    /** Creates a new instance of OrderShipmentGroupDetail */
078    public OrderShipmentGroupDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of OrderShipmentGroupDetail */
084    public OrderShipmentGroupDetail(OrderShipmentGroupDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    @Nonnull
093    public OrderShipmentGroupDetailFactory getBaseFactoryInstance() {
094        return OrderShipmentGroupDetailFactory.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 OrderShipmentGroupDetail that) {
119            OrderShipmentGroupDetailValue thatValue = that.getOrderShipmentGroupDetailValue();
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 OrderShipmentGroupDetailValue getOrderShipmentGroupDetailValue() {
140        return _value;
141    }
142    
143    public void setOrderShipmentGroupDetailValue(@Nonnull OrderShipmentGroupDetailValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    @Nonnull
151    public OrderShipmentGroupDetailPK getPrimaryKey() {
152        return _pk;
153    }
154    
155    @Nonnull
156    public OrderShipmentGroupPK getOrderShipmentGroupPK() {
157        return _value.getOrderShipmentGroupPK();
158    }
159    
160    @Nonnull
161    public OrderShipmentGroup getOrderShipmentGroup(EntityPermission entityPermission) {
162        return OrderShipmentGroupFactory.getInstance().getEntityFromPK(entityPermission, getOrderShipmentGroupPK());
163    }
164    
165    @Nonnull
166    public OrderShipmentGroup getOrderShipmentGroup() {
167        return getOrderShipmentGroup(EntityPermission.READ_ONLY);
168    }
169    
170    @Nonnull
171    public OrderShipmentGroup getOrderShipmentGroupForUpdate() {
172        return getOrderShipmentGroup(EntityPermission.READ_WRITE);
173    }
174    
175    public void setOrderShipmentGroupPK(@Nonnull OrderShipmentGroupPK orderShipmentGroupPK)
176            throws PersistenceNotNullException, PersistenceReadOnlyException {
177        checkReadWrite();
178        _value.setOrderShipmentGroupPK(orderShipmentGroupPK);
179    }
180    
181    public void setOrderShipmentGroup(@Nonnull OrderShipmentGroup entity) {
182        setOrderShipmentGroupPK(entity == null ? null : entity.getPrimaryKey());
183    }
184    
185    public boolean getOrderShipmentGroupPKHasBeenModified() {
186        return _value.getOrderShipmentGroupPKHasBeenModified();
187    }
188    
189    @Nonnull
190    public OrderPK getOrderPK() {
191        return _value.getOrderPK();
192    }
193    
194    @Nonnull
195    public Order getOrder(EntityPermission entityPermission) {
196        return OrderFactory.getInstance().getEntityFromPK(entityPermission, getOrderPK());
197    }
198    
199    @Nonnull
200    public Order getOrder() {
201        return getOrder(EntityPermission.READ_ONLY);
202    }
203    
204    @Nonnull
205    public Order getOrderForUpdate() {
206        return getOrder(EntityPermission.READ_WRITE);
207    }
208    
209    public void setOrderPK(@Nonnull OrderPK orderPK)
210            throws PersistenceNotNullException, PersistenceReadOnlyException {
211        checkReadWrite();
212        _value.setOrderPK(orderPK);
213    }
214    
215    public void setOrder(@Nonnull Order entity) {
216        setOrderPK(entity == null ? null : entity.getPrimaryKey());
217    }
218    
219    public boolean getOrderPKHasBeenModified() {
220        return _value.getOrderPKHasBeenModified();
221    }
222    
223    @Nonnull
224    public Integer getOrderShipmentGroupSequence() {
225        return _value.getOrderShipmentGroupSequence();
226    }
227    
228    public void setOrderShipmentGroupSequence(@Nonnull Integer orderShipmentGroupSequence)
229            throws PersistenceNotNullException, PersistenceReadOnlyException {
230        checkReadWrite();
231        _value.setOrderShipmentGroupSequence(orderShipmentGroupSequence);
232    }
233    
234    public boolean getOrderShipmentGroupSequenceHasBeenModified() {
235        return _value.getOrderShipmentGroupSequenceHasBeenModified();
236    }
237    
238    @Nonnull
239    public ItemDeliveryTypePK getItemDeliveryTypePK() {
240        return _value.getItemDeliveryTypePK();
241    }
242    
243    @Nonnull
244    public ItemDeliveryType getItemDeliveryType(EntityPermission entityPermission) {
245        return ItemDeliveryTypeFactory.getInstance().getEntityFromPK(entityPermission, getItemDeliveryTypePK());
246    }
247    
248    @Nonnull
249    public ItemDeliveryType getItemDeliveryType() {
250        return getItemDeliveryType(EntityPermission.READ_ONLY);
251    }
252    
253    @Nonnull
254    public ItemDeliveryType getItemDeliveryTypeForUpdate() {
255        return getItemDeliveryType(EntityPermission.READ_WRITE);
256    }
257    
258    public void setItemDeliveryTypePK(@Nonnull ItemDeliveryTypePK itemDeliveryTypePK)
259            throws PersistenceNotNullException, PersistenceReadOnlyException {
260        checkReadWrite();
261        _value.setItemDeliveryTypePK(itemDeliveryTypePK);
262    }
263    
264    public void setItemDeliveryType(@Nonnull ItemDeliveryType entity) {
265        setItemDeliveryTypePK(entity == null ? null : entity.getPrimaryKey());
266    }
267    
268    public boolean getItemDeliveryTypePKHasBeenModified() {
269        return _value.getItemDeliveryTypePKHasBeenModified();
270    }
271    
272    @Nonnull
273    public Boolean getIsDefault() {
274        return _value.getIsDefault();
275    }
276    
277    public void setIsDefault(@Nonnull Boolean isDefault)
278            throws PersistenceNotNullException, PersistenceReadOnlyException {
279        checkReadWrite();
280        _value.setIsDefault(isDefault);
281    }
282    
283    public boolean getIsDefaultHasBeenModified() {
284        return _value.getIsDefaultHasBeenModified();
285    }
286    
287    @Nullable
288    public PartyContactMechanismPK getPartyContactMechanismPK() {
289        return _value.getPartyContactMechanismPK();
290    }
291    
292    @Nullable
293    public PartyContactMechanism getPartyContactMechanism(EntityPermission entityPermission) {
294        PartyContactMechanismPK pk = getPartyContactMechanismPK();
295        PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk);
296        
297        return entity;
298    }
299    
300    @Nullable
301    public PartyContactMechanism getPartyContactMechanism() {
302        return getPartyContactMechanism(EntityPermission.READ_ONLY);
303    }
304    
305    @Nullable
306    public PartyContactMechanism getPartyContactMechanismForUpdate() {
307        return getPartyContactMechanism(EntityPermission.READ_WRITE);
308    }
309    
310    public void setPartyContactMechanismPK(@Nullable PartyContactMechanismPK partyContactMechanismPK)
311            throws PersistenceNotNullException, PersistenceReadOnlyException {
312        checkReadWrite();
313        _value.setPartyContactMechanismPK(partyContactMechanismPK);
314    }
315    
316    public void setPartyContactMechanism(@Nullable PartyContactMechanism entity) {
317        setPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
318    }
319    
320    public boolean getPartyContactMechanismPKHasBeenModified() {
321        return _value.getPartyContactMechanismPKHasBeenModified();
322    }
323    
324    @Nullable
325    public ShippingMethodPK getShippingMethodPK() {
326        return _value.getShippingMethodPK();
327    }
328    
329    @Nullable
330    public ShippingMethod getShippingMethod(EntityPermission entityPermission) {
331        ShippingMethodPK pk = getShippingMethodPK();
332        ShippingMethod entity = pk == null? null: ShippingMethodFactory.getInstance().getEntityFromPK(entityPermission, pk);
333        
334        return entity;
335    }
336    
337    @Nullable
338    public ShippingMethod getShippingMethod() {
339        return getShippingMethod(EntityPermission.READ_ONLY);
340    }
341    
342    @Nullable
343    public ShippingMethod getShippingMethodForUpdate() {
344        return getShippingMethod(EntityPermission.READ_WRITE);
345    }
346    
347    public void setShippingMethodPK(@Nullable ShippingMethodPK shippingMethodPK)
348            throws PersistenceNotNullException, PersistenceReadOnlyException {
349        checkReadWrite();
350        _value.setShippingMethodPK(shippingMethodPK);
351    }
352    
353    public void setShippingMethod(@Nullable ShippingMethod entity) {
354        setShippingMethodPK(entity == null ? null : entity.getPrimaryKey());
355    }
356    
357    public boolean getShippingMethodPKHasBeenModified() {
358        return _value.getShippingMethodPKHasBeenModified();
359    }
360    
361    @Nullable
362    public Boolean getHoldUntilComplete() {
363        return _value.getHoldUntilComplete();
364    }
365    
366    public void setHoldUntilComplete(@Nullable Boolean holdUntilComplete)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setHoldUntilComplete(holdUntilComplete);
370    }
371    
372    public boolean getHoldUntilCompleteHasBeenModified() {
373        return _value.getHoldUntilCompleteHasBeenModified();
374    }
375    
376    @Nonnull
377    public Long getFromTime() {
378        return _value.getFromTime();
379    }
380    
381    public void setFromTime(@Nonnull Long fromTime)
382            throws PersistenceNotNullException, PersistenceReadOnlyException {
383        checkReadWrite();
384        _value.setFromTime(fromTime);
385    }
386    
387    public boolean getFromTimeHasBeenModified() {
388        return _value.getFromTimeHasBeenModified();
389    }
390    
391    @Nonnull
392    public Long getThruTime() {
393        return _value.getThruTime();
394    }
395    
396    public void setThruTime(@Nonnull Long thruTime)
397            throws PersistenceNotNullException, PersistenceReadOnlyException {
398        checkReadWrite();
399        _value.setThruTime(thruTime);
400    }
401    
402    public boolean getThruTimeHasBeenModified() {
403        return _value.getThruTimeHasBeenModified();
404    }
405    
406}