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 * TransactionGlEntry.java
021 */
022
023package com.echothree.model.data.accounting.server.entity;
024
025import com.echothree.model.data.accounting.common.pk.TransactionGlEntryPK;
026
027import com.echothree.model.data.accounting.common.pk.TransactionPK;
028import com.echothree.model.data.party.common.pk.PartyPK;
029import com.echothree.model.data.accounting.common.pk.TransactionGlAccountCategoryPK;
030import com.echothree.model.data.accounting.common.pk.GlAccountPK;
031import com.echothree.model.data.accounting.common.pk.CurrencyPK;
032
033import com.echothree.model.data.accounting.server.entity.Transaction;
034import com.echothree.model.data.party.server.entity.Party;
035import com.echothree.model.data.accounting.server.entity.TransactionGlAccountCategory;
036import com.echothree.model.data.accounting.server.entity.GlAccount;
037import com.echothree.model.data.accounting.server.entity.Currency;
038
039import com.echothree.model.data.accounting.server.factory.TransactionFactory;
040import com.echothree.model.data.party.server.factory.PartyFactory;
041import com.echothree.model.data.accounting.server.factory.TransactionGlAccountCategoryFactory;
042import com.echothree.model.data.accounting.server.factory.GlAccountFactory;
043import com.echothree.model.data.accounting.server.factory.CurrencyFactory;
044
045import com.echothree.model.data.accounting.common.pk.TransactionGlEntryPK;
046
047import com.echothree.model.data.accounting.server.value.TransactionGlEntryValue;
048
049import com.echothree.model.data.accounting.server.factory.TransactionGlEntryFactory;
050
051import com.echothree.util.common.exception.PersistenceException;
052import com.echothree.util.common.exception.PersistenceDatabaseException;
053import com.echothree.util.common.exception.PersistenceNotNullException;
054import com.echothree.util.common.exception.PersistenceReadOnlyException;
055
056import com.echothree.util.common.persistence.BasePK;
057
058import com.echothree.util.common.persistence.type.ByteArray;
059
060import com.echothree.util.server.persistence.BaseEntity;
061import com.echothree.util.server.persistence.EntityPermission;
062import com.echothree.util.server.persistence.Session;
063import com.echothree.util.server.persistence.ThreadSession;
064
065import java.io.Serializable;
066
067public class TransactionGlEntry
068        extends BaseEntity
069        implements Serializable {
070    
071    private TransactionGlEntryPK _pk;
072    private TransactionGlEntryValue _value;
073    
074    /** Creates a new instance of TransactionGlEntry */
075    public TransactionGlEntry()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of TransactionGlEntry */
081    public TransactionGlEntry(TransactionGlEntryValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    public TransactionGlEntryFactory getBaseFactoryInstance() {
090        return TransactionGlEntryFactory.getInstance();
091    }
092    
093    @Override
094    public boolean hasBeenModified() {
095        return _value.hasBeenModified();
096    }
097    
098    @Override
099    public int hashCode() {
100        return _pk.hashCode();
101    }
102    
103    @Override
104    public String toString() {
105        return _pk.toString();
106    }
107    
108    @Override
109    public boolean equals(Object other) {
110        if(this == other)
111            return true;
112        
113        if(other instanceof TransactionGlEntry that) {
114            TransactionGlEntryValue thatValue = that.getTransactionGlEntryValue();
115            return _value.equals(thatValue);
116        } else {
117            return false;
118        }
119    }
120    
121    @Override
122    public void store()
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(this);
125    }
126    
127    @Override
128    public void remove()
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(this);
131    }
132    
133    public TransactionGlEntryValue getTransactionGlEntryValue() {
134        return _value;
135    }
136    
137    public void setTransactionGlEntryValue(TransactionGlEntryValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    public TransactionGlEntryPK getPrimaryKey() {
145        return _pk;
146    }
147    
148    public TransactionPK getTransactionPK() {
149        return _value.getTransactionPK();
150    }
151    
152    public Transaction getTransaction(EntityPermission entityPermission) {
153        return TransactionFactory.getInstance().getEntityFromPK(entityPermission, getTransactionPK());
154    }
155    
156    public Transaction getTransaction() {
157        return getTransaction(EntityPermission.READ_ONLY);
158    }
159    
160    public Transaction getTransactionForUpdate() {
161        return getTransaction(EntityPermission.READ_WRITE);
162    }
163    
164    public void setTransactionPK(TransactionPK transactionPK)
165            throws PersistenceNotNullException, PersistenceReadOnlyException {
166        checkReadWrite();
167        _value.setTransactionPK(transactionPK);
168    }
169    
170    public void setTransaction(Transaction entity) {
171        setTransactionPK(entity == null? null: entity.getPrimaryKey());
172    }
173    
174    public boolean getTransactionPKHasBeenModified() {
175        return _value.getTransactionPKHasBeenModified();
176    }
177    
178    public Integer getTransactionGlEntrySequence() {
179        return _value.getTransactionGlEntrySequence();
180    }
181    
182    public void setTransactionGlEntrySequence(Integer transactionGlEntrySequence)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setTransactionGlEntrySequence(transactionGlEntrySequence);
186    }
187    
188    public boolean getTransactionGlEntrySequenceHasBeenModified() {
189        return _value.getTransactionGlEntrySequenceHasBeenModified();
190    }
191    
192    public PartyPK getGroupPartyPK() {
193        return _value.getGroupPartyPK();
194    }
195    
196    public Party getGroupParty(EntityPermission entityPermission) {
197        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getGroupPartyPK());
198    }
199    
200    public Party getGroupParty() {
201        return getGroupParty(EntityPermission.READ_ONLY);
202    }
203    
204    public Party getGroupPartyForUpdate() {
205        return getGroupParty(EntityPermission.READ_WRITE);
206    }
207    
208    public void setGroupPartyPK(PartyPK groupPartyPK)
209            throws PersistenceNotNullException, PersistenceReadOnlyException {
210        checkReadWrite();
211        _value.setGroupPartyPK(groupPartyPK);
212    }
213    
214    public void setGroupParty(Party entity) {
215        setGroupPartyPK(entity == null? null: entity.getPrimaryKey());
216    }
217    
218    public boolean getGroupPartyPKHasBeenModified() {
219        return _value.getGroupPartyPKHasBeenModified();
220    }
221    
222    public TransactionGlAccountCategoryPK getTransactionGlAccountCategoryPK() {
223        return _value.getTransactionGlAccountCategoryPK();
224    }
225    
226    public TransactionGlAccountCategory getTransactionGlAccountCategory(EntityPermission entityPermission) {
227        TransactionGlAccountCategoryPK pk = getTransactionGlAccountCategoryPK();
228        TransactionGlAccountCategory entity = pk == null? null: TransactionGlAccountCategoryFactory.getInstance().getEntityFromPK(entityPermission, pk);
229        
230        return entity;
231    }
232    
233    public TransactionGlAccountCategory getTransactionGlAccountCategory() {
234        return getTransactionGlAccountCategory(EntityPermission.READ_ONLY);
235    }
236    
237    public TransactionGlAccountCategory getTransactionGlAccountCategoryForUpdate() {
238        return getTransactionGlAccountCategory(EntityPermission.READ_WRITE);
239    }
240    
241    public void setTransactionGlAccountCategoryPK(TransactionGlAccountCategoryPK transactionGlAccountCategoryPK)
242            throws PersistenceNotNullException, PersistenceReadOnlyException {
243        checkReadWrite();
244        _value.setTransactionGlAccountCategoryPK(transactionGlAccountCategoryPK);
245    }
246    
247    public void setTransactionGlAccountCategory(TransactionGlAccountCategory entity) {
248        setTransactionGlAccountCategoryPK(entity == null? null: entity.getPrimaryKey());
249    }
250    
251    public boolean getTransactionGlAccountCategoryPKHasBeenModified() {
252        return _value.getTransactionGlAccountCategoryPKHasBeenModified();
253    }
254    
255    public GlAccountPK getGlAccountPK() {
256        return _value.getGlAccountPK();
257    }
258    
259    public GlAccount getGlAccount(EntityPermission entityPermission) {
260        return GlAccountFactory.getInstance().getEntityFromPK(entityPermission, getGlAccountPK());
261    }
262    
263    public GlAccount getGlAccount() {
264        return getGlAccount(EntityPermission.READ_ONLY);
265    }
266    
267    public GlAccount getGlAccountForUpdate() {
268        return getGlAccount(EntityPermission.READ_WRITE);
269    }
270    
271    public void setGlAccountPK(GlAccountPK glAccountPK)
272            throws PersistenceNotNullException, PersistenceReadOnlyException {
273        checkReadWrite();
274        _value.setGlAccountPK(glAccountPK);
275    }
276    
277    public void setGlAccount(GlAccount entity) {
278        setGlAccountPK(entity == null? null: entity.getPrimaryKey());
279    }
280    
281    public boolean getGlAccountPKHasBeenModified() {
282        return _value.getGlAccountPKHasBeenModified();
283    }
284    
285    public CurrencyPK getOriginalCurrencyPK() {
286        return _value.getOriginalCurrencyPK();
287    }
288    
289    public Currency getOriginalCurrency(EntityPermission entityPermission) {
290        return CurrencyFactory.getInstance().getEntityFromPK(entityPermission, getOriginalCurrencyPK());
291    }
292    
293    public Currency getOriginalCurrency() {
294        return getOriginalCurrency(EntityPermission.READ_ONLY);
295    }
296    
297    public Currency getOriginalCurrencyForUpdate() {
298        return getOriginalCurrency(EntityPermission.READ_WRITE);
299    }
300    
301    public void setOriginalCurrencyPK(CurrencyPK originalCurrencyPK)
302            throws PersistenceNotNullException, PersistenceReadOnlyException {
303        checkReadWrite();
304        _value.setOriginalCurrencyPK(originalCurrencyPK);
305    }
306    
307    public void setOriginalCurrency(Currency entity) {
308        setOriginalCurrencyPK(entity == null? null: entity.getPrimaryKey());
309    }
310    
311    public boolean getOriginalCurrencyPKHasBeenModified() {
312        return _value.getOriginalCurrencyPKHasBeenModified();
313    }
314    
315    public Long getOriginalDebit() {
316        return _value.getOriginalDebit();
317    }
318    
319    public void setOriginalDebit(Long originalDebit)
320            throws PersistenceNotNullException, PersistenceReadOnlyException {
321        checkReadWrite();
322        _value.setOriginalDebit(originalDebit);
323    }
324    
325    public boolean getOriginalDebitHasBeenModified() {
326        return _value.getOriginalDebitHasBeenModified();
327    }
328    
329    public Long getOriginalCredit() {
330        return _value.getOriginalCredit();
331    }
332    
333    public void setOriginalCredit(Long originalCredit)
334            throws PersistenceNotNullException, PersistenceReadOnlyException {
335        checkReadWrite();
336        _value.setOriginalCredit(originalCredit);
337    }
338    
339    public boolean getOriginalCreditHasBeenModified() {
340        return _value.getOriginalCreditHasBeenModified();
341    }
342    
343    public Long getDebit() {
344        return _value.getDebit();
345    }
346    
347    public void setDebit(Long debit)
348            throws PersistenceNotNullException, PersistenceReadOnlyException {
349        checkReadWrite();
350        _value.setDebit(debit);
351    }
352    
353    public boolean getDebitHasBeenModified() {
354        return _value.getDebitHasBeenModified();
355    }
356    
357    public Long getCredit() {
358        return _value.getCredit();
359    }
360    
361    public void setCredit(Long credit)
362            throws PersistenceNotNullException, PersistenceReadOnlyException {
363        checkReadWrite();
364        _value.setCredit(credit);
365    }
366    
367    public boolean getCreditHasBeenModified() {
368        return _value.getCreditHasBeenModified();
369    }
370    
371    public Long getFromTime() {
372        return _value.getFromTime();
373    }
374    
375    public void setFromTime(Long fromTime)
376            throws PersistenceNotNullException, PersistenceReadOnlyException {
377        checkReadWrite();
378        _value.setFromTime(fromTime);
379    }
380    
381    public boolean getFromTimeHasBeenModified() {
382        return _value.getFromTimeHasBeenModified();
383    }
384    
385    public Long getThruTime() {
386        return _value.getThruTime();
387    }
388    
389    public void setThruTime(Long thruTime)
390            throws PersistenceNotNullException, PersistenceReadOnlyException {
391        checkReadWrite();
392        _value.setThruTime(thruTime);
393    }
394    
395    public boolean getThruTimeHasBeenModified() {
396        return _value.getThruTimeHasBeenModified();
397    }
398    
399}