001// --------------------------------------------------------------------------------
002// Copyright 2002-2024 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) {
114            OrderShipmentGroupDetail that = (OrderShipmentGroupDetail)other;
115            
116            OrderShipmentGroupDetailValue thatValue = that.getOrderShipmentGroupDetailValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store(Session session)
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(session, this);
127    }
128    
129    @Override
130    public void remove(Session session)
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(session, this);
133    }
134    
135    @Override
136    public void remove()
137            throws PersistenceDatabaseException {
138        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
139    }
140    
141    public OrderShipmentGroupDetailValue getOrderShipmentGroupDetailValue() {
142        return _value;
143    }
144    
145    public void setOrderShipmentGroupDetailValue(OrderShipmentGroupDetailValue value)
146            throws PersistenceReadOnlyException {
147        checkReadWrite();
148        _value = value;
149    }
150    
151    @Override
152    public OrderShipmentGroupDetailPK getPrimaryKey() {
153        return _pk;
154    }
155    
156    public OrderShipmentGroupPK getOrderShipmentGroupPK() {
157        return _value.getOrderShipmentGroupPK();
158    }
159    
160    public OrderShipmentGroup getOrderShipmentGroup(Session session, EntityPermission entityPermission) {
161        return OrderShipmentGroupFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderShipmentGroupPK());
162    }
163    
164    public OrderShipmentGroup getOrderShipmentGroup(EntityPermission entityPermission) {
165        return getOrderShipmentGroup(ThreadSession.currentSession(), entityPermission);
166    }
167    
168    public OrderShipmentGroup getOrderShipmentGroup(Session session) {
169        return getOrderShipmentGroup(session, EntityPermission.READ_ONLY);
170    }
171    
172    public OrderShipmentGroup getOrderShipmentGroup() {
173        return getOrderShipmentGroup(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
174    }
175    
176    public OrderShipmentGroup getOrderShipmentGroupForUpdate(Session session) {
177        return getOrderShipmentGroup(session, EntityPermission.READ_WRITE);
178    }
179    
180    public OrderShipmentGroup getOrderShipmentGroupForUpdate() {
181        return getOrderShipmentGroup(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
182    }
183    
184    public void setOrderShipmentGroupPK(OrderShipmentGroupPK orderShipmentGroupPK)
185            throws PersistenceNotNullException, PersistenceReadOnlyException {
186        checkReadWrite();
187        _value.setOrderShipmentGroupPK(orderShipmentGroupPK);
188    }
189    
190    public void setOrderShipmentGroup(OrderShipmentGroup entity) {
191        setOrderShipmentGroupPK(entity == null? null: entity.getPrimaryKey());
192    }
193    
194    public boolean getOrderShipmentGroupPKHasBeenModified() {
195        return _value.getOrderShipmentGroupPKHasBeenModified();
196    }
197    
198    public OrderPK getOrderPK() {
199        return _value.getOrderPK();
200    }
201    
202    public Order getOrder(Session session, EntityPermission entityPermission) {
203        return OrderFactory.getInstance().getEntityFromPK(session, entityPermission, getOrderPK());
204    }
205    
206    public Order getOrder(EntityPermission entityPermission) {
207        return getOrder(ThreadSession.currentSession(), entityPermission);
208    }
209    
210    public Order getOrder(Session session) {
211        return getOrder(session, EntityPermission.READ_ONLY);
212    }
213    
214    public Order getOrder() {
215        return getOrder(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
216    }
217    
218    public Order getOrderForUpdate(Session session) {
219        return getOrder(session, EntityPermission.READ_WRITE);
220    }
221    
222    public Order getOrderForUpdate() {
223        return getOrder(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
224    }
225    
226    public void setOrderPK(OrderPK orderPK)
227            throws PersistenceNotNullException, PersistenceReadOnlyException {
228        checkReadWrite();
229        _value.setOrderPK(orderPK);
230    }
231    
232    public void setOrder(Order entity) {
233        setOrderPK(entity == null? null: entity.getPrimaryKey());
234    }
235    
236    public boolean getOrderPKHasBeenModified() {
237        return _value.getOrderPKHasBeenModified();
238    }
239    
240    public Integer getOrderShipmentGroupSequence() {
241        return _value.getOrderShipmentGroupSequence();
242    }
243    
244    public void setOrderShipmentGroupSequence(Integer orderShipmentGroupSequence)
245            throws PersistenceNotNullException, PersistenceReadOnlyException {
246        checkReadWrite();
247        _value.setOrderShipmentGroupSequence(orderShipmentGroupSequence);
248    }
249    
250    public boolean getOrderShipmentGroupSequenceHasBeenModified() {
251        return _value.getOrderShipmentGroupSequenceHasBeenModified();
252    }
253    
254    public ItemDeliveryTypePK getItemDeliveryTypePK() {
255        return _value.getItemDeliveryTypePK();
256    }
257    
258    public ItemDeliveryType getItemDeliveryType(Session session, EntityPermission entityPermission) {
259        return ItemDeliveryTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getItemDeliveryTypePK());
260    }
261    
262    public ItemDeliveryType getItemDeliveryType(EntityPermission entityPermission) {
263        return getItemDeliveryType(ThreadSession.currentSession(), entityPermission);
264    }
265    
266    public ItemDeliveryType getItemDeliveryType(Session session) {
267        return getItemDeliveryType(session, EntityPermission.READ_ONLY);
268    }
269    
270    public ItemDeliveryType getItemDeliveryType() {
271        return getItemDeliveryType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
272    }
273    
274    public ItemDeliveryType getItemDeliveryTypeForUpdate(Session session) {
275        return getItemDeliveryType(session, EntityPermission.READ_WRITE);
276    }
277    
278    public ItemDeliveryType getItemDeliveryTypeForUpdate() {
279        return getItemDeliveryType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
280    }
281    
282    public void setItemDeliveryTypePK(ItemDeliveryTypePK itemDeliveryTypePK)
283            throws PersistenceNotNullException, PersistenceReadOnlyException {
284        checkReadWrite();
285        _value.setItemDeliveryTypePK(itemDeliveryTypePK);
286    }
287    
288    public void setItemDeliveryType(ItemDeliveryType entity) {
289        setItemDeliveryTypePK(entity == null? null: entity.getPrimaryKey());
290    }
291    
292    public boolean getItemDeliveryTypePKHasBeenModified() {
293        return _value.getItemDeliveryTypePKHasBeenModified();
294    }
295    
296    public Boolean getIsDefault() {
297        return _value.getIsDefault();
298    }
299    
300    public void setIsDefault(Boolean isDefault)
301            throws PersistenceNotNullException, PersistenceReadOnlyException {
302        checkReadWrite();
303        _value.setIsDefault(isDefault);
304    }
305    
306    public boolean getIsDefaultHasBeenModified() {
307        return _value.getIsDefaultHasBeenModified();
308    }
309    
310    public PartyContactMechanismPK getPartyContactMechanismPK() {
311        return _value.getPartyContactMechanismPK();
312    }
313    
314    public PartyContactMechanism getPartyContactMechanism(Session session, EntityPermission entityPermission) {
315        PartyContactMechanismPK pk = getPartyContactMechanismPK();
316        PartyContactMechanism entity = pk == null? null: PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
317        
318        return entity;
319    }
320    
321    public PartyContactMechanism getPartyContactMechanism(EntityPermission entityPermission) {
322        return getPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
323    }
324    
325    public PartyContactMechanism getPartyContactMechanism(Session session) {
326        return getPartyContactMechanism(session, EntityPermission.READ_ONLY);
327    }
328    
329    public PartyContactMechanism getPartyContactMechanism() {
330        return getPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
331    }
332    
333    public PartyContactMechanism getPartyContactMechanismForUpdate(Session session) {
334        return getPartyContactMechanism(session, EntityPermission.READ_WRITE);
335    }
336    
337    public PartyContactMechanism getPartyContactMechanismForUpdate() {
338        return getPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
339    }
340    
341    public void setPartyContactMechanismPK(PartyContactMechanismPK partyContactMechanismPK)
342            throws PersistenceNotNullException, PersistenceReadOnlyException {
343        checkReadWrite();
344        _value.setPartyContactMechanismPK(partyContactMechanismPK);
345    }
346    
347    public void setPartyContactMechanism(PartyContactMechanism entity) {
348        setPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
349    }
350    
351    public boolean getPartyContactMechanismPKHasBeenModified() {
352        return _value.getPartyContactMechanismPKHasBeenModified();
353    }
354    
355    public ShippingMethodPK getShippingMethodPK() {
356        return _value.getShippingMethodPK();
357    }
358    
359    public ShippingMethod getShippingMethod(Session session, EntityPermission entityPermission) {
360        ShippingMethodPK pk = getShippingMethodPK();
361        ShippingMethod entity = pk == null? null: ShippingMethodFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
362        
363        return entity;
364    }
365    
366    public ShippingMethod getShippingMethod(EntityPermission entityPermission) {
367        return getShippingMethod(ThreadSession.currentSession(), entityPermission);
368    }
369    
370    public ShippingMethod getShippingMethod(Session session) {
371        return getShippingMethod(session, EntityPermission.READ_ONLY);
372    }
373    
374    public ShippingMethod getShippingMethod() {
375        return getShippingMethod(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
376    }
377    
378    public ShippingMethod getShippingMethodForUpdate(Session session) {
379        return getShippingMethod(session, EntityPermission.READ_WRITE);
380    }
381    
382    public ShippingMethod getShippingMethodForUpdate() {
383        return getShippingMethod(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
384    }
385    
386    public void setShippingMethodPK(ShippingMethodPK shippingMethodPK)
387            throws PersistenceNotNullException, PersistenceReadOnlyException {
388        checkReadWrite();
389        _value.setShippingMethodPK(shippingMethodPK);
390    }
391    
392    public void setShippingMethod(ShippingMethod entity) {
393        setShippingMethodPK(entity == null? null: entity.getPrimaryKey());
394    }
395    
396    public boolean getShippingMethodPKHasBeenModified() {
397        return _value.getShippingMethodPKHasBeenModified();
398    }
399    
400    public Boolean getHoldUntilComplete() {
401        return _value.getHoldUntilComplete();
402    }
403    
404    public void setHoldUntilComplete(Boolean holdUntilComplete)
405            throws PersistenceNotNullException, PersistenceReadOnlyException {
406        checkReadWrite();
407        _value.setHoldUntilComplete(holdUntilComplete);
408    }
409    
410    public boolean getHoldUntilCompleteHasBeenModified() {
411        return _value.getHoldUntilCompleteHasBeenModified();
412    }
413    
414    public Long getFromTime() {
415        return _value.getFromTime();
416    }
417    
418    public void setFromTime(Long fromTime)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setFromTime(fromTime);
422    }
423    
424    public boolean getFromTimeHasBeenModified() {
425        return _value.getFromTimeHasBeenModified();
426    }
427    
428    public Long getThruTime() {
429        return _value.getThruTime();
430    }
431    
432    public void setThruTime(Long thruTime)
433            throws PersistenceNotNullException, PersistenceReadOnlyException {
434        checkReadWrite();
435        _value.setThruTime(thruTime);
436    }
437    
438    public boolean getThruTimeHasBeenModified() {
439        return _value.getThruTimeHasBeenModified();
440    }
441    
442}