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 * 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) {
108            InventoryConditionGlAccount that = (InventoryConditionGlAccount)other;
109            
110            InventoryConditionGlAccountValue thatValue = that.getInventoryConditionGlAccountValue();
111            return _value.equals(thatValue);
112        } else {
113            return false;
114        }
115    }
116    
117    @Override
118    public void store(Session session)
119            throws PersistenceDatabaseException {
120        getBaseFactoryInstance().store(session, this);
121    }
122    
123    @Override
124    public void remove(Session session)
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().remove(session, this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
133    }
134    
135    public InventoryConditionGlAccountValue getInventoryConditionGlAccountValue() {
136        return _value;
137    }
138    
139    public void setInventoryConditionGlAccountValue(InventoryConditionGlAccountValue value)
140            throws PersistenceReadOnlyException {
141        checkReadWrite();
142        _value = value;
143    }
144    
145    @Override
146    public InventoryConditionGlAccountPK getPrimaryKey() {
147        return _pk;
148    }
149    
150    public InventoryConditionPK getInventoryConditionPK() {
151        return _value.getInventoryConditionPK();
152    }
153    
154    public InventoryCondition getInventoryCondition(Session session, EntityPermission entityPermission) {
155        return InventoryConditionFactory.getInstance().getEntityFromPK(session, entityPermission, getInventoryConditionPK());
156    }
157    
158    public InventoryCondition getInventoryCondition(EntityPermission entityPermission) {
159        return getInventoryCondition(ThreadSession.currentSession(), entityPermission);
160    }
161    
162    public InventoryCondition getInventoryCondition(Session session) {
163        return getInventoryCondition(session, EntityPermission.READ_ONLY);
164    }
165    
166    public InventoryCondition getInventoryCondition() {
167        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
168    }
169    
170    public InventoryCondition getInventoryConditionForUpdate(Session session) {
171        return getInventoryCondition(session, EntityPermission.READ_WRITE);
172    }
173    
174    public InventoryCondition getInventoryConditionForUpdate() {
175        return getInventoryCondition(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
176    }
177    
178    public void setInventoryConditionPK(InventoryConditionPK inventoryConditionPK)
179            throws PersistenceNotNullException, PersistenceReadOnlyException {
180        checkReadWrite();
181        _value.setInventoryConditionPK(inventoryConditionPK);
182    }
183    
184    public void setInventoryCondition(InventoryCondition entity) {
185        setInventoryConditionPK(entity == null? null: entity.getPrimaryKey());
186    }
187    
188    public boolean getInventoryConditionPKHasBeenModified() {
189        return _value.getInventoryConditionPKHasBeenModified();
190    }
191    
192    public ItemAccountingCategoryPK getItemAccountingCategoryPK() {
193        return _value.getItemAccountingCategoryPK();
194    }
195    
196    public ItemAccountingCategory getItemAccountingCategory(Session session, EntityPermission entityPermission) {
197        return ItemAccountingCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, getItemAccountingCategoryPK());
198    }
199    
200    public ItemAccountingCategory getItemAccountingCategory(EntityPermission entityPermission) {
201        return getItemAccountingCategory(ThreadSession.currentSession(), entityPermission);
202    }
203    
204    public ItemAccountingCategory getItemAccountingCategory(Session session) {
205        return getItemAccountingCategory(session, EntityPermission.READ_ONLY);
206    }
207    
208    public ItemAccountingCategory getItemAccountingCategory() {
209        return getItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
210    }
211    
212    public ItemAccountingCategory getItemAccountingCategoryForUpdate(Session session) {
213        return getItemAccountingCategory(session, EntityPermission.READ_WRITE);
214    }
215    
216    public ItemAccountingCategory getItemAccountingCategoryForUpdate() {
217        return getItemAccountingCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
218    }
219    
220    public void setItemAccountingCategoryPK(ItemAccountingCategoryPK itemAccountingCategoryPK)
221            throws PersistenceNotNullException, PersistenceReadOnlyException {
222        checkReadWrite();
223        _value.setItemAccountingCategoryPK(itemAccountingCategoryPK);
224    }
225    
226    public void setItemAccountingCategory(ItemAccountingCategory entity) {
227        setItemAccountingCategoryPK(entity == null? null: entity.getPrimaryKey());
228    }
229    
230    public boolean getItemAccountingCategoryPKHasBeenModified() {
231        return _value.getItemAccountingCategoryPKHasBeenModified();
232    }
233    
234    public GlAccountPK getInventoryGlAccountPK() {
235        return _value.getInventoryGlAccountPK();
236    }
237    
238    public GlAccount getInventoryGlAccount(Session session, EntityPermission entityPermission) {
239        GlAccountPK pk = getInventoryGlAccountPK();
240        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
241        
242        return entity;
243    }
244    
245    public GlAccount getInventoryGlAccount(EntityPermission entityPermission) {
246        return getInventoryGlAccount(ThreadSession.currentSession(), entityPermission);
247    }
248    
249    public GlAccount getInventoryGlAccount(Session session) {
250        return getInventoryGlAccount(session, EntityPermission.READ_ONLY);
251    }
252    
253    public GlAccount getInventoryGlAccount() {
254        return getInventoryGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
255    }
256    
257    public GlAccount getInventoryGlAccountForUpdate(Session session) {
258        return getInventoryGlAccount(session, EntityPermission.READ_WRITE);
259    }
260    
261    public GlAccount getInventoryGlAccountForUpdate() {
262        return getInventoryGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
263    }
264    
265    public void setInventoryGlAccountPK(GlAccountPK inventoryGlAccountPK)
266            throws PersistenceNotNullException, PersistenceReadOnlyException {
267        checkReadWrite();
268        _value.setInventoryGlAccountPK(inventoryGlAccountPK);
269    }
270    
271    public void setInventoryGlAccount(GlAccount entity) {
272        setInventoryGlAccountPK(entity == null? null: entity.getPrimaryKey());
273    }
274    
275    public boolean getInventoryGlAccountPKHasBeenModified() {
276        return _value.getInventoryGlAccountPKHasBeenModified();
277    }
278    
279    public GlAccountPK getSalesGlAccountPK() {
280        return _value.getSalesGlAccountPK();
281    }
282    
283    public GlAccount getSalesGlAccount(Session session, EntityPermission entityPermission) {
284        GlAccountPK pk = getSalesGlAccountPK();
285        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
286        
287        return entity;
288    }
289    
290    public GlAccount getSalesGlAccount(EntityPermission entityPermission) {
291        return getSalesGlAccount(ThreadSession.currentSession(), entityPermission);
292    }
293    
294    public GlAccount getSalesGlAccount(Session session) {
295        return getSalesGlAccount(session, EntityPermission.READ_ONLY);
296    }
297    
298    public GlAccount getSalesGlAccount() {
299        return getSalesGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
300    }
301    
302    public GlAccount getSalesGlAccountForUpdate(Session session) {
303        return getSalesGlAccount(session, EntityPermission.READ_WRITE);
304    }
305    
306    public GlAccount getSalesGlAccountForUpdate() {
307        return getSalesGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
308    }
309    
310    public void setSalesGlAccountPK(GlAccountPK salesGlAccountPK)
311            throws PersistenceNotNullException, PersistenceReadOnlyException {
312        checkReadWrite();
313        _value.setSalesGlAccountPK(salesGlAccountPK);
314    }
315    
316    public void setSalesGlAccount(GlAccount entity) {
317        setSalesGlAccountPK(entity == null? null: entity.getPrimaryKey());
318    }
319    
320    public boolean getSalesGlAccountPKHasBeenModified() {
321        return _value.getSalesGlAccountPKHasBeenModified();
322    }
323    
324    public GlAccountPK getReturnsGlAccountPK() {
325        return _value.getReturnsGlAccountPK();
326    }
327    
328    public GlAccount getReturnsGlAccount(Session session, EntityPermission entityPermission) {
329        GlAccountPK pk = getReturnsGlAccountPK();
330        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
331        
332        return entity;
333    }
334    
335    public GlAccount getReturnsGlAccount(EntityPermission entityPermission) {
336        return getReturnsGlAccount(ThreadSession.currentSession(), entityPermission);
337    }
338    
339    public GlAccount getReturnsGlAccount(Session session) {
340        return getReturnsGlAccount(session, EntityPermission.READ_ONLY);
341    }
342    
343    public GlAccount getReturnsGlAccount() {
344        return getReturnsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
345    }
346    
347    public GlAccount getReturnsGlAccountForUpdate(Session session) {
348        return getReturnsGlAccount(session, EntityPermission.READ_WRITE);
349    }
350    
351    public GlAccount getReturnsGlAccountForUpdate() {
352        return getReturnsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
353    }
354    
355    public void setReturnsGlAccountPK(GlAccountPK returnsGlAccountPK)
356            throws PersistenceNotNullException, PersistenceReadOnlyException {
357        checkReadWrite();
358        _value.setReturnsGlAccountPK(returnsGlAccountPK);
359    }
360    
361    public void setReturnsGlAccount(GlAccount entity) {
362        setReturnsGlAccountPK(entity == null? null: entity.getPrimaryKey());
363    }
364    
365    public boolean getReturnsGlAccountPKHasBeenModified() {
366        return _value.getReturnsGlAccountPKHasBeenModified();
367    }
368    
369    public GlAccountPK getCogsGlAccountPK() {
370        return _value.getCogsGlAccountPK();
371    }
372    
373    public GlAccount getCogsGlAccount(Session session, EntityPermission entityPermission) {
374        GlAccountPK pk = getCogsGlAccountPK();
375        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
376        
377        return entity;
378    }
379    
380    public GlAccount getCogsGlAccount(EntityPermission entityPermission) {
381        return getCogsGlAccount(ThreadSession.currentSession(), entityPermission);
382    }
383    
384    public GlAccount getCogsGlAccount(Session session) {
385        return getCogsGlAccount(session, EntityPermission.READ_ONLY);
386    }
387    
388    public GlAccount getCogsGlAccount() {
389        return getCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
390    }
391    
392    public GlAccount getCogsGlAccountForUpdate(Session session) {
393        return getCogsGlAccount(session, EntityPermission.READ_WRITE);
394    }
395    
396    public GlAccount getCogsGlAccountForUpdate() {
397        return getCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
398    }
399    
400    public void setCogsGlAccountPK(GlAccountPK cogsGlAccountPK)
401            throws PersistenceNotNullException, PersistenceReadOnlyException {
402        checkReadWrite();
403        _value.setCogsGlAccountPK(cogsGlAccountPK);
404    }
405    
406    public void setCogsGlAccount(GlAccount entity) {
407        setCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
408    }
409    
410    public boolean getCogsGlAccountPKHasBeenModified() {
411        return _value.getCogsGlAccountPKHasBeenModified();
412    }
413    
414    public GlAccountPK getReturnsCogsGlAccountPK() {
415        return _value.getReturnsCogsGlAccountPK();
416    }
417    
418    public GlAccount getReturnsCogsGlAccount(Session session, EntityPermission entityPermission) {
419        GlAccountPK pk = getReturnsCogsGlAccountPK();
420        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
421        
422        return entity;
423    }
424    
425    public GlAccount getReturnsCogsGlAccount(EntityPermission entityPermission) {
426        return getReturnsCogsGlAccount(ThreadSession.currentSession(), entityPermission);
427    }
428    
429    public GlAccount getReturnsCogsGlAccount(Session session) {
430        return getReturnsCogsGlAccount(session, EntityPermission.READ_ONLY);
431    }
432    
433    public GlAccount getReturnsCogsGlAccount() {
434        return getReturnsCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
435    }
436    
437    public GlAccount getReturnsCogsGlAccountForUpdate(Session session) {
438        return getReturnsCogsGlAccount(session, EntityPermission.READ_WRITE);
439    }
440    
441    public GlAccount getReturnsCogsGlAccountForUpdate() {
442        return getReturnsCogsGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
443    }
444    
445    public void setReturnsCogsGlAccountPK(GlAccountPK returnsCogsGlAccountPK)
446            throws PersistenceNotNullException, PersistenceReadOnlyException {
447        checkReadWrite();
448        _value.setReturnsCogsGlAccountPK(returnsCogsGlAccountPK);
449    }
450    
451    public void setReturnsCogsGlAccount(GlAccount entity) {
452        setReturnsCogsGlAccountPK(entity == null? null: entity.getPrimaryKey());
453    }
454    
455    public boolean getReturnsCogsGlAccountPKHasBeenModified() {
456        return _value.getReturnsCogsGlAccountPKHasBeenModified();
457    }
458    
459    public Long getFromTime() {
460        return _value.getFromTime();
461    }
462    
463    public void setFromTime(Long fromTime)
464            throws PersistenceNotNullException, PersistenceReadOnlyException {
465        checkReadWrite();
466        _value.setFromTime(fromTime);
467    }
468    
469    public boolean getFromTimeHasBeenModified() {
470        return _value.getFromTimeHasBeenModified();
471    }
472    
473    public Long getThruTime() {
474        return _value.getThruTime();
475    }
476    
477    public void setThruTime(Long thruTime)
478            throws PersistenceNotNullException, PersistenceReadOnlyException {
479        checkReadWrite();
480        _value.setThruTime(thruTime);
481    }
482    
483    public boolean getThruTimeHasBeenModified() {
484        return _value.getThruTimeHasBeenModified();
485    }
486    
487}