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
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()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().store(this);
128    }
129    
130    @Override
131    public void remove()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(this);
134    }
135    
136    public GlAccountDetailValue getGlAccountDetailValue() {
137        return _value;
138    }
139    
140    public void setGlAccountDetailValue(GlAccountDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public GlAccountDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public GlAccountPK getGlAccountPK() {
152        return _value.getGlAccountPK();
153    }
154    
155    public GlAccount getGlAccount(EntityPermission entityPermission) {
156        return GlAccountFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountPK());
157    }
158    
159    public GlAccount getGlAccount() {
160        return getGlAccount(EntityPermission.READ_ONLY);
161    }
162    
163    public GlAccount getGlAccountForUpdate() {
164        return getGlAccount(EntityPermission.READ_WRITE);
165    }
166    
167    public void setGlAccountPK(GlAccountPK glAccountPK)
168            throws PersistenceNotNullException, PersistenceReadOnlyException {
169        checkReadWrite();
170        _value.setGlAccountPK(glAccountPK);
171    }
172    
173    public void setGlAccount(GlAccount entity) {
174        setGlAccountPK(entity == null? null: entity.getPrimaryKey());
175    }
176    
177    public boolean getGlAccountPKHasBeenModified() {
178        return _value.getGlAccountPKHasBeenModified();
179    }
180    
181    public String getGlAccountName() {
182        return _value.getGlAccountName();
183    }
184    
185    public void setGlAccountName(String glAccountName)
186            throws PersistenceNotNullException, PersistenceReadOnlyException {
187        checkReadWrite();
188        _value.setGlAccountName(glAccountName);
189    }
190    
191    public boolean getGlAccountNameHasBeenModified() {
192        return _value.getGlAccountNameHasBeenModified();
193    }
194    
195    public GlAccountPK getParentGlAccountPK() {
196        return _value.getParentGlAccountPK();
197    }
198    
199    public GlAccount getParentGlAccount(EntityPermission entityPermission) {
200        GlAccountPK pk = getParentGlAccountPK();
201        GlAccount entity = pk == null? null: GlAccountFactory.getInstance().getEntityFromPK(entityPermission, pk);
202        
203        return entity;
204    }
205    
206    public GlAccount getParentGlAccount() {
207        return getParentGlAccount(EntityPermission.READ_ONLY);
208    }
209    
210    public GlAccount getParentGlAccountForUpdate() {
211        return getParentGlAccount(EntityPermission.READ_WRITE);
212    }
213    
214    public void setParentGlAccountPK(GlAccountPK parentGlAccountPK)
215            throws PersistenceNotNullException, PersistenceReadOnlyException {
216        checkReadWrite();
217        _value.setParentGlAccountPK(parentGlAccountPK);
218    }
219    
220    public void setParentGlAccount(GlAccount entity) {
221        setParentGlAccountPK(entity == null? null: entity.getPrimaryKey());
222    }
223    
224    public boolean getParentGlAccountPKHasBeenModified() {
225        return _value.getParentGlAccountPKHasBeenModified();
226    }
227    
228    public GlAccountTypePK getGlAccountTypePK() {
229        return _value.getGlAccountTypePK();
230    }
231    
232    public GlAccountType getGlAccountType(EntityPermission entityPermission) {
233        return GlAccountTypeFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountTypePK());
234    }
235    
236    public GlAccountType getGlAccountType() {
237        return getGlAccountType(EntityPermission.READ_ONLY);
238    }
239    
240    public GlAccountType getGlAccountTypeForUpdate() {
241        return getGlAccountType(EntityPermission.READ_WRITE);
242    }
243    
244    public void setGlAccountTypePK(GlAccountTypePK glAccountTypePK)
245            throws PersistenceNotNullException, PersistenceReadOnlyException {
246        checkReadWrite();
247        _value.setGlAccountTypePK(glAccountTypePK);
248    }
249    
250    public void setGlAccountType(GlAccountType entity) {
251        setGlAccountTypePK(entity == null? null: entity.getPrimaryKey());
252    }
253    
254    public boolean getGlAccountTypePKHasBeenModified() {
255        return _value.getGlAccountTypePKHasBeenModified();
256    }
257    
258    public GlAccountClassPK getGlAccountClassPK() {
259        return _value.getGlAccountClassPK();
260    }
261    
262    public GlAccountClass getGlAccountClass(EntityPermission entityPermission) {
263        return GlAccountClassFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountClassPK());
264    }
265    
266    public GlAccountClass getGlAccountClass() {
267        return getGlAccountClass(EntityPermission.READ_ONLY);
268    }
269    
270    public GlAccountClass getGlAccountClassForUpdate() {
271        return getGlAccountClass(EntityPermission.READ_WRITE);
272    }
273    
274    public void setGlAccountClassPK(GlAccountClassPK glAccountClassPK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setGlAccountClassPK(glAccountClassPK);
278    }
279    
280    public void setGlAccountClass(GlAccountClass entity) {
281        setGlAccountClassPK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getGlAccountClassPKHasBeenModified() {
285        return _value.getGlAccountClassPKHasBeenModified();
286    }
287    
288    public GlAccountCategoryPK getGlAccountCategoryPK() {
289        return _value.getGlAccountCategoryPK();
290    }
291    
292    public GlAccountCategory getGlAccountCategory(EntityPermission entityPermission) {
293        GlAccountCategoryPK pk = getGlAccountCategoryPK();
294        GlAccountCategory entity = pk == null? null: GlAccountCategoryFactory.getInstance().getEntityFromPK(entityPermission, pk);
295        
296        return entity;
297    }
298    
299    public GlAccountCategory getGlAccountCategory() {
300        return getGlAccountCategory(EntityPermission.READ_ONLY);
301    }
302    
303    public GlAccountCategory getGlAccountCategoryForUpdate() {
304        return getGlAccountCategory(EntityPermission.READ_WRITE);
305    }
306    
307    public void setGlAccountCategoryPK(GlAccountCategoryPK glAccountCategoryPK)
308            throws PersistenceNotNullException, PersistenceReadOnlyException {
309        checkReadWrite();
310        _value.setGlAccountCategoryPK(glAccountCategoryPK);
311    }
312    
313    public void setGlAccountCategory(GlAccountCategory entity) {
314        setGlAccountCategoryPK(entity == null? null: entity.getPrimaryKey());
315    }
316    
317    public boolean getGlAccountCategoryPKHasBeenModified() {
318        return _value.getGlAccountCategoryPKHasBeenModified();
319    }
320    
321    public GlResourceTypePK getGlResourceTypePK() {
322        return _value.getGlResourceTypePK();
323    }
324    
325    public GlResourceType getGlResourceType(EntityPermission entityPermission) {
326        return GlResourceTypeFactory.getInstance().getEntityFromPK(entityPermission, getGlResourceTypePK());
327    }
328    
329    public GlResourceType getGlResourceType() {
330        return getGlResourceType(EntityPermission.READ_ONLY);
331    }
332    
333    public GlResourceType getGlResourceTypeForUpdate() {
334        return getGlResourceType(EntityPermission.READ_WRITE);
335    }
336    
337    public void setGlResourceTypePK(GlResourceTypePK glResourceTypePK)
338            throws PersistenceNotNullException, PersistenceReadOnlyException {
339        checkReadWrite();
340        _value.setGlResourceTypePK(glResourceTypePK);
341    }
342    
343    public void setGlResourceType(GlResourceType entity) {
344        setGlResourceTypePK(entity == null? null: entity.getPrimaryKey());
345    }
346    
347    public boolean getGlResourceTypePKHasBeenModified() {
348        return _value.getGlResourceTypePKHasBeenModified();
349    }
350    
351    public CurrencyPK getCurrencyPK() {
352        return _value.getCurrencyPK();
353    }
354    
355    public Currency getCurrency(EntityPermission entityPermission) {
356        return CurrencyFactory.getInstance().getEntityFromPK(entityPermission, getCurrencyPK());
357    }
358    
359    public Currency getCurrency() {
360        return getCurrency(EntityPermission.READ_ONLY);
361    }
362    
363    public Currency getCurrencyForUpdate() {
364        return getCurrency(EntityPermission.READ_WRITE);
365    }
366    
367    public void setCurrencyPK(CurrencyPK currencyPK)
368            throws PersistenceNotNullException, PersistenceReadOnlyException {
369        checkReadWrite();
370        _value.setCurrencyPK(currencyPK);
371    }
372    
373    public void setCurrency(Currency entity) {
374        setCurrencyPK(entity == null? null: entity.getPrimaryKey());
375    }
376    
377    public boolean getCurrencyPKHasBeenModified() {
378        return _value.getCurrencyPKHasBeenModified();
379    }
380    
381    public Boolean getIsDefault() {
382        return _value.getIsDefault();
383    }
384    
385    public void setIsDefault(Boolean isDefault)
386            throws PersistenceNotNullException, PersistenceReadOnlyException {
387        checkReadWrite();
388        _value.setIsDefault(isDefault);
389    }
390    
391    public boolean getIsDefaultHasBeenModified() {
392        return _value.getIsDefaultHasBeenModified();
393    }
394    
395    public Long getFromTime() {
396        return _value.getFromTime();
397    }
398    
399    public void setFromTime(Long fromTime)
400            throws PersistenceNotNullException, PersistenceReadOnlyException {
401        checkReadWrite();
402        _value.setFromTime(fromTime);
403    }
404    
405    public boolean getFromTimeHasBeenModified() {
406        return _value.getFromTimeHasBeenModified();
407    }
408    
409    public Long getThruTime() {
410        return _value.getThruTime();
411    }
412    
413    public void setThruTime(Long thruTime)
414            throws PersistenceNotNullException, PersistenceReadOnlyException {
415        checkReadWrite();
416        _value.setThruTime(thruTime);
417    }
418    
419    public boolean getThruTimeHasBeenModified() {
420        return _value.getThruTimeHasBeenModified();
421    }
422    
423}