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 * 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
070import javax.annotation.Nonnull;
071import javax.annotation.Nullable;
072
073public class GlAccountDetail
074        extends BaseEntity
075        implements Serializable {
076    
077    private GlAccountDetailPK _pk;
078    private GlAccountDetailValue _value;
079    
080    /** Creates a new instance of GlAccountDetail */
081    public GlAccountDetail()
082            throws PersistenceException {
083        super();
084    }
085    
086    /** Creates a new instance of GlAccountDetail */
087    public GlAccountDetail(GlAccountDetailValue value, EntityPermission entityPermission) {
088        super(entityPermission);
089        
090        _value = value;
091        _pk = value.getPrimaryKey();
092    }
093    
094    @Override
095    @Nonnull
096    public GlAccountDetailFactory getBaseFactoryInstance() {
097        return GlAccountDetailFactory.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 GlAccountDetail that) {
122            GlAccountDetailValue thatValue = that.getGlAccountDetailValue();
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 GlAccountDetailValue getGlAccountDetailValue() {
143        return _value;
144    }
145    
146    public void setGlAccountDetailValue(@Nonnull GlAccountDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    @Nonnull
154    public GlAccountDetailPK getPrimaryKey() {
155        return _pk;
156    }
157    
158    @Nonnull
159    public GlAccountPK getGlAccountPK() {
160        return _value.getGlAccountPK();
161    }
162    
163    @Nonnull
164    public GlAccount getGlAccount(EntityPermission entityPermission) {
165        return GlAccountFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountPK());
166    }
167    
168    @Nonnull
169    public GlAccount getGlAccount() {
170        return getGlAccount(EntityPermission.READ_ONLY);
171    }
172    
173    @Nonnull
174    public GlAccount getGlAccountForUpdate() {
175        return getGlAccount(EntityPermission.READ_WRITE);
176    }
177    
178    public void setGlAccountPK(@Nonnull GlAccountPK glAccountPK)
179            throws PersistenceNotNullException, PersistenceReadOnlyException {
180        checkReadWrite();
181        _value.setGlAccountPK(glAccountPK);
182    }
183    
184    public void setGlAccount(@Nonnull GlAccount entity) {
185        setGlAccountPK(entity == null ? null : entity.getPrimaryKey());
186    }
187    
188    public boolean getGlAccountPKHasBeenModified() {
189        return _value.getGlAccountPKHasBeenModified();
190    }
191    
192    @Nonnull
193    public String getGlAccountName() {
194        return _value.getGlAccountName();
195    }
196    
197    public void setGlAccountName(@Nonnull String glAccountName)
198            throws PersistenceNotNullException, PersistenceReadOnlyException {
199        checkReadWrite();
200        _value.setGlAccountName(glAccountName);
201    }
202    
203    public boolean getGlAccountNameHasBeenModified() {
204        return _value.getGlAccountNameHasBeenModified();
205    }
206    
207    @Nullable
208    public GlAccountPK getParentGlAccountPK() {
209        return _value.getParentGlAccountPK();
210    }
211    
212    @Nullable
213    public GlAccount getParentGlAccount(EntityPermission entityPermission) {
214        GlAccountPK pk = getParentGlAccountPK();
215        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
216        
217        return entity;
218    }
219    
220    @Nullable
221    public GlAccount getParentGlAccount() {
222        return getParentGlAccount(EntityPermission.READ_ONLY);
223    }
224    
225    @Nullable
226    public GlAccount getParentGlAccountForUpdate() {
227        return getParentGlAccount(EntityPermission.READ_WRITE);
228    }
229    
230    public void setParentGlAccountPK(@Nullable GlAccountPK parentGlAccountPK)
231            throws PersistenceNotNullException, PersistenceReadOnlyException {
232        checkReadWrite();
233        _value.setParentGlAccountPK(parentGlAccountPK);
234    }
235    
236    public void setParentGlAccount(@Nullable GlAccount entity) {
237        setParentGlAccountPK(entity == null ? null : entity.getPrimaryKey());
238    }
239    
240    public boolean getParentGlAccountPKHasBeenModified() {
241        return _value.getParentGlAccountPKHasBeenModified();
242    }
243    
244    @Nonnull
245    public GlAccountTypePK getGlAccountTypePK() {
246        return _value.getGlAccountTypePK();
247    }
248    
249    @Nonnull
250    public GlAccountType getGlAccountType(EntityPermission entityPermission) {
251        return GlAccountTypeFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountTypePK());
252    }
253    
254    @Nonnull
255    public GlAccountType getGlAccountType() {
256        return getGlAccountType(EntityPermission.READ_ONLY);
257    }
258    
259    @Nonnull
260    public GlAccountType getGlAccountTypeForUpdate() {
261        return getGlAccountType(EntityPermission.READ_WRITE);
262    }
263    
264    public void setGlAccountTypePK(@Nonnull GlAccountTypePK glAccountTypePK)
265            throws PersistenceNotNullException, PersistenceReadOnlyException {
266        checkReadWrite();
267        _value.setGlAccountTypePK(glAccountTypePK);
268    }
269    
270    public void setGlAccountType(@Nonnull GlAccountType entity) {
271        setGlAccountTypePK(entity == null ? null : entity.getPrimaryKey());
272    }
273    
274    public boolean getGlAccountTypePKHasBeenModified() {
275        return _value.getGlAccountTypePKHasBeenModified();
276    }
277    
278    @Nonnull
279    public GlAccountClassPK getGlAccountClassPK() {
280        return _value.getGlAccountClassPK();
281    }
282    
283    @Nonnull
284    public GlAccountClass getGlAccountClass(EntityPermission entityPermission) {
285        return GlAccountClassFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountClassPK());
286    }
287    
288    @Nonnull
289    public GlAccountClass getGlAccountClass() {
290        return getGlAccountClass(EntityPermission.READ_ONLY);
291    }
292    
293    @Nonnull
294    public GlAccountClass getGlAccountClassForUpdate() {
295        return getGlAccountClass(EntityPermission.READ_WRITE);
296    }
297    
298    public void setGlAccountClassPK(@Nonnull GlAccountClassPK glAccountClassPK)
299            throws PersistenceNotNullException, PersistenceReadOnlyException {
300        checkReadWrite();
301        _value.setGlAccountClassPK(glAccountClassPK);
302    }
303    
304    public void setGlAccountClass(@Nonnull GlAccountClass entity) {
305        setGlAccountClassPK(entity == null ? null : entity.getPrimaryKey());
306    }
307    
308    public boolean getGlAccountClassPKHasBeenModified() {
309        return _value.getGlAccountClassPKHasBeenModified();
310    }
311    
312    @Nullable
313    public GlAccountCategoryPK getGlAccountCategoryPK() {
314        return _value.getGlAccountCategoryPK();
315    }
316    
317    @Nullable
318    public GlAccountCategory getGlAccountCategory(EntityPermission entityPermission) {
319        GlAccountCategoryPK pk = getGlAccountCategoryPK();
320        GlAccountCategory entity = pk == null? null: GlAccountCategoryFactory.getInstance().getEntityFromPK(entityPermission, pk);
321        
322        return entity;
323    }
324    
325    @Nullable
326    public GlAccountCategory getGlAccountCategory() {
327        return getGlAccountCategory(EntityPermission.READ_ONLY);
328    }
329    
330    @Nullable
331    public GlAccountCategory getGlAccountCategoryForUpdate() {
332        return getGlAccountCategory(EntityPermission.READ_WRITE);
333    }
334    
335    public void setGlAccountCategoryPK(@Nullable GlAccountCategoryPK glAccountCategoryPK)
336            throws PersistenceNotNullException, PersistenceReadOnlyException {
337        checkReadWrite();
338        _value.setGlAccountCategoryPK(glAccountCategoryPK);
339    }
340    
341    public void setGlAccountCategory(@Nullable GlAccountCategory entity) {
342        setGlAccountCategoryPK(entity == null ? null : entity.getPrimaryKey());
343    }
344    
345    public boolean getGlAccountCategoryPKHasBeenModified() {
346        return _value.getGlAccountCategoryPKHasBeenModified();
347    }
348    
349    @Nonnull
350    public GlResourceTypePK getGlResourceTypePK() {
351        return _value.getGlResourceTypePK();
352    }
353    
354    @Nonnull
355    public GlResourceType getGlResourceType(EntityPermission entityPermission) {
356        return GlResourceTypeFactory.getInstance().getEntityFromPK(entityPermission, getGlResourceTypePK());
357    }
358    
359    @Nonnull
360    public GlResourceType getGlResourceType() {
361        return getGlResourceType(EntityPermission.READ_ONLY);
362    }
363    
364    @Nonnull
365    public GlResourceType getGlResourceTypeForUpdate() {
366        return getGlResourceType(EntityPermission.READ_WRITE);
367    }
368    
369    public void setGlResourceTypePK(@Nonnull GlResourceTypePK glResourceTypePK)
370            throws PersistenceNotNullException, PersistenceReadOnlyException {
371        checkReadWrite();
372        _value.setGlResourceTypePK(glResourceTypePK);
373    }
374    
375    public void setGlResourceType(@Nonnull GlResourceType entity) {
376        setGlResourceTypePK(entity == null ? null : entity.getPrimaryKey());
377    }
378    
379    public boolean getGlResourceTypePKHasBeenModified() {
380        return _value.getGlResourceTypePKHasBeenModified();
381    }
382    
383    @Nonnull
384    public CurrencyPK getCurrencyPK() {
385        return _value.getCurrencyPK();
386    }
387    
388    @Nonnull
389    public Currency getCurrency(EntityPermission entityPermission) {
390        return CurrencyFactory.getInstance().getEntityFromPK(entityPermission, getCurrencyPK());
391    }
392    
393    @Nonnull
394    public Currency getCurrency() {
395        return getCurrency(EntityPermission.READ_ONLY);
396    }
397    
398    @Nonnull
399    public Currency getCurrencyForUpdate() {
400        return getCurrency(EntityPermission.READ_WRITE);
401    }
402    
403    public void setCurrencyPK(@Nonnull CurrencyPK currencyPK)
404            throws PersistenceNotNullException, PersistenceReadOnlyException {
405        checkReadWrite();
406        _value.setCurrencyPK(currencyPK);
407    }
408    
409    public void setCurrency(@Nonnull Currency entity) {
410        setCurrencyPK(entity == null ? null : entity.getPrimaryKey());
411    }
412    
413    public boolean getCurrencyPKHasBeenModified() {
414        return _value.getCurrencyPKHasBeenModified();
415    }
416    
417    @Nullable
418    public Boolean getIsDefault() {
419        return _value.getIsDefault();
420    }
421    
422    public void setIsDefault(@Nullable Boolean isDefault)
423            throws PersistenceNotNullException, PersistenceReadOnlyException {
424        checkReadWrite();
425        _value.setIsDefault(isDefault);
426    }
427    
428    public boolean getIsDefaultHasBeenModified() {
429        return _value.getIsDefaultHasBeenModified();
430    }
431    
432    @Nonnull
433    public Long getFromTime() {
434        return _value.getFromTime();
435    }
436    
437    public void setFromTime(@Nonnull Long fromTime)
438            throws PersistenceNotNullException, PersistenceReadOnlyException {
439        checkReadWrite();
440        _value.setFromTime(fromTime);
441    }
442    
443    public boolean getFromTimeHasBeenModified() {
444        return _value.getFromTimeHasBeenModified();
445    }
446    
447    @Nonnull
448    public Long getThruTime() {
449        return _value.getThruTime();
450    }
451    
452    public void setThruTime(@Nonnull Long thruTime)
453            throws PersistenceNotNullException, PersistenceReadOnlyException {
454        checkReadWrite();
455        _value.setThruTime(thruTime);
456    }
457    
458    public boolean getThruTimeHasBeenModified() {
459        return _value.getThruTimeHasBeenModified();
460    }
461    
462}