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