001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 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 * GlAccountDetail.java
021 */
022
023package com.echothree.model.data.accounting.server.entity;
024
025import com.echothree.model.data.accounting.common.pk.GlAccountDetailPK;
026
027import com.echothree.model.data.accounting.common.pk.GlAccountPK;
028import com.echothree.model.data.accounting.common.pk.GlAccountTypePK;
029import com.echothree.model.data.accounting.common.pk.GlAccountClassPK;
030import com.echothree.model.data.accounting.common.pk.GlAccountCategoryPK;
031import com.echothree.model.data.accounting.common.pk.GlResourceTypePK;
032import com.echothree.model.data.accounting.common.pk.CurrencyPK;
033
034import com.echothree.model.data.accounting.server.entity.GlAccount;
035import com.echothree.model.data.accounting.server.entity.GlAccountType;
036import com.echothree.model.data.accounting.server.entity.GlAccountClass;
037import com.echothree.model.data.accounting.server.entity.GlAccountCategory;
038import com.echothree.model.data.accounting.server.entity.GlResourceType;
039import com.echothree.model.data.accounting.server.entity.Currency;
040
041import com.echothree.model.data.accounting.server.factory.GlAccountFactory;
042import com.echothree.model.data.accounting.server.factory.GlAccountTypeFactory;
043import com.echothree.model.data.accounting.server.factory.GlAccountClassFactory;
044import com.echothree.model.data.accounting.server.factory.GlAccountCategoryFactory;
045import com.echothree.model.data.accounting.server.factory.GlResourceTypeFactory;
046import com.echothree.model.data.accounting.server.factory.CurrencyFactory;
047
048import com.echothree.model.data.accounting.common.pk.GlAccountDetailPK;
049
050import com.echothree.model.data.accounting.server.value.GlAccountDetailValue;
051
052import com.echothree.model.data.accounting.server.factory.GlAccountDetailFactory;
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 GlAccountDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private GlAccountDetailPK _pk;
075    private GlAccountDetailValue _value;
076    
077    /** Creates a new instance of GlAccountDetail */
078    public GlAccountDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of GlAccountDetail */
084    public GlAccountDetail(GlAccountDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    public GlAccountDetailFactory getBaseFactoryInstance() {
093        return GlAccountDetailFactory.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 GlAccountDetail that) {
117            GlAccountDetailValue thatValue = that.getGlAccountDetailValue();
118            return _value.equals(thatValue);
119        } else {
120            return false;
121        }
122    }
123    
124    @Override
125    public void store(Session session)
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().store(session, this);
128    }
129    
130    @Override
131    public void remove(Session session)
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(session, this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
140    }
141    
142    public GlAccountDetailValue getGlAccountDetailValue() {
143        return _value;
144    }
145    
146    public void setGlAccountDetailValue(GlAccountDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public GlAccountDetailPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public GlAccountPK getGlAccountPK() {
158        return _value.getGlAccountPK();
159    }
160    
161    public GlAccount getGlAccount(Session session, EntityPermission entityPermission) {
162        return GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountPK());
163    }
164    
165    public GlAccount getGlAccount(EntityPermission entityPermission) {
166        return getGlAccount(ThreadSession.currentSession(), entityPermission);
167    }
168    
169    public GlAccount getGlAccount(Session session) {
170        return getGlAccount(session, EntityPermission.READ_ONLY);
171    }
172    
173    public GlAccount getGlAccount() {
174        return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
175    }
176    
177    public GlAccount getGlAccountForUpdate(Session session) {
178        return getGlAccount(session, EntityPermission.READ_WRITE);
179    }
180    
181    public GlAccount getGlAccountForUpdate() {
182        return getGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
183    }
184    
185    public void setGlAccountPK(GlAccountPK glAccountPK)
186            throws PersistenceNotNullException, PersistenceReadOnlyException {
187        checkReadWrite();
188        _value.setGlAccountPK(glAccountPK);
189    }
190    
191    public void setGlAccount(GlAccount entity) {
192        setGlAccountPK(entity == null? null: entity.getPrimaryKey());
193    }
194    
195    public boolean getGlAccountPKHasBeenModified() {
196        return _value.getGlAccountPKHasBeenModified();
197    }
198    
199    public String getGlAccountName() {
200        return _value.getGlAccountName();
201    }
202    
203    public void setGlAccountName(String glAccountName)
204            throws PersistenceNotNullException, PersistenceReadOnlyException {
205        checkReadWrite();
206        _value.setGlAccountName(glAccountName);
207    }
208    
209    public boolean getGlAccountNameHasBeenModified() {
210        return _value.getGlAccountNameHasBeenModified();
211    }
212    
213    public GlAccountPK getParentGlAccountPK() {
214        return _value.getParentGlAccountPK();
215    }
216    
217    public GlAccount getParentGlAccount(Session session, EntityPermission entityPermission) {
218        GlAccountPK pk = getParentGlAccountPK();
219        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
220        
221        return entity;
222    }
223    
224    public GlAccount getParentGlAccount(EntityPermission entityPermission) {
225        return getParentGlAccount(ThreadSession.currentSession(), entityPermission);
226    }
227    
228    public GlAccount getParentGlAccount(Session session) {
229        return getParentGlAccount(session, EntityPermission.READ_ONLY);
230    }
231    
232    public GlAccount getParentGlAccount() {
233        return getParentGlAccount(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
234    }
235    
236    public GlAccount getParentGlAccountForUpdate(Session session) {
237        return getParentGlAccount(session, EntityPermission.READ_WRITE);
238    }
239    
240    public GlAccount getParentGlAccountForUpdate() {
241        return getParentGlAccount(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
242    }
243    
244    public void setParentGlAccountPK(GlAccountPK parentGlAccountPK)
245            throws PersistenceNotNullException, PersistenceReadOnlyException {
246        checkReadWrite();
247        _value.setParentGlAccountPK(parentGlAccountPK);
248    }
249    
250    public void setParentGlAccount(GlAccount entity) {
251        setParentGlAccountPK(entity == null? null: entity.getPrimaryKey());
252    }
253    
254    public boolean getParentGlAccountPKHasBeenModified() {
255        return _value.getParentGlAccountPKHasBeenModified();
256    }
257    
258    public GlAccountTypePK getGlAccountTypePK() {
259        return _value.getGlAccountTypePK();
260    }
261    
262    public GlAccountType getGlAccountType(Session session, EntityPermission entityPermission) {
263        return GlAccountTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountTypePK());
264    }
265    
266    public GlAccountType getGlAccountType(EntityPermission entityPermission) {
267        return getGlAccountType(ThreadSession.currentSession(), entityPermission);
268    }
269    
270    public GlAccountType getGlAccountType(Session session) {
271        return getGlAccountType(session, EntityPermission.READ_ONLY);
272    }
273    
274    public GlAccountType getGlAccountType() {
275        return getGlAccountType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
276    }
277    
278    public GlAccountType getGlAccountTypeForUpdate(Session session) {
279        return getGlAccountType(session, EntityPermission.READ_WRITE);
280    }
281    
282    public GlAccountType getGlAccountTypeForUpdate() {
283        return getGlAccountType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
284    }
285    
286    public void setGlAccountTypePK(GlAccountTypePK glAccountTypePK)
287            throws PersistenceNotNullException, PersistenceReadOnlyException {
288        checkReadWrite();
289        _value.setGlAccountTypePK(glAccountTypePK);
290    }
291    
292    public void setGlAccountType(GlAccountType entity) {
293        setGlAccountTypePK(entity == null? null: entity.getPrimaryKey());
294    }
295    
296    public boolean getGlAccountTypePKHasBeenModified() {
297        return _value.getGlAccountTypePKHasBeenModified();
298    }
299    
300    public GlAccountClassPK getGlAccountClassPK() {
301        return _value.getGlAccountClassPK();
302    }
303    
304    public GlAccountClass getGlAccountClass(Session session, EntityPermission entityPermission) {
305        return GlAccountClassFactory.getInstance().getEntityFromPK(session, entityPermission, getGlAccountClassPK());
306    }
307    
308    public GlAccountClass getGlAccountClass(EntityPermission entityPermission) {
309        return getGlAccountClass(ThreadSession.currentSession(), entityPermission);
310    }
311    
312    public GlAccountClass getGlAccountClass(Session session) {
313        return getGlAccountClass(session, EntityPermission.READ_ONLY);
314    }
315    
316    public GlAccountClass getGlAccountClass() {
317        return getGlAccountClass(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
318    }
319    
320    public GlAccountClass getGlAccountClassForUpdate(Session session) {
321        return getGlAccountClass(session, EntityPermission.READ_WRITE);
322    }
323    
324    public GlAccountClass getGlAccountClassForUpdate() {
325        return getGlAccountClass(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
326    }
327    
328    public void setGlAccountClassPK(GlAccountClassPK glAccountClassPK)
329            throws PersistenceNotNullException, PersistenceReadOnlyException {
330        checkReadWrite();
331        _value.setGlAccountClassPK(glAccountClassPK);
332    }
333    
334    public void setGlAccountClass(GlAccountClass entity) {
335        setGlAccountClassPK(entity == null? null: entity.getPrimaryKey());
336    }
337    
338    public boolean getGlAccountClassPKHasBeenModified() {
339        return _value.getGlAccountClassPKHasBeenModified();
340    }
341    
342    public GlAccountCategoryPK getGlAccountCategoryPK() {
343        return _value.getGlAccountCategoryPK();
344    }
345    
346    public GlAccountCategory getGlAccountCategory(Session session, EntityPermission entityPermission) {
347        GlAccountCategoryPK pk = getGlAccountCategoryPK();
348        GlAccountCategory entity = pk == null? null: GlAccountCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
349        
350        return entity;
351    }
352    
353    public GlAccountCategory getGlAccountCategory(EntityPermission entityPermission) {
354        return getGlAccountCategory(ThreadSession.currentSession(), entityPermission);
355    }
356    
357    public GlAccountCategory getGlAccountCategory(Session session) {
358        return getGlAccountCategory(session, EntityPermission.READ_ONLY);
359    }
360    
361    public GlAccountCategory getGlAccountCategory() {
362        return getGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
363    }
364    
365    public GlAccountCategory getGlAccountCategoryForUpdate(Session session) {
366        return getGlAccountCategory(session, EntityPermission.READ_WRITE);
367    }
368    
369    public GlAccountCategory getGlAccountCategoryForUpdate() {
370        return getGlAccountCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
371    }
372    
373    public void setGlAccountCategoryPK(GlAccountCategoryPK glAccountCategoryPK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setGlAccountCategoryPK(glAccountCategoryPK);
377    }
378    
379    public void setGlAccountCategory(GlAccountCategory entity) {
380        setGlAccountCategoryPK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getGlAccountCategoryPKHasBeenModified() {
384        return _value.getGlAccountCategoryPKHasBeenModified();
385    }
386    
387    public GlResourceTypePK getGlResourceTypePK() {
388        return _value.getGlResourceTypePK();
389    }
390    
391    public GlResourceType getGlResourceType(Session session, EntityPermission entityPermission) {
392        return GlResourceTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getGlResourceTypePK());
393    }
394    
395    public GlResourceType getGlResourceType(EntityPermission entityPermission) {
396        return getGlResourceType(ThreadSession.currentSession(), entityPermission);
397    }
398    
399    public GlResourceType getGlResourceType(Session session) {
400        return getGlResourceType(session, EntityPermission.READ_ONLY);
401    }
402    
403    public GlResourceType getGlResourceType() {
404        return getGlResourceType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
405    }
406    
407    public GlResourceType getGlResourceTypeForUpdate(Session session) {
408        return getGlResourceType(session, EntityPermission.READ_WRITE);
409    }
410    
411    public GlResourceType getGlResourceTypeForUpdate() {
412        return getGlResourceType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
413    }
414    
415    public void setGlResourceTypePK(GlResourceTypePK glResourceTypePK)
416            throws PersistenceNotNullException, PersistenceReadOnlyException {
417        checkReadWrite();
418        _value.setGlResourceTypePK(glResourceTypePK);
419    }
420    
421    public void setGlResourceType(GlResourceType entity) {
422        setGlResourceTypePK(entity == null? null: entity.getPrimaryKey());
423    }
424    
425    public boolean getGlResourceTypePKHasBeenModified() {
426        return _value.getGlResourceTypePKHasBeenModified();
427    }
428    
429    public CurrencyPK getCurrencyPK() {
430        return _value.getCurrencyPK();
431    }
432    
433    public Currency getCurrency(Session session, EntityPermission entityPermission) {
434        return CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, getCurrencyPK());
435    }
436    
437    public Currency getCurrency(EntityPermission entityPermission) {
438        return getCurrency(ThreadSession.currentSession(), entityPermission);
439    }
440    
441    public Currency getCurrency(Session session) {
442        return getCurrency(session, EntityPermission.READ_ONLY);
443    }
444    
445    public Currency getCurrency() {
446        return getCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
447    }
448    
449    public Currency getCurrencyForUpdate(Session session) {
450        return getCurrency(session, EntityPermission.READ_WRITE);
451    }
452    
453    public Currency getCurrencyForUpdate() {
454        return getCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
455    }
456    
457    public void setCurrencyPK(CurrencyPK currencyPK)
458            throws PersistenceNotNullException, PersistenceReadOnlyException {
459        checkReadWrite();
460        _value.setCurrencyPK(currencyPK);
461    }
462    
463    public void setCurrency(Currency entity) {
464        setCurrencyPK(entity == null? null: entity.getPrimaryKey());
465    }
466    
467    public boolean getCurrencyPKHasBeenModified() {
468        return _value.getCurrencyPKHasBeenModified();
469    }
470    
471    public Boolean getIsDefault() {
472        return _value.getIsDefault();
473    }
474    
475    public void setIsDefault(Boolean isDefault)
476            throws PersistenceNotNullException, PersistenceReadOnlyException {
477        checkReadWrite();
478        _value.setIsDefault(isDefault);
479    }
480    
481    public boolean getIsDefaultHasBeenModified() {
482        return _value.getIsDefaultHasBeenModified();
483    }
484    
485    public Long getFromTime() {
486        return _value.getFromTime();
487    }
488    
489    public void setFromTime(Long fromTime)
490            throws PersistenceNotNullException, PersistenceReadOnlyException {
491        checkReadWrite();
492        _value.setFromTime(fromTime);
493    }
494    
495    public boolean getFromTimeHasBeenModified() {
496        return _value.getFromTimeHasBeenModified();
497    }
498    
499    public Long getThruTime() {
500        return _value.getThruTime();
501    }
502    
503    public void setThruTime(Long thruTime)
504            throws PersistenceNotNullException, PersistenceReadOnlyException {
505        checkReadWrite();
506        _value.setThruTime(thruTime);
507    }
508    
509    public boolean getThruTimeHasBeenModified() {
510        return _value.getThruTimeHasBeenModified();
511    }
512    
513}