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 * ShipmentLineDetail.java
021 */
022
023package com.echothree.model.data.shipment.server.entity;
024
025import com.echothree.model.data.shipment.common.pk.ShipmentLineDetailPK;
026
027import com.echothree.model.data.shipment.common.pk.ShipmentLinePK;
028import com.echothree.model.data.shipment.common.pk.ShipmentPK;
029import com.echothree.model.data.order.common.pk.OrderLinePK;
030import com.echothree.model.data.item.common.pk.ItemPK;
031import com.echothree.model.data.inventory.common.pk.InventoryConditionPK;
032import com.echothree.model.data.uom.common.pk.UnitOfMeasureTypePK;
033
034import com.echothree.model.data.shipment.server.entity.ShipmentLine;
035import com.echothree.model.data.shipment.server.entity.Shipment;
036import com.echothree.model.data.order.server.entity.OrderLine;
037import com.echothree.model.data.item.server.entity.Item;
038import com.echothree.model.data.inventory.server.entity.InventoryCondition;
039import com.echothree.model.data.uom.server.entity.UnitOfMeasureType;
040
041import com.echothree.model.data.shipment.server.factory.ShipmentLineFactory;
042import com.echothree.model.data.shipment.server.factory.ShipmentFactory;
043import com.echothree.model.data.order.server.factory.OrderLineFactory;
044import com.echothree.model.data.item.server.factory.ItemFactory;
045import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory;
046import com.echothree.model.data.uom.server.factory.UnitOfMeasureTypeFactory;
047
048import com.echothree.model.data.shipment.common.pk.ShipmentLineDetailPK;
049
050import com.echothree.model.data.shipment.server.value.ShipmentLineDetailValue;
051
052import com.echothree.model.data.shipment.server.factory.ShipmentLineDetailFactory;
053
054import com.echothree.util.common.exception.PersistenceException;
055import com.echothree.util.common.exception.PersistenceDatabaseException;
056import com.echothree.util.common.exception.PersistenceNotNullException;
057import com.echothree.util.common.exception.PersistenceReadOnlyException;
058
059import com.echothree.util.common.persistence.BasePK;
060
061import com.echothree.util.common.persistence.type.ByteArray;
062
063import com.echothree.util.server.persistence.BaseEntity;
064import com.echothree.util.server.persistence.EntityPermission;
065import com.echothree.util.server.persistence.Session;
066import com.echothree.util.server.persistence.ThreadSession;
067
068import java.io.Serializable;
069
070public class ShipmentLineDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private ShipmentLineDetailPK _pk;
075    private ShipmentLineDetailValue _value;
076    
077    /** Creates a new instance of ShipmentLineDetail */
078    public ShipmentLineDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of ShipmentLineDetail */
084    public ShipmentLineDetail(ShipmentLineDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    public ShipmentLineDetailFactory getBaseFactoryInstance() {
093        return ShipmentLineDetailFactory.getInstance();
094    }
095    
096    @Override
097    public boolean hasBeenModified() {
098        return _value.hasBeenModified();
099    }
100    
101    @Override
102    public int hashCode() {
103        return _pk.hashCode();
104    }
105    
106    @Override
107    public String toString() {
108        return _pk.toString();
109    }
110    
111    @Override
112    public boolean equals(Object other) {
113        if(this == other)
114            return true;
115        
116        if(other instanceof ShipmentLineDetail) {
117            ShipmentLineDetail that = (ShipmentLineDetail)other;
118            
119            ShipmentLineDetailValue thatValue = that.getShipmentLineDetailValue();
120            return _value.equals(thatValue);
121        } else {
122            return false;
123        }
124    }
125    
126    @Override
127    public void store(Session session)
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().store(session, this);
130    }
131    
132    @Override
133    public void remove(Session session)
134            throws PersistenceDatabaseException {
135        getBaseFactoryInstance().remove(session, this);
136    }
137    
138    @Override
139    public void remove()
140            throws PersistenceDatabaseException {
141        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
142    }
143    
144    public ShipmentLineDetailValue getShipmentLineDetailValue() {
145        return _value;
146    }
147    
148    public void setShipmentLineDetailValue(ShipmentLineDetailValue value)
149            throws PersistenceReadOnlyException {
150        checkReadWrite();
151        _value = value;
152    }
153    
154    @Override
155    public ShipmentLineDetailPK getPrimaryKey() {
156        return _pk;
157    }
158    
159    public ShipmentLinePK getShipmentLinePK() {
160        return _value.getShipmentLinePK();
161    }
162    
163    public ShipmentLine getShipmentLine(Session session, EntityPermission entityPermission) {
164        return ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentLinePK());
165    }
166    
167    public ShipmentLine getShipmentLine(EntityPermission entityPermission) {
168        return getShipmentLine(ThreadSession.currentSession(), entityPermission);
169    }
170    
171    public ShipmentLine getShipmentLine(Session session) {
172        return getShipmentLine(session, EntityPermission.READ_ONLY);
173    }
174    
175    public ShipmentLine getShipmentLine() {
176        return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
177    }
178    
179    public ShipmentLine getShipmentLineForUpdate(Session session) {
180        return getShipmentLine(session, EntityPermission.READ_WRITE);
181    }
182    
183    public ShipmentLine getShipmentLineForUpdate() {
184        return getShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
185    }
186    
187    public void setShipmentLinePK(ShipmentLinePK shipmentLinePK)
188            throws PersistenceNotNullException, PersistenceReadOnlyException {
189        checkReadWrite();
190        _value.setShipmentLinePK(shipmentLinePK);
191    }
192    
193    public void setShipmentLine(ShipmentLine entity) {
194        setShipmentLinePK(entity == null? null: entity.getPrimaryKey());
195    }
196    
197    public boolean getShipmentLinePKHasBeenModified() {
198        return _value.getShipmentLinePKHasBeenModified();
199    }
200    
201    public ShipmentPK getShipmentPK() {
202        return _value.getShipmentPK();
203    }
204    
205    public Shipment getShipment(Session session, EntityPermission entityPermission) {
206        return ShipmentFactory.getInstance().getEntityFromPK(session, entityPermission, getShipmentPK());
207    }
208    
209    public Shipment getShipment(EntityPermission entityPermission) {
210        return getShipment(ThreadSession.currentSession(), entityPermission);
211    }
212    
213    public Shipment getShipment(Session session) {
214        return getShipment(session, EntityPermission.READ_ONLY);
215    }
216    
217    public Shipment getShipment() {
218        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
219    }
220    
221    public Shipment getShipmentForUpdate(Session session) {
222        return getShipment(session, EntityPermission.READ_WRITE);
223    }
224    
225    public Shipment getShipmentForUpdate() {
226        return getShipment(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
227    }
228    
229    public void setShipmentPK(ShipmentPK shipmentPK)
230            throws PersistenceNotNullException, PersistenceReadOnlyException {
231        checkReadWrite();
232        _value.setShipmentPK(shipmentPK);
233    }
234    
235    public void setShipment(Shipment entity) {
236        setShipmentPK(entity == null? null: entity.getPrimaryKey());
237    }
238    
239    public boolean getShipmentPKHasBeenModified() {
240        return _value.getShipmentPKHasBeenModified();
241    }
242    
243    public Integer getShipmentLineSequence() {
244        return _value.getShipmentLineSequence();
245    }
246    
247    public void setShipmentLineSequence(Integer shipmentLineSequence)
248            throws PersistenceNotNullException, PersistenceReadOnlyException {
249        checkReadWrite();
250        _value.setShipmentLineSequence(shipmentLineSequence);
251    }
252    
253    public boolean getShipmentLineSequenceHasBeenModified() {
254        return _value.getShipmentLineSequenceHasBeenModified();
255    }
256    
257    public ShipmentLinePK getParentShipmentLinePK() {
258        return _value.getParentShipmentLinePK();
259    }
260    
261    public ShipmentLine getParentShipmentLine(Session session, EntityPermission entityPermission) {
262        ShipmentLinePK pk = getParentShipmentLinePK();
263        ShipmentLine entity = pk == null? null: ShipmentLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
264        
265        return entity;
266    }
267    
268    public ShipmentLine getParentShipmentLine(EntityPermission entityPermission) {
269        return getParentShipmentLine(ThreadSession.currentSession(), entityPermission);
270    }
271    
272    public ShipmentLine getParentShipmentLine(Session session) {
273        return getParentShipmentLine(session, EntityPermission.READ_ONLY);
274    }
275    
276    public ShipmentLine getParentShipmentLine() {
277        return getParentShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
278    }
279    
280    public ShipmentLine getParentShipmentLineForUpdate(Session session) {
281        return getParentShipmentLine(session, EntityPermission.READ_WRITE);
282    }
283    
284    public ShipmentLine getParentShipmentLineForUpdate() {
285        return getParentShipmentLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
286    }
287    
288    public void setParentShipmentLinePK(ShipmentLinePK parentShipmentLinePK)
289            throws PersistenceNotNullException, PersistenceReadOnlyException {
290        checkReadWrite();
291        _value.setParentShipmentLinePK(parentShipmentLinePK);
292    }
293    
294    public void setParentShipmentLine(ShipmentLine entity) {
295        setParentShipmentLinePK(entity == null? null: entity.getPrimaryKey());
296    }
297    
298    public boolean getParentShipmentLinePKHasBeenModified() {
299        return _value.getParentShipmentLinePKHasBeenModified();
300    }
301    
302    public OrderLinePK getOrderLinePK() {
303        return _value.getOrderLinePK();
304    }
305    
306    public OrderLine getOrderLine(Session session, EntityPermission entityPermission) {
307        OrderLinePK pk = getOrderLinePK();
308        OrderLine entity = pk == null? null: OrderLineFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
309        
310        return entity;
311    }
312    
313    public OrderLine getOrderLine(EntityPermission entityPermission) {
314        return getOrderLine(ThreadSession.currentSession(), entityPermission);
315    }
316    
317    public OrderLine getOrderLine(Session session) {
318        return getOrderLine(session, EntityPermission.READ_ONLY);
319    }
320    
321    public OrderLine getOrderLine() {
322        return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
323    }
324    
325    public OrderLine getOrderLineForUpdate(Session session) {
326        return getOrderLine(session, EntityPermission.READ_WRITE);
327    }
328    
329    public OrderLine getOrderLineForUpdate() {
330        return getOrderLine(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
331    }
332    
333    public void setOrderLinePK(OrderLinePK orderLinePK)
334            throws PersistenceNotNullException, PersistenceReadOnlyException {
335        checkReadWrite();
336        _value.setOrderLinePK(orderLinePK);
337    }
338    
339    public void setOrderLine(OrderLine entity) {
340        setOrderLinePK(entity == null? null: entity.getPrimaryKey());
341    }
342    
343    public boolean getOrderLinePKHasBeenModified() {
344        return _value.getOrderLinePKHasBeenModified();
345    }
346    
347    public ItemPK getItemPK() {
348        return _value.getItemPK();
349    }
350    
351    public Item getItem(Session session, EntityPermission entityPermission) {
352        return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK());
353    }
354    
355    public Item getItem(EntityPermission entityPermission) {
356        return getItem(ThreadSession.currentSession(), entityPermission);
357    }
358    
359    public Item getItem(Session session) {
360        return getItem(session, EntityPermission.READ_ONLY);
361    }
362    
363    public Item getItem() {
364        return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
365    }
366    
367    public Item getItemForUpdate(Session session) {
368        return getItem(session, EntityPermission.READ_WRITE);
369    }
370    
371    public Item getItemForUpdate() {
372        return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
373    }
374    
375    public void setItemPK(ItemPK itemPK)
376            throws PersistenceNotNullException, PersistenceReadOnlyException {
377        checkReadWrite();
378        _value.setItemPK(itemPK);
379    }
380    
381    public void setItem(Item entity) {
382        setItemPK(entity == null? null: entity.getPrimaryKey());
383    }
384    
385    public boolean getItemPKHasBeenModified() {
386        return _value.getItemPKHasBeenModified();
387    }
388    
389    public InventoryConditionPK getInventoryConditionPK() {
390        return _value.getInventoryConditionPK();
391    }
392    
393    public InventoryCondition getInventoryCondition(Session session, EntityPermission entityPermission) {
394        return InventoryConditionFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryConditionPK());
395    }
396    
397    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
398        return getInventoryCondition(ThreadSession.currentSession(), entityPermission);
399    }
400    
401    public InventoryCondition getInventoryCondition(Session session) {
402        return getInventoryCondition(session, EntityPermission.READ_ONLY);
403    }
404    
405    public InventoryCondition getInventoryCondition() {
406        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
407    }
408    
409    public InventoryCondition getInventoryConditionForUpdate(Session session) {
410        return getInventoryCondition(session, EntityPermission.READ_WRITE);
411    }
412    
413    public InventoryCondition getInventoryConditionForUpdate() {
414        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
415    }
416    
417    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
418            throws PersistenceNotNullException, PersistenceReadOnlyException {
419        checkReadWrite();
420        _value.setInventoryConditionPK(inventoryConditionPK);
421    }
422    
423    public void setInventoryCondition(InventoryCondition entity) {
424        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
425    }
426    
427    public boolean getInventoryConditionPKHasBeenModified() {
428        return _value.getInventoryConditionPKHasBeenModified();
429    }
430    
431    public UnitOfMeasureTypePK getUnitOfMeasureTypePK() {
432        return _value.getUnitOfMeasureTypePK();
433    }
434    
435    public UnitOfMeasureType getUnitOfMeasureType(Session session, EntityPermission entityPermission) {
436        return UnitOfMeasureTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getUnitOfMeasureTypePK());
437    }
438    
439    public UnitOfMeasureType getUnitOfMeasureType(EntityPermission entityPermission) {
440        return getUnitOfMeasureType(ThreadSession.currentSession(), entityPermission);
441    }
442    
443    public UnitOfMeasureType getUnitOfMeasureType(Session session) {
444        return getUnitOfMeasureType(session, EntityPermission.READ_ONLY);
445    }
446    
447    public UnitOfMeasureType getUnitOfMeasureType() {
448        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
449    }
450    
451    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate(Session session) {
452        return getUnitOfMeasureType(session, EntityPermission.READ_WRITE);
453    }
454    
455    public UnitOfMeasureType getUnitOfMeasureTypeForUpdate() {
456        return getUnitOfMeasureType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
457    }
458    
459    public void setUnitOfMeasureTypePK(UnitOfMeasureTypePK unitOfMeasureTypePK)
460            throws PersistenceNotNullException, PersistenceReadOnlyException {
461        checkReadWrite();
462        _value.setUnitOfMeasureTypePK(unitOfMeasureTypePK);
463    }
464    
465    public void setUnitOfMeasureType(UnitOfMeasureType entity) {
466        setUnitOfMeasureTypePK(entity == null? null: entity.getPrimaryKey());
467    }
468    
469    public boolean getUnitOfMeasureTypePKHasBeenModified() {
470        return _value.getUnitOfMeasureTypePKHasBeenModified();
471    }
472    
473    public Long getQuantity() {
474        return _value.getQuantity();
475    }
476    
477    public void setQuantity(Long quantity)
478            throws PersistenceNotNullException, PersistenceReadOnlyException {
479        checkReadWrite();
480        _value.setQuantity(quantity);
481    }
482    
483    public boolean getQuantityHasBeenModified() {
484        return _value.getQuantityHasBeenModified();
485    }
486    
487    public Long getFromTime() {
488        return _value.getFromTime();
489    }
490    
491    public void setFromTime(Long fromTime)
492            throws PersistenceNotNullException, PersistenceReadOnlyException {
493        checkReadWrite();
494        _value.setFromTime(fromTime);
495    }
496    
497    public boolean getFromTimeHasBeenModified() {
498        return _value.getFromTimeHasBeenModified();
499    }
500    
501    public Long getThruTime() {
502        return _value.getThruTime();
503    }
504    
505    public void setThruTime(Long thruTime)
506            throws PersistenceNotNullException, PersistenceReadOnlyException {
507        checkReadWrite();
508        _value.setThruTime(thruTime);
509    }
510    
511    public boolean getThruTimeHasBeenModified() {
512        return _value.getThruTimeHasBeenModified();
513    }
514    
515}