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