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 * ItemTaxClassificationDetail.java
021 */
022
023package com.echothree.model.data.tax.server.entity;
024
025import com.echothree.model.data.tax.common.pk.ItemTaxClassificationDetailPK;
026
027import com.echothree.model.data.tax.common.pk.ItemTaxClassificationPK;
028import com.echothree.model.data.item.common.pk.ItemPK;
029import com.echothree.model.data.geo.common.pk.GeoCodePK;
030import com.echothree.model.data.tax.common.pk.TaxClassificationPK;
031
032import com.echothree.model.data.tax.server.entity.ItemTaxClassification;
033import com.echothree.model.data.item.server.entity.Item;
034import com.echothree.model.data.geo.server.entity.GeoCode;
035import com.echothree.model.data.tax.server.entity.TaxClassification;
036
037import com.echothree.model.data.tax.server.factory.ItemTaxClassificationFactory;
038import com.echothree.model.data.item.server.factory.ItemFactory;
039import com.echothree.model.data.geo.server.factory.GeoCodeFactory;
040import com.echothree.model.data.tax.server.factory.TaxClassificationFactory;
041
042import com.echothree.model.data.tax.common.pk.ItemTaxClassificationDetailPK;
043
044import com.echothree.model.data.tax.server.value.ItemTaxClassificationDetailValue;
045
046import com.echothree.model.data.tax.server.factory.ItemTaxClassificationDetailFactory;
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 ItemTaxClassificationDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private ItemTaxClassificationDetailPK _pk;
069    private ItemTaxClassificationDetailValue _value;
070    
071    /** Creates a new instance of ItemTaxClassificationDetail */
072    public ItemTaxClassificationDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of ItemTaxClassificationDetail */
078    public ItemTaxClassificationDetail(ItemTaxClassificationDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public ItemTaxClassificationDetailFactory getBaseFactoryInstance() {
087        return ItemTaxClassificationDetailFactory.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 ItemTaxClassificationDetail that) {
111            ItemTaxClassificationDetailValue thatValue = that.getItemTaxClassificationDetailValue();
112            return _value.equals(thatValue);
113        } else {
114            return false;
115        }
116    }
117    
118    @Override
119    public void store(Session session)
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().store(session, this);
122    }
123    
124    @Override
125    public void remove(Session session)
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(session, this);
128    }
129    
130    @Override
131    public void remove()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
134    }
135    
136    public ItemTaxClassificationDetailValue getItemTaxClassificationDetailValue() {
137        return _value;
138    }
139    
140    public void setItemTaxClassificationDetailValue(ItemTaxClassificationDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public ItemTaxClassificationDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public ItemTaxClassificationPK getItemTaxClassificationPK() {
152        return _value.getItemTaxClassificationPK();
153    }
154    
155    public ItemTaxClassification getItemTaxClassification(Session session, EntityPermission entityPermission) {
156        return ItemTaxClassificationFactory.getInstance().getEntityFromPK(session, entityPermission, getItemTaxClassificationPK());
157    }
158    
159    public ItemTaxClassification getItemTaxClassification(EntityPermission entityPermission) {
160        return getItemTaxClassification(ThreadSession.currentSession(), entityPermission);
161    }
162    
163    public ItemTaxClassification getItemTaxClassification(Session session) {
164        return getItemTaxClassification(session, EntityPermission.READ_ONLY);
165    }
166    
167    public ItemTaxClassification getItemTaxClassification() {
168        return getItemTaxClassification(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
169    }
170    
171    public ItemTaxClassification getItemTaxClassificationForUpdate(Session session) {
172        return getItemTaxClassification(session, EntityPermission.READ_WRITE);
173    }
174    
175    public ItemTaxClassification getItemTaxClassificationForUpdate() {
176        return getItemTaxClassification(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
177    }
178    
179    public void setItemTaxClassificationPK(ItemTaxClassificationPK itemTaxClassificationPK)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setItemTaxClassificationPK(itemTaxClassificationPK);
183    }
184    
185    public void setItemTaxClassification(ItemTaxClassification entity) {
186        setItemTaxClassificationPK(entity == null? null: entity.getPrimaryKey());
187    }
188    
189    public boolean getItemTaxClassificationPKHasBeenModified() {
190        return _value.getItemTaxClassificationPKHasBeenModified();
191    }
192    
193    public ItemPK getItemPK() {
194        return _value.getItemPK();
195    }
196    
197    public Item getItem(Session session, EntityPermission entityPermission) {
198        return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK());
199    }
200    
201    public Item getItem(EntityPermission entityPermission) {
202        return getItem(ThreadSession.currentSession(), entityPermission);
203    }
204    
205    public Item getItem(Session session) {
206        return getItem(session, EntityPermission.READ_ONLY);
207    }
208    
209    public Item getItem() {
210        return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
211    }
212    
213    public Item getItemForUpdate(Session session) {
214        return getItem(session, EntityPermission.READ_WRITE);
215    }
216    
217    public Item getItemForUpdate() {
218        return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
219    }
220    
221    public void setItemPK(ItemPK itemPK)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setItemPK(itemPK);
225    }
226    
227    public void setItem(Item entity) {
228        setItemPK(entity == null? null: entity.getPrimaryKey());
229    }
230    
231    public boolean getItemPKHasBeenModified() {
232        return _value.getItemPKHasBeenModified();
233    }
234    
235    public GeoCodePK getCountryGeoCodePK() {
236        return _value.getCountryGeoCodePK();
237    }
238    
239    public GeoCode getCountryGeoCode(Session session, EntityPermission entityPermission) {
240        return GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getCountryGeoCodePK());
241    }
242    
243    public GeoCode getCountryGeoCode(EntityPermission entityPermission) {
244        return getCountryGeoCode(ThreadSession.currentSession(), entityPermission);
245    }
246    
247    public GeoCode getCountryGeoCode(Session session) {
248        return getCountryGeoCode(session, EntityPermission.READ_ONLY);
249    }
250    
251    public GeoCode getCountryGeoCode() {
252        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
253    }
254    
255    public GeoCode getCountryGeoCodeForUpdate(Session session) {
256        return getCountryGeoCode(session, EntityPermission.READ_WRITE);
257    }
258    
259    public GeoCode getCountryGeoCodeForUpdate() {
260        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
261    }
262    
263    public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK)
264            throws PersistenceNotNullException, PersistenceReadOnlyException {
265        checkReadWrite();
266        _value.setCountryGeoCodePK(countryGeoCodePK);
267    }
268    
269    public void setCountryGeoCode(GeoCode entity) {
270        setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey());
271    }
272    
273    public boolean getCountryGeoCodePKHasBeenModified() {
274        return _value.getCountryGeoCodePKHasBeenModified();
275    }
276    
277    public TaxClassificationPK getTaxClassificationPK() {
278        return _value.getTaxClassificationPK();
279    }
280    
281    public TaxClassification getTaxClassification(Session session, EntityPermission entityPermission) {
282        return TaxClassificationFactory.getInstance().getEntityFromPK(session, entityPermission, getTaxClassificationPK());
283    }
284    
285    public TaxClassification getTaxClassification(EntityPermission entityPermission) {
286        return getTaxClassification(ThreadSession.currentSession(), entityPermission);
287    }
288    
289    public TaxClassification getTaxClassification(Session session) {
290        return getTaxClassification(session, EntityPermission.READ_ONLY);
291    }
292    
293    public TaxClassification getTaxClassification() {
294        return getTaxClassification(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
295    }
296    
297    public TaxClassification getTaxClassificationForUpdate(Session session) {
298        return getTaxClassification(session, EntityPermission.READ_WRITE);
299    }
300    
301    public TaxClassification getTaxClassificationForUpdate() {
302        return getTaxClassification(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
303    }
304    
305    public void setTaxClassificationPK(TaxClassificationPK taxClassificationPK)
306            throws PersistenceNotNullException, PersistenceReadOnlyException {
307        checkReadWrite();
308        _value.setTaxClassificationPK(taxClassificationPK);
309    }
310    
311    public void setTaxClassification(TaxClassification entity) {
312        setTaxClassificationPK(entity == null? null: entity.getPrimaryKey());
313    }
314    
315    public boolean getTaxClassificationPKHasBeenModified() {
316        return _value.getTaxClassificationPKHasBeenModified();
317    }
318    
319    public Long getFromTime() {
320        return _value.getFromTime();
321    }
322    
323    public void setFromTime(Long fromTime)
324            throws PersistenceNotNullException, PersistenceReadOnlyException {
325        checkReadWrite();
326        _value.setFromTime(fromTime);
327    }
328    
329    public boolean getFromTimeHasBeenModified() {
330        return _value.getFromTimeHasBeenModified();
331    }
332    
333    public Long getThruTime() {
334        return _value.getThruTime();
335    }
336    
337    public void setThruTime(Long thruTime)
338            throws PersistenceNotNullException, PersistenceReadOnlyException {
339        checkReadWrite();
340        _value.setThruTime(thruTime);
341    }
342    
343    public boolean getThruTimeHasBeenModified() {
344        return _value.getThruTimeHasBeenModified();
345    }
346    
347}