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 * TransactionDetail.java
021 */
022
023package com.echothree.model.data.accounting.server.entity;
024
025import com.echothree.model.data.accounting.common.pk.TransactionDetailPK;
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.TransactionGroupPK;
030import com.echothree.model.data.accounting.common.pk.TransactionTypePK;
031
032import com.echothree.model.data.accounting.server.entity.Transaction;
033import com.echothree.model.data.party.server.entity.Party;
034import com.echothree.model.data.accounting.server.entity.TransactionGroup;
035import com.echothree.model.data.accounting.server.entity.TransactionType;
036
037import com.echothree.model.data.accounting.server.factory.TransactionFactory;
038import com.echothree.model.data.party.server.factory.PartyFactory;
039import com.echothree.model.data.accounting.server.factory.TransactionGroupFactory;
040import com.echothree.model.data.accounting.server.factory.TransactionTypeFactory;
041
042import com.echothree.model.data.accounting.common.pk.TransactionDetailPK;
043
044import com.echothree.model.data.accounting.server.value.TransactionDetailValue;
045
046import com.echothree.model.data.accounting.server.factory.TransactionDetailFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064public class TransactionDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private TransactionDetailPK _pk;
069    private TransactionDetailValue _value;
070    
071    /** Creates a new instance of TransactionDetail */
072    public TransactionDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of TransactionDetail */
078    public TransactionDetail(TransactionDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public TransactionDetailFactory getBaseFactoryInstance() {
087        return TransactionDetailFactory.getInstance();
088    }
089    
090    @Override
091    public boolean hasBeenModified() {
092        return _value.hasBeenModified();
093    }
094    
095    @Override
096    public int hashCode() {
097        return _pk.hashCode();
098    }
099    
100    @Override
101    public String toString() {
102        return _pk.toString();
103    }
104    
105    @Override
106    public boolean equals(Object other) {
107        if(this == other)
108            return true;
109        
110        if(other instanceof TransactionDetail that) {
111            TransactionDetailValue thatValue = that.getTransactionDetailValue();
112            return _value.equals(thatValue);
113        } else {
114            return false;
115        }
116    }
117    
118    @Override
119    public void store()
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().store(this);
122    }
123    
124    @Override
125    public void remove()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(this);
128    }
129    
130    public TransactionDetailValue getTransactionDetailValue() {
131        return _value;
132    }
133    
134    public void setTransactionDetailValue(TransactionDetailValue value)
135            throws PersistenceReadOnlyException {
136        checkReadWrite();
137        _value = value;
138    }
139    
140    @Override
141    public TransactionDetailPK getPrimaryKey() {
142        return _pk;
143    }
144    
145    public TransactionPK getTransactionPK() {
146        return _value.getTransactionPK();
147    }
148    
149    public Transaction getTransaction(EntityPermission entityPermission) {
150        return TransactionFactory.getInstance().getEntityFromPK(entityPermission, getTransactionPK());
151    }
152    
153    public Transaction getTransaction() {
154        return getTransaction(EntityPermission.READ_ONLY);
155    }
156    
157    public Transaction getTransactionForUpdate() {
158        return getTransaction(EntityPermission.READ_WRITE);
159    }
160    
161    public void setTransactionPK(TransactionPK transactionPK)
162            throws PersistenceNotNullException, PersistenceReadOnlyException {
163        checkReadWrite();
164        _value.setTransactionPK(transactionPK);
165    }
166    
167    public void setTransaction(Transaction entity) {
168        setTransactionPK(entity == null? null: entity.getPrimaryKey());
169    }
170    
171    public boolean getTransactionPKHasBeenModified() {
172        return _value.getTransactionPKHasBeenModified();
173    }
174    
175    public String getTransactionName() {
176        return _value.getTransactionName();
177    }
178    
179    public void setTransactionName(String transactionName)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setTransactionName(transactionName);
183    }
184    
185    public boolean getTransactionNameHasBeenModified() {
186        return _value.getTransactionNameHasBeenModified();
187    }
188    
189    public PartyPK getGroupPartyPK() {
190        return _value.getGroupPartyPK();
191    }
192    
193    public Party getGroupParty(EntityPermission entityPermission) {
194        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getGroupPartyPK());
195    }
196    
197    public Party getGroupParty() {
198        return getGroupParty(EntityPermission.READ_ONLY);
199    }
200    
201    public Party getGroupPartyForUpdate() {
202        return getGroupParty(EntityPermission.READ_WRITE);
203    }
204    
205    public void setGroupPartyPK(PartyPK groupPartyPK)
206            throws PersistenceNotNullException, PersistenceReadOnlyException {
207        checkReadWrite();
208        _value.setGroupPartyPK(groupPartyPK);
209    }
210    
211    public void setGroupParty(Party entity) {
212        setGroupPartyPK(entity == null? null: entity.getPrimaryKey());
213    }
214    
215    public boolean getGroupPartyPKHasBeenModified() {
216        return _value.getGroupPartyPKHasBeenModified();
217    }
218    
219    public TransactionGroupPK getTransactionGroupPK() {
220        return _value.getTransactionGroupPK();
221    }
222    
223    public TransactionGroup getTransactionGroup(EntityPermission entityPermission) {
224        return TransactionGroupFactory.getInstance().getEntityFromPK(entityPermission, getTransactionGroupPK());
225    }
226    
227    public TransactionGroup getTransactionGroup() {
228        return getTransactionGroup(EntityPermission.READ_ONLY);
229    }
230    
231    public TransactionGroup getTransactionGroupForUpdate() {
232        return getTransactionGroup(EntityPermission.READ_WRITE);
233    }
234    
235    public void setTransactionGroupPK(TransactionGroupPK transactionGroupPK)
236            throws PersistenceNotNullException, PersistenceReadOnlyException {
237        checkReadWrite();
238        _value.setTransactionGroupPK(transactionGroupPK);
239    }
240    
241    public void setTransactionGroup(TransactionGroup entity) {
242        setTransactionGroupPK(entity == null? null: entity.getPrimaryKey());
243    }
244    
245    public boolean getTransactionGroupPKHasBeenModified() {
246        return _value.getTransactionGroupPKHasBeenModified();
247    }
248    
249    public TransactionTypePK getTransactionTypePK() {
250        return _value.getTransactionTypePK();
251    }
252    
253    public TransactionType getTransactionType(EntityPermission entityPermission) {
254        return TransactionTypeFactory.getInstance().getEntityFromPK(entityPermission, getTransactionTypePK());
255    }
256    
257    public TransactionType getTransactionType() {
258        return getTransactionType(EntityPermission.READ_ONLY);
259    }
260    
261    public TransactionType getTransactionTypeForUpdate() {
262        return getTransactionType(EntityPermission.READ_WRITE);
263    }
264    
265    public void setTransactionTypePK(TransactionTypePK transactionTypePK)
266            throws PersistenceNotNullException, PersistenceReadOnlyException {
267        checkReadWrite();
268        _value.setTransactionTypePK(transactionTypePK);
269    }
270    
271    public void setTransactionType(TransactionType entity) {
272        setTransactionTypePK(entity == null? null: entity.getPrimaryKey());
273    }
274    
275    public boolean getTransactionTypePKHasBeenModified() {
276        return _value.getTransactionTypePKHasBeenModified();
277    }
278    
279    public Long getFromTime() {
280        return _value.getFromTime();
281    }
282    
283    public void setFromTime(Long fromTime)
284            throws PersistenceNotNullException, PersistenceReadOnlyException {
285        checkReadWrite();
286        _value.setFromTime(fromTime);
287    }
288    
289    public boolean getFromTimeHasBeenModified() {
290        return _value.getFromTimeHasBeenModified();
291    }
292    
293    public Long getThruTime() {
294        return _value.getThruTime();
295    }
296    
297    public void setThruTime(Long thruTime)
298            throws PersistenceNotNullException, PersistenceReadOnlyException {
299        checkReadWrite();
300        _value.setThruTime(thruTime);
301    }
302    
303    public boolean getThruTimeHasBeenModified() {
304        return _value.getThruTimeHasBeenModified();
305    }
306    
307}