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 * InventoryCostingPoolDetail.java
021 */
022
023package com.echothree.model.data.inventory.server.entity;
024
025import com.echothree.model.data.inventory.common.pk.InventoryCostingPoolDetailPK;
026
027import com.echothree.model.data.inventory.common.pk.InventoryCostingPoolPK;
028import com.echothree.model.data.party.common.pk.PartyPK;
029import com.echothree.model.data.item.common.pk.ItemPK;
030import com.echothree.model.data.inventory.common.pk.InventoryConditionPK;
031
032import com.echothree.model.data.inventory.server.entity.InventoryCostingPool;
033import com.echothree.model.data.party.server.entity.Party;
034import com.echothree.model.data.item.server.entity.Item;
035import com.echothree.model.data.inventory.server.entity.InventoryCondition;
036
037import com.echothree.model.data.inventory.server.factory.InventoryCostingPoolFactory;
038import com.echothree.model.data.party.server.factory.PartyFactory;
039import com.echothree.model.data.item.server.factory.ItemFactory;
040import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory;
041
042import com.echothree.model.data.inventory.common.pk.InventoryCostingPoolDetailPK;
043
044import com.echothree.model.data.inventory.server.value.InventoryCostingPoolDetailValue;
045
046import com.echothree.model.data.inventory.server.factory.InventoryCostingPoolDetailFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064import javax.annotation.Nonnull;
065import javax.annotation.Nullable;
066
067public class InventoryCostingPoolDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private InventoryCostingPoolDetailPK _pk;
072    private InventoryCostingPoolDetailValue _value;
073    
074    /** Creates a new instance of InventoryCostingPoolDetail */
075    public InventoryCostingPoolDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of InventoryCostingPoolDetail */
081    public InventoryCostingPoolDetail(InventoryCostingPoolDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    @Nonnull
090    public InventoryCostingPoolDetailFactory getBaseFactoryInstance() {
091        return InventoryCostingPoolDetailFactory.getInstance();
092    }
093    
094    @Override
095    public boolean hasBeenModified() {
096        return _value.hasBeenModified();
097    }
098    
099    @Override
100    public int hashCode() {
101        return _pk.hashCode();
102    }
103    
104    @Override
105    @Nonnull
106    public String toString() {
107        return _pk.toString();
108    }
109    
110    @Override
111    public boolean equals(Object other) {
112        if(this == other)
113            return true;
114        
115        if(other instanceof InventoryCostingPoolDetail that) {
116            InventoryCostingPoolDetailValue thatValue = that.getInventoryCostingPoolDetailValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store()
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(this);
133    }
134    
135    @Nonnull
136    public InventoryCostingPoolDetailValue getInventoryCostingPoolDetailValue() {
137        return _value;
138    }
139    
140    public void setInventoryCostingPoolDetailValue(@Nonnull InventoryCostingPoolDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    @Nonnull
148    public InventoryCostingPoolDetailPK getPrimaryKey() {
149        return _pk;
150    }
151    
152    @Nonnull
153    public InventoryCostingPoolPK getInventoryCostingPoolPK() {
154        return _value.getInventoryCostingPoolPK();
155    }
156    
157    @Nonnull
158    public InventoryCostingPool getInventoryCostingPool(EntityPermission entityPermission) {
159        return InventoryCostingPoolFactory.getInstance().getEntityFromPK(entityPermission, getInventoryCostingPoolPK());
160    }
161    
162    @Nonnull
163    public InventoryCostingPool getInventoryCostingPool() {
164        return getInventoryCostingPool(EntityPermission.READ_ONLY);
165    }
166    
167    @Nonnull
168    public InventoryCostingPool getInventoryCostingPoolForUpdate() {
169        return getInventoryCostingPool(EntityPermission.READ_WRITE);
170    }
171    
172    public void setInventoryCostingPoolPK(@Nonnull InventoryCostingPoolPK inventoryCostingPoolPK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setInventoryCostingPoolPK(inventoryCostingPoolPK);
176    }
177    
178    public void setInventoryCostingPool(@Nonnull InventoryCostingPool entity) {
179        setInventoryCostingPoolPK(entity == null ? null : entity.getPrimaryKey());
180    }
181    
182    public boolean getInventoryCostingPoolPKHasBeenModified() {
183        return _value.getInventoryCostingPoolPKHasBeenModified();
184    }
185    
186    @Nonnull
187    public String getInventoryCostingPoolName() {
188        return _value.getInventoryCostingPoolName();
189    }
190    
191    public void setInventoryCostingPoolName(@Nonnull String inventoryCostingPoolName)
192            throws PersistenceNotNullException, PersistenceReadOnlyException {
193        checkReadWrite();
194        _value.setInventoryCostingPoolName(inventoryCostingPoolName);
195    }
196    
197    public boolean getInventoryCostingPoolNameHasBeenModified() {
198        return _value.getInventoryCostingPoolNameHasBeenModified();
199    }
200    
201    @Nonnull
202    public PartyPK getCompanyPartyPK() {
203        return _value.getCompanyPartyPK();
204    }
205    
206    @Nonnull
207    public Party getCompanyParty(EntityPermission entityPermission) {
208        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getCompanyPartyPK());
209    }
210    
211    @Nonnull
212    public Party getCompanyParty() {
213        return getCompanyParty(EntityPermission.READ_ONLY);
214    }
215    
216    @Nonnull
217    public Party getCompanyPartyForUpdate() {
218        return getCompanyParty(EntityPermission.READ_WRITE);
219    }
220    
221    public void setCompanyPartyPK(@Nonnull PartyPK companyPartyPK)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setCompanyPartyPK(companyPartyPK);
225    }
226    
227    public void setCompanyParty(@Nonnull Party entity) {
228        setCompanyPartyPK(entity == null ? null : entity.getPrimaryKey());
229    }
230    
231    public boolean getCompanyPartyPKHasBeenModified() {
232        return _value.getCompanyPartyPKHasBeenModified();
233    }
234    
235    @Nonnull
236    public ItemPK getItemPK() {
237        return _value.getItemPK();
238    }
239    
240    @Nonnull
241    public Item getItem(EntityPermission entityPermission) {
242        return ItemFactory.getInstance().getEntityFromPK(entityPermission, getItemPK());
243    }
244    
245    @Nonnull
246    public Item getItem() {
247        return getItem(EntityPermission.READ_ONLY);
248    }
249    
250    @Nonnull
251    public Item getItemForUpdate() {
252        return getItem(EntityPermission.READ_WRITE);
253    }
254    
255    public void setItemPK(@Nonnull ItemPK itemPK)
256            throws PersistenceNotNullException, PersistenceReadOnlyException {
257        checkReadWrite();
258        _value.setItemPK(itemPK);
259    }
260    
261    public void setItem(@Nonnull Item entity) {
262        setItemPK(entity == null ? null : entity.getPrimaryKey());
263    }
264    
265    public boolean getItemPKHasBeenModified() {
266        return _value.getItemPKHasBeenModified();
267    }
268    
269    @Nonnull
270    public InventoryConditionPK getInventoryConditionPK() {
271        return _value.getInventoryConditionPK();
272    }
273    
274    @Nonnull
275    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
276        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
277    }
278    
279    @Nonnull
280    public InventoryCondition getInventoryCondition() {
281        return getInventoryCondition(EntityPermission.READ_ONLY);
282    }
283    
284    @Nonnull
285    public InventoryCondition getInventoryConditionForUpdate() {
286        return getInventoryCondition(EntityPermission.READ_WRITE);
287    }
288    
289    public void setInventoryConditionPK(@Nonnull InventoryConditionPK inventoryConditionPK)
290            throws PersistenceNotNullException, PersistenceReadOnlyException {
291        checkReadWrite();
292        _value.setInventoryConditionPK(inventoryConditionPK);
293    }
294    
295    public void setInventoryCondition(@Nonnull InventoryCondition entity) {
296        setInventoryConditionPK(entity == null ? null : entity.getPrimaryKey());
297    }
298    
299    public boolean getInventoryConditionPKHasBeenModified() {
300        return _value.getInventoryConditionPKHasBeenModified();
301    }
302    
303    @Nonnull
304    public Long getFromTime() {
305        return _value.getFromTime();
306    }
307    
308    public void setFromTime(@Nonnull Long fromTime)
309            throws PersistenceNotNullException, PersistenceReadOnlyException {
310        checkReadWrite();
311        _value.setFromTime(fromTime);
312    }
313    
314    public boolean getFromTimeHasBeenModified() {
315        return _value.getFromTimeHasBeenModified();
316    }
317    
318    @Nonnull
319    public Long getThruTime() {
320        return _value.getThruTime();
321    }
322    
323    public void setThruTime(@Nonnull Long thruTime)
324            throws PersistenceNotNullException, PersistenceReadOnlyException {
325        checkReadWrite();
326        _value.setThruTime(thruTime);
327    }
328    
329    public boolean getThruTimeHasBeenModified() {
330        return _value.getThruTimeHasBeenModified();
331    }
332    
333}