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 * InventoryConditionGlAccount.java
021 */
022
023package com.echothree.model.data.inventory.server.entity;
024
025import com.echothree.model.data.inventory.common.pk.InventoryConditionGlAccountPK;
026
027import com.echothree.model.data.inventory.common.pk.InventoryConditionPK;
028import com.echothree.model.data.accounting.common.pk.ItemAccountingCategoryPK;
029import com.echothree.model.data.accounting.common.pk.GlAccountPK;
030
031import com.echothree.model.data.inventory.server.entity.InventoryCondition;
032import com.echothree.model.data.accounting.server.entity.ItemAccountingCategory;
033import com.echothree.model.data.accounting.server.entity.GlAccount;
034
035import com.echothree.model.data.inventory.server.factory.InventoryConditionFactory;
036import com.echothree.model.data.accounting.server.factory.ItemAccountingCategoryFactory;
037import com.echothree.model.data.accounting.server.factory.GlAccountFactory;
038
039import com.echothree.model.data.inventory.common.pk.InventoryConditionGlAccountPK;
040
041import com.echothree.model.data.inventory.server.value.InventoryConditionGlAccountValue;
042
043import com.echothree.model.data.inventory.server.factory.InventoryConditionGlAccountFactory;
044
045import com.echothree.util.common.exception.PersistenceException;
046import com.echothree.util.common.exception.PersistenceDatabaseException;
047import com.echothree.util.common.exception.PersistenceNotNullException;
048import com.echothree.util.common.exception.PersistenceReadOnlyException;
049
050import com.echothree.util.common.persistence.BasePK;
051
052import com.echothree.util.common.persistence.type.ByteArray;
053
054import com.echothree.util.server.persistence.BaseEntity;
055import com.echothree.util.server.persistence.EntityPermission;
056import com.echothree.util.server.persistence.Session;
057import com.echothree.util.server.persistence.ThreadSession;
058
059import java.io.Serializable;
060
061public class InventoryConditionGlAccount
062        extends BaseEntity
063        implements Serializable {
064    
065    private InventoryConditionGlAccountPK _pk;
066    private InventoryConditionGlAccountValue _value;
067    
068    /** Creates a new instance of InventoryConditionGlAccount */
069    public InventoryConditionGlAccount()
070            throws PersistenceException {
071        super();
072    }
073    
074    /** Creates a new instance of InventoryConditionGlAccount */
075    public InventoryConditionGlAccount(InventoryConditionGlAccountValue value, EntityPermission entityPermission) {
076        super(entityPermission);
077        
078        _value = value;
079        _pk = value.getPrimaryKey();
080    }
081    
082    @Override
083    public InventoryConditionGlAccountFactory getBaseFactoryInstance() {
084        return InventoryConditionGlAccountFactory.getInstance();
085    }
086    
087    @Override
088    public boolean hasBeenModified() {
089        return _value.hasBeenModified();
090    }
091    
092    @Override
093    public int hashCode() {
094        return _pk.hashCode();
095    }
096    
097    @Override
098    public String toString() {
099        return _pk.toString();
100    }
101    
102    @Override
103    public boolean equals(Object other) {
104        if(this == other)
105            return true;
106        
107        if(other instanceof InventoryConditionGlAccount that) {
108            InventoryConditionGlAccountValue thatValue = that.getInventoryConditionGlAccountValue();
109            return _value.equals(thatValue);
110        } else {
111            return false;
112        }
113    }
114    
115    @Override
116    public void store()
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().store(this);
119    }
120    
121    @Override
122    public void remove()
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().remove(this);
125    }
126    
127    public InventoryConditionGlAccountValue getInventoryConditionGlAccountValue() {
128        return _value;
129    }
130    
131    public void setInventoryConditionGlAccountValue(InventoryConditionGlAccountValue value)
132            throws PersistenceReadOnlyException {
133        checkReadWrite();
134        _value = value;
135    }
136    
137    @Override
138    public InventoryConditionGlAccountPK getPrimaryKey() {
139        return _pk;
140    }
141    
142    public InventoryConditionPK getInventoryConditionPK() {
143        return _value.getInventoryConditionPK();
144    }
145    
146    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
147        return InventoryConditionFactory.getInstance().getEntityFromPK(entityPermission, getInventoryConditionPK());
148    }
149    
150    public InventoryCondition getInventoryCondition() {
151        return getInventoryCondition(EntityPermission.READ_ONLY);
152    }
153    
154    public InventoryCondition getInventoryConditionForUpdate() {
155        return getInventoryCondition(EntityPermission.READ_WRITE);
156    }
157    
158    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
159            throws PersistenceNotNullException, PersistenceReadOnlyException {
160        checkReadWrite();
161        _value.setInventoryConditionPK(inventoryConditionPK);
162    }
163    
164    public void setInventoryCondition(InventoryCondition entity) {
165        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
166    }
167    
168    public boolean getInventoryConditionPKHasBeenModified() {
169        return _value.getInventoryConditionPKHasBeenModified();
170    }
171    
172    public ItemAccountingCategoryPK getItemAccountingCategoryPK() {
173        return _value.getItemAccountingCategoryPK();
174    }
175    
176    public ItemAccountingCategory getItemAccountingCategory(EntityPermission entityPermission) {
177        return ItemAccountingCategoryFactory.getInstance().getEntityFromPK(entityPermission, getItemAccountingCategoryPK());
178    }
179    
180    public ItemAccountingCategory getItemAccountingCategory() {
181        return getItemAccountingCategory(EntityPermission.READ_ONLY);
182    }
183    
184    public ItemAccountingCategory getItemAccountingCategoryForUpdate() {
185        return getItemAccountingCategory(EntityPermission.READ_WRITE);
186    }
187    
188    public void setItemAccountingCategoryPK(ItemAccountingCategoryPK itemAccountingCategoryPK)
189            throws PersistenceNotNullException, PersistenceReadOnlyException {
190        checkReadWrite();
191        _value.setItemAccountingCategoryPK(itemAccountingCategoryPK);
192    }
193    
194    public void setItemAccountingCategory(ItemAccountingCategory entity) {
195        setItemAccountingCategoryPK(entity == null? null: entity.getPrimaryKey());
196    }
197    
198    public boolean getItemAccountingCategoryPKHasBeenModified() {
199        return _value.getItemAccountingCategoryPKHasBeenModified();
200    }
201    
202    public GlAccountPK getInventoryGlAccountPK() {
203        return _value.getInventoryGlAccountPK();
204    }
205    
206    public GlAccount getInventoryGlAccount(EntityPermission entityPermission) {
207        GlAccountPK pk = getInventoryGlAccountPK();
208        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
209        
210        return entity;
211    }
212    
213    public GlAccount getInventoryGlAccount() {
214        return getInventoryGlAccount(EntityPermission.READ_ONLY);
215    }
216    
217    public GlAccount getInventoryGlAccountForUpdate() {
218        return getInventoryGlAccount(EntityPermission.READ_WRITE);
219    }
220    
221    public void setInventoryGlAccountPK(GlAccountPK inventoryGlAccountPK)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setInventoryGlAccountPK(inventoryGlAccountPK);
225    }
226    
227    public void setInventoryGlAccount(GlAccount entity) {
228        setInventoryGlAccountPK(entity == null? null: entity.getPrimaryKey());
229    }
230    
231    public boolean getInventoryGlAccountPKHasBeenModified() {
232        return _value.getInventoryGlAccountPKHasBeenModified();
233    }
234    
235    public GlAccountPK getSalesGlAccountPK() {
236        return _value.getSalesGlAccountPK();
237    }
238    
239    public GlAccount getSalesGlAccount(EntityPermission entityPermission) {
240        GlAccountPK pk = getSalesGlAccountPK();
241        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
242        
243        return entity;
244    }
245    
246    public GlAccount getSalesGlAccount() {
247        return getSalesGlAccount(EntityPermission.READ_ONLY);
248    }
249    
250    public GlAccount getSalesGlAccountForUpdate() {
251        return getSalesGlAccount(EntityPermission.READ_WRITE);
252    }
253    
254    public void setSalesGlAccountPK(GlAccountPK salesGlAccountPK)
255            throws PersistenceNotNullException, PersistenceReadOnlyException {
256        checkReadWrite();
257        _value.setSalesGlAccountPK(salesGlAccountPK);
258    }
259    
260    public void setSalesGlAccount(GlAccount entity) {
261        setSalesGlAccountPK(entity == null? null: entity.getPrimaryKey());
262    }
263    
264    public boolean getSalesGlAccountPKHasBeenModified() {
265        return _value.getSalesGlAccountPKHasBeenModified();
266    }
267    
268    public GlAccountPK getReturnsGlAccountPK() {
269        return _value.getReturnsGlAccountPK();
270    }
271    
272    public GlAccount getReturnsGlAccount(EntityPermission entityPermission) {
273        GlAccountPK pk = getReturnsGlAccountPK();
274        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
275        
276        return entity;
277    }
278    
279    public GlAccount getReturnsGlAccount() {
280        return getReturnsGlAccount(EntityPermission.READ_ONLY);
281    }
282    
283    public GlAccount getReturnsGlAccountForUpdate() {
284        return getReturnsGlAccount(EntityPermission.READ_WRITE);
285    }
286    
287    public void setReturnsGlAccountPK(GlAccountPK returnsGlAccountPK)
288            throws PersistenceNotNullException, PersistenceReadOnlyException {
289        checkReadWrite();
290        _value.setReturnsGlAccountPK(returnsGlAccountPK);
291    }
292    
293    public void setReturnsGlAccount(GlAccount entity) {
294        setReturnsGlAccountPK(entity == null? null: entity.getPrimaryKey());
295    }
296    
297    public boolean getReturnsGlAccountPKHasBeenModified() {
298        return _value.getReturnsGlAccountPKHasBeenModified();
299    }
300    
301    public GlAccountPK getCogsGlAccountPK() {
302        return _value.getCogsGlAccountPK();
303    }
304    
305    public GlAccount getCogsGlAccount(EntityPermission entityPermission) {
306        GlAccountPK pk = getCogsGlAccountPK();
307        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
308        
309        return entity;
310    }
311    
312    public GlAccount getCogsGlAccount() {
313        return getCogsGlAccount(EntityPermission.READ_ONLY);
314    }
315    
316    public GlAccount getCogsGlAccountForUpdate() {
317        return getCogsGlAccount(EntityPermission.READ_WRITE);
318    }
319    
320    public void setCogsGlAccountPK(GlAccountPK cogsGlAccountPK)
321            throws PersistenceNotNullException, PersistenceReadOnlyException {
322        checkReadWrite();
323        _value.setCogsGlAccountPK(cogsGlAccountPK);
324    }
325    
326    public void setCogsGlAccount(GlAccount entity) {
327        setCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
328    }
329    
330    public boolean getCogsGlAccountPKHasBeenModified() {
331        return _value.getCogsGlAccountPKHasBeenModified();
332    }
333    
334    public GlAccountPK getReturnsCogsGlAccountPK() {
335        return _value.getReturnsCogsGlAccountPK();
336    }
337    
338    public GlAccount getReturnsCogsGlAccount(EntityPermission entityPermission) {
339        GlAccountPK pk = getReturnsCogsGlAccountPK();
340        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
341        
342        return entity;
343    }
344    
345    public GlAccount getReturnsCogsGlAccount() {
346        return getReturnsCogsGlAccount(EntityPermission.READ_ONLY);
347    }
348    
349    public GlAccount getReturnsCogsGlAccountForUpdate() {
350        return getReturnsCogsGlAccount(EntityPermission.READ_WRITE);
351    }
352    
353    public void setReturnsCogsGlAccountPK(GlAccountPK returnsCogsGlAccountPK)
354            throws PersistenceNotNullException, PersistenceReadOnlyException {
355        checkReadWrite();
356        _value.setReturnsCogsGlAccountPK(returnsCogsGlAccountPK);
357    }
358    
359    public void setReturnsCogsGlAccount(GlAccount entity) {
360        setReturnsCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
361    }
362    
363    public boolean getReturnsCogsGlAccountPKHasBeenModified() {
364        return _value.getReturnsCogsGlAccountPKHasBeenModified();
365    }
366    
367    public Long getFromTime() {
368        return _value.getFromTime();
369    }
370    
371    public void setFromTime(Long fromTime)
372            throws PersistenceNotNullException, PersistenceReadOnlyException {
373        checkReadWrite();
374        _value.setFromTime(fromTime);
375    }
376    
377    public boolean getFromTimeHasBeenModified() {
378        return _value.getFromTimeHasBeenModified();
379    }
380    
381    public Long getThruTime() {
382        return _value.getThruTime();
383    }
384    
385    public void setThruTime(Long thruTime)
386            throws PersistenceNotNullException, PersistenceReadOnlyException {
387        checkReadWrite();
388        _value.setThruTime(thruTime);
389    }
390    
391    public boolean getThruTimeHasBeenModified() {
392        return _value.getThruTimeHasBeenModified();
393    }
394    
395}