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 * InventoryTransactionLineDetail.java
021 */
022
023package com.echothree.model.data.inventory.server.entity;
024
025import com.echothree.model.data.inventory.common.pk.InventoryTransactionLineDetailPK;
026
027import com.echothree.model.data.inventory.common.pk.InventoryTransactionLinePK;
028import com.echothree.model.data.inventory.common.pk.InventoryTransactionPK;
029import com.echothree.model.data.inventory.common.pk.InventoryTransactionReasonPK;
030import com.echothree.model.data.item.common.pk.ItemPK;
031import com.echothree.model.data.inventory.common.pk.LotPK;
032import com.echothree.model.data.inventory.common.pk.InventoryAdjustmentTypePK;
033
034import com.echothree.model.data.inventory.server.entity.InventoryTransactionLine;
035import com.echothree.model.data.inventory.server.entity.InventoryTransaction;
036import com.echothree.model.data.inventory.server.entity.InventoryTransactionReason;
037import com.echothree.model.data.item.server.entity.Item;
038import com.echothree.model.data.inventory.server.entity.Lot;
039import com.echothree.model.data.inventory.server.entity.InventoryAdjustmentType;
040
041import com.echothree.model.data.inventory.server.factory.InventoryTransactionLineFactory;
042import com.echothree.model.data.inventory.server.factory.InventoryTransactionFactory;
043import com.echothree.model.data.inventory.server.factory.InventoryTransactionReasonFactory;
044import com.echothree.model.data.item.server.factory.ItemFactory;
045import com.echothree.model.data.inventory.server.factory.LotFactory;
046import com.echothree.model.data.inventory.server.factory.InventoryAdjustmentTypeFactory;
047
048import com.echothree.model.data.inventory.common.pk.InventoryTransactionLineDetailPK;
049
050import com.echothree.model.data.inventory.server.value.InventoryTransactionLineDetailValue;
051
052import com.echothree.model.data.inventory.server.factory.InventoryTransactionLineDetailFactory;
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
070import javax.annotation.Nonnull;
071import javax.annotation.Nullable;
072
073public class InventoryTransactionLineDetail
074        extends BaseEntity
075        implements Serializable {
076    
077    private InventoryTransactionLineDetailPK _pk;
078    private InventoryTransactionLineDetailValue _value;
079    
080    /** Creates a new instance of InventoryTransactionLineDetail */
081    public InventoryTransactionLineDetail()
082            throws PersistenceException {
083        super();
084    }
085    
086    /** Creates a new instance of InventoryTransactionLineDetail */
087    public InventoryTransactionLineDetail(InventoryTransactionLineDetailValue value, EntityPermission entityPermission) {
088        super(entityPermission);
089        
090        _value = value;
091        _pk = value.getPrimaryKey();
092    }
093    
094    @Override
095    @Nonnull
096    public InventoryTransactionLineDetailFactory getBaseFactoryInstance() {
097        return InventoryTransactionLineDetailFactory.getInstance();
098    }
099    
100    @Override
101    public boolean hasBeenModified() {
102        return _value.hasBeenModified();
103    }
104    
105    @Override
106    public int hashCode() {
107        return _pk.hashCode();
108    }
109    
110    @Override
111    @Nonnull
112    public String toString() {
113        return _pk.toString();
114    }
115    
116    @Override
117    public boolean equals(Object other) {
118        if(this == other)
119            return true;
120        
121        if(other instanceof InventoryTransactionLineDetail that) {
122            InventoryTransactionLineDetailValue thatValue = that.getInventoryTransactionLineDetailValue();
123            return _value.equals(thatValue);
124        } else {
125            return false;
126        }
127    }
128    
129    @Override
130    public void store()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().store(this);
133    }
134    
135    @Override
136    public void remove()
137            throws PersistenceDatabaseException {
138        getBaseFactoryInstance().remove(this);
139    }
140    
141    @Nonnull
142    public InventoryTransactionLineDetailValue getInventoryTransactionLineDetailValue() {
143        return _value;
144    }
145    
146    public void setInventoryTransactionLineDetailValue(@Nonnull InventoryTransactionLineDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    @Nonnull
154    public InventoryTransactionLineDetailPK getPrimaryKey() {
155        return _pk;
156    }
157    
158    @Nonnull
159    public InventoryTransactionLinePK getInventoryTransactionLinePK() {
160        return _value.getInventoryTransactionLinePK();
161    }
162    
163    @Nonnull
164    public InventoryTransactionLine getInventoryTransactionLine(EntityPermission entityPermission) {
165        return InventoryTransactionLineFactory.getInstance().getEntityFromPK(entityPermission, getInventoryTransactionLinePK());
166    }
167    
168    @Nonnull
169    public InventoryTransactionLine getInventoryTransactionLine() {
170        return getInventoryTransactionLine(EntityPermission.READ_ONLY);
171    }
172    
173    @Nonnull
174    public InventoryTransactionLine getInventoryTransactionLineForUpdate() {
175        return getInventoryTransactionLine(EntityPermission.READ_WRITE);
176    }
177    
178    public void setInventoryTransactionLinePK(@Nonnull InventoryTransactionLinePK inventoryTransactionLinePK)
179            throws PersistenceNotNullException, PersistenceReadOnlyException {
180        checkReadWrite();
181        _value.setInventoryTransactionLinePK(inventoryTransactionLinePK);
182    }
183    
184    public void setInventoryTransactionLine(@Nonnull InventoryTransactionLine entity) {
185        setInventoryTransactionLinePK(entity == null ? null : entity.getPrimaryKey());
186    }
187    
188    public boolean getInventoryTransactionLinePKHasBeenModified() {
189        return _value.getInventoryTransactionLinePKHasBeenModified();
190    }
191    
192    @Nonnull
193    public InventoryTransactionPK getInventoryTransactionPK() {
194        return _value.getInventoryTransactionPK();
195    }
196    
197    @Nonnull
198    public InventoryTransaction getInventoryTransaction(EntityPermission entityPermission) {
199        return InventoryTransactionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryTransactionPK());
200    }
201    
202    @Nonnull
203    public InventoryTransaction getInventoryTransaction() {
204        return getInventoryTransaction(EntityPermission.READ_ONLY);
205    }
206    
207    @Nonnull
208    public InventoryTransaction getInventoryTransactionForUpdate() {
209        return getInventoryTransaction(EntityPermission.READ_WRITE);
210    }
211    
212    public void setInventoryTransactionPK(@Nonnull InventoryTransactionPK inventoryTransactionPK)
213            throws PersistenceNotNullException, PersistenceReadOnlyException {
214        checkReadWrite();
215        _value.setInventoryTransactionPK(inventoryTransactionPK);
216    }
217    
218    public void setInventoryTransaction(@Nonnull InventoryTransaction entity) {
219        setInventoryTransactionPK(entity == null ? null : entity.getPrimaryKey());
220    }
221    
222    public boolean getInventoryTransactionPKHasBeenModified() {
223        return _value.getInventoryTransactionPKHasBeenModified();
224    }
225    
226    @Nonnull
227    public Integer getInventoryTransactionLineSequence() {
228        return _value.getInventoryTransactionLineSequence();
229    }
230    
231    public void setInventoryTransactionLineSequence(@Nonnull Integer inventoryTransactionLineSequence)
232            throws PersistenceNotNullException, PersistenceReadOnlyException {
233        checkReadWrite();
234        _value.setInventoryTransactionLineSequence(inventoryTransactionLineSequence);
235    }
236    
237    public boolean getInventoryTransactionLineSequenceHasBeenModified() {
238        return _value.getInventoryTransactionLineSequenceHasBeenModified();
239    }
240    
241    @Nullable
242    public InventoryTransactionReasonPK getInventoryTransactionReasonPK() {
243        return _value.getInventoryTransactionReasonPK();
244    }
245    
246    @Nullable
247    public InventoryTransactionReason getInventoryTransactionReason(EntityPermission entityPermission) {
248        InventoryTransactionReasonPK pk = getInventoryTransactionReasonPK();
249        InventoryTransactionReason entity = pk == null? null: InventoryTransactionReasonFactory.getInstance().getEntityFromPK(entityPermission, pk);
250        
251        return entity;
252    }
253    
254    @Nullable
255    public InventoryTransactionReason getInventoryTransactionReason() {
256        return getInventoryTransactionReason(EntityPermission.READ_ONLY);
257    }
258    
259    @Nullable
260    public InventoryTransactionReason getInventoryTransactionReasonForUpdate() {
261        return getInventoryTransactionReason(EntityPermission.READ_WRITE);
262    }
263    
264    public void setInventoryTransactionReasonPK(@Nullable InventoryTransactionReasonPK inventoryTransactionReasonPK)
265            throws PersistenceNotNullException, PersistenceReadOnlyException {
266        checkReadWrite();
267        _value.setInventoryTransactionReasonPK(inventoryTransactionReasonPK);
268    }
269    
270    public void setInventoryTransactionReason(@Nullable InventoryTransactionReason entity) {
271        setInventoryTransactionReasonPK(entity == null ? null : entity.getPrimaryKey());
272    }
273    
274    public boolean getInventoryTransactionReasonPKHasBeenModified() {
275        return _value.getInventoryTransactionReasonPKHasBeenModified();
276    }
277    
278    @Nonnull
279    public ItemPK getItemPK() {
280        return _value.getItemPK();
281    }
282    
283    @Nonnull
284    public Item getItem(EntityPermission entityPermission) {
285        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
286    }
287    
288    @Nonnull
289    public Item getItem() {
290        return getItem(EntityPermission.READ_ONLY);
291    }
292    
293    @Nonnull
294    public Item getItemForUpdate() {
295        return getItem(EntityPermission.READ_WRITE);
296    }
297    
298    public void setItemPK(@Nonnull ItemPK itemPK)
299            throws PersistenceNotNullException, PersistenceReadOnlyException {
300        checkReadWrite();
301        _value.setItemPK(itemPK);
302    }
303    
304    public void setItem(@Nonnull Item entity) {
305        setItemPK(entity == null ? null : entity.getPrimaryKey());
306    }
307    
308    public boolean getItemPKHasBeenModified() {
309        return _value.getItemPKHasBeenModified();
310    }
311    
312    @Nullable
313    public LotPK getLotPK() {
314        return _value.getLotPK();
315    }
316    
317    @Nullable
318    public Lot getLot(EntityPermission entityPermission) {
319        LotPK pk = getLotPK();
320        Lot entity = pk == null? null: LotFactory.getInstance().getEntityFromPK(entityPermission, pk);
321        
322        return entity;
323    }
324    
325    @Nullable
326    public Lot getLot() {
327        return getLot(EntityPermission.READ_ONLY);
328    }
329    
330    @Nullable
331    public Lot getLotForUpdate() {
332        return getLot(EntityPermission.READ_WRITE);
333    }
334    
335    public void setLotPK(@Nullable LotPK lotPK)
336            throws PersistenceNotNullException, PersistenceReadOnlyException {
337        checkReadWrite();
338        _value.setLotPK(lotPK);
339    }
340    
341    public void setLot(@Nullable Lot entity) {
342        setLotPK(entity == null ? null : entity.getPrimaryKey());
343    }
344    
345    public boolean getLotPKHasBeenModified() {
346        return _value.getLotPKHasBeenModified();
347    }
348    
349    @Nonnull
350    public InventoryAdjustmentTypePK getInventoryAdjustmentTypePK() {
351        return _value.getInventoryAdjustmentTypePK();
352    }
353    
354    @Nonnull
355    public InventoryAdjustmentType getInventoryAdjustmentType(EntityPermission entityPermission) {
356        return InventoryAdjustmentTypeFactory.getInstance().getEntityFromPK(entityPermission, getInventoryAdjustmentTypePK());
357    }
358    
359    @Nonnull
360    public InventoryAdjustmentType getInventoryAdjustmentType() {
361        return getInventoryAdjustmentType(EntityPermission.READ_ONLY);
362    }
363    
364    @Nonnull
365    public InventoryAdjustmentType getInventoryAdjustmentTypeForUpdate() {
366        return getInventoryAdjustmentType(EntityPermission.READ_WRITE);
367    }
368    
369    public void setInventoryAdjustmentTypePK(@Nonnull InventoryAdjustmentTypePK inventoryAdjustmentTypePK)
370            throws PersistenceNotNullException, PersistenceReadOnlyException {
371        checkReadWrite();
372        _value.setInventoryAdjustmentTypePK(inventoryAdjustmentTypePK);
373    }
374    
375    public void setInventoryAdjustmentType(@Nonnull InventoryAdjustmentType entity) {
376        setInventoryAdjustmentTypePK(entity == null ? null : entity.getPrimaryKey());
377    }
378    
379    public boolean getInventoryAdjustmentTypePKHasBeenModified() {
380        return _value.getInventoryAdjustmentTypePKHasBeenModified();
381    }
382    
383    @Nullable
384    public Long getUnitAmount() {
385        return _value.getUnitAmount();
386    }
387    
388    public void setUnitAmount(@Nullable Long unitAmount)
389            throws PersistenceNotNullException, PersistenceReadOnlyException {
390        checkReadWrite();
391        _value.setUnitAmount(unitAmount);
392    }
393    
394    public boolean getUnitAmountHasBeenModified() {
395        return _value.getUnitAmountHasBeenModified();
396    }
397    
398    @Nullable
399    public String getDescription() {
400        return _value.getDescription();
401    }
402    
403    public void setDescription(@Nullable String description)
404            throws PersistenceNotNullException, PersistenceReadOnlyException {
405        checkReadWrite();
406        _value.setDescription(description);
407    }
408    
409    public boolean getDescriptionHasBeenModified() {
410        return _value.getDescriptionHasBeenModified();
411    }
412    
413    @Nonnull
414    public Long getFromTime() {
415        return _value.getFromTime();
416    }
417    
418    public void setFromTime(@Nonnull 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    @Nonnull
429    public Long getThruTime() {
430        return _value.getThruTime();
431    }
432    
433    public void setThruTime(@Nonnull Long thruTime)
434            throws PersistenceNotNullException, PersistenceReadOnlyException {
435        checkReadWrite();
436        _value.setThruTime(thruTime);
437    }
438    
439    public boolean getThruTimeHasBeenModified() {
440        return _value.getThruTimeHasBeenModified();
441    }
442    
443}