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 * ItemHarmonizedTariffScheduleCodeDetail.java
021 */
022
023package com.echothree.model.data.item.server.entity;
024
025import com.echothree.model.data.item.common.pk.ItemHarmonizedTariffScheduleCodeDetailPK;
026
027import com.echothree.model.data.item.common.pk.ItemHarmonizedTariffScheduleCodePK;
028import com.echothree.model.data.item.common.pk.ItemPK;
029import com.echothree.model.data.geo.common.pk.GeoCodePK;
030import com.echothree.model.data.item.common.pk.HarmonizedTariffScheduleCodeUseTypePK;
031import com.echothree.model.data.item.common.pk.HarmonizedTariffScheduleCodePK;
032
033import com.echothree.model.data.item.server.entity.ItemHarmonizedTariffScheduleCode;
034import com.echothree.model.data.item.server.entity.Item;
035import com.echothree.model.data.geo.server.entity.GeoCode;
036import com.echothree.model.data.item.server.entity.HarmonizedTariffScheduleCodeUseType;
037import com.echothree.model.data.item.server.entity.HarmonizedTariffScheduleCode;
038
039import com.echothree.model.data.item.server.factory.ItemHarmonizedTariffScheduleCodeFactory;
040import com.echothree.model.data.item.server.factory.ItemFactory;
041import com.echothree.model.data.geo.server.factory.GeoCodeFactory;
042import com.echothree.model.data.item.server.factory.HarmonizedTariffScheduleCodeUseTypeFactory;
043import com.echothree.model.data.item.server.factory.HarmonizedTariffScheduleCodeFactory;
044
045import com.echothree.model.data.item.common.pk.ItemHarmonizedTariffScheduleCodeDetailPK;
046
047import com.echothree.model.data.item.server.value.ItemHarmonizedTariffScheduleCodeDetailValue;
048
049import com.echothree.model.data.item.server.factory.ItemHarmonizedTariffScheduleCodeDetailFactory;
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 ItemHarmonizedTariffScheduleCodeDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private ItemHarmonizedTariffScheduleCodeDetailPK _pk;
072    private ItemHarmonizedTariffScheduleCodeDetailValue _value;
073    
074    /** Creates a new instance of ItemHarmonizedTariffScheduleCodeDetail */
075    public ItemHarmonizedTariffScheduleCodeDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of ItemHarmonizedTariffScheduleCodeDetail */
081    public ItemHarmonizedTariffScheduleCodeDetail(ItemHarmonizedTariffScheduleCodeDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    public ItemHarmonizedTariffScheduleCodeDetailFactory getBaseFactoryInstance() {
090        return ItemHarmonizedTariffScheduleCodeDetailFactory.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 ItemHarmonizedTariffScheduleCodeDetail) {
114            ItemHarmonizedTariffScheduleCodeDetail that = (ItemHarmonizedTariffScheduleCodeDetail)other;
115            
116            ItemHarmonizedTariffScheduleCodeDetailValue thatValue = that.getItemHarmonizedTariffScheduleCodeDetailValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store(Session session)
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(session, this);
127    }
128    
129    @Override
130    public void remove(Session session)
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(session, this);
133    }
134    
135    @Override
136    public void remove()
137            throws PersistenceDatabaseException {
138        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
139    }
140    
141    public ItemHarmonizedTariffScheduleCodeDetailValue getItemHarmonizedTariffScheduleCodeDetailValue() {
142        return _value;
143    }
144    
145    public void setItemHarmonizedTariffScheduleCodeDetailValue(ItemHarmonizedTariffScheduleCodeDetailValue value)
146            throws PersistenceReadOnlyException {
147        checkReadWrite();
148        _value = value;
149    }
150    
151    @Override
152    public ItemHarmonizedTariffScheduleCodeDetailPK getPrimaryKey() {
153        return _pk;
154    }
155    
156    public ItemHarmonizedTariffScheduleCodePK getItemHarmonizedTariffScheduleCodePK() {
157        return _value.getItemHarmonizedTariffScheduleCodePK();
158    }
159    
160    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCode(Session session, EntityPermission entityPermission) {
161        return ItemHarmonizedTariffScheduleCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getItemHarmonizedTariffScheduleCodePK());
162    }
163    
164    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCode(EntityPermission entityPermission) {
165        return getItemHarmonizedTariffScheduleCode(ThreadSession.currentSession(), entityPermission);
166    }
167    
168    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCode(Session session) {
169        return getItemHarmonizedTariffScheduleCode(session, EntityPermission.READ_ONLY);
170    }
171    
172    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCode() {
173        return getItemHarmonizedTariffScheduleCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
174    }
175    
176    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCodeForUpdate(Session session) {
177        return getItemHarmonizedTariffScheduleCode(session, EntityPermission.READ_WRITE);
178    }
179    
180    public ItemHarmonizedTariffScheduleCode getItemHarmonizedTariffScheduleCodeForUpdate() {
181        return getItemHarmonizedTariffScheduleCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
182    }
183    
184    public void setItemHarmonizedTariffScheduleCodePK(ItemHarmonizedTariffScheduleCodePK itemHarmonizedTariffScheduleCodePK)
185            throws PersistenceNotNullException, PersistenceReadOnlyException {
186        checkReadWrite();
187        _value.setItemHarmonizedTariffScheduleCodePK(itemHarmonizedTariffScheduleCodePK);
188    }
189    
190    public void setItemHarmonizedTariffScheduleCode(ItemHarmonizedTariffScheduleCode entity) {
191        setItemHarmonizedTariffScheduleCodePK(entity == null? null: entity.getPrimaryKey());
192    }
193    
194    public boolean getItemHarmonizedTariffScheduleCodePKHasBeenModified() {
195        return _value.getItemHarmonizedTariffScheduleCodePKHasBeenModified();
196    }
197    
198    public ItemPK getItemPK() {
199        return _value.getItemPK();
200    }
201    
202    public Item getItem(Session session, EntityPermission entityPermission) {
203        return ItemFactory.getInstance().getEntityFromPK(session, entityPermission, getItemPK());
204    }
205    
206    public Item getItem(EntityPermission entityPermission) {
207        return getItem(ThreadSession.currentSession(), entityPermission);
208    }
209    
210    public Item getItem(Session session) {
211        return getItem(session, EntityPermission.READ_ONLY);
212    }
213    
214    public Item getItem() {
215        return getItem(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
216    }
217    
218    public Item getItemForUpdate(Session session) {
219        return getItem(session, EntityPermission.READ_WRITE);
220    }
221    
222    public Item getItemForUpdate() {
223        return getItem(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
224    }
225    
226    public void setItemPK(ItemPK itemPK)
227            throws PersistenceNotNullException, PersistenceReadOnlyException {
228        checkReadWrite();
229        _value.setItemPK(itemPK);
230    }
231    
232    public void setItem(Item entity) {
233        setItemPK(entity == null? null: entity.getPrimaryKey());
234    }
235    
236    public boolean getItemPKHasBeenModified() {
237        return _value.getItemPKHasBeenModified();
238    }
239    
240    public GeoCodePK getCountryGeoCodePK() {
241        return _value.getCountryGeoCodePK();
242    }
243    
244    public GeoCode getCountryGeoCode(Session session, EntityPermission entityPermission) {
245        return GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getCountryGeoCodePK());
246    }
247    
248    public GeoCode getCountryGeoCode(EntityPermission entityPermission) {
249        return getCountryGeoCode(ThreadSession.currentSession(), entityPermission);
250    }
251    
252    public GeoCode getCountryGeoCode(Session session) {
253        return getCountryGeoCode(session, EntityPermission.READ_ONLY);
254    }
255    
256    public GeoCode getCountryGeoCode() {
257        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
258    }
259    
260    public GeoCode getCountryGeoCodeForUpdate(Session session) {
261        return getCountryGeoCode(session, EntityPermission.READ_WRITE);
262    }
263    
264    public GeoCode getCountryGeoCodeForUpdate() {
265        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
266    }
267    
268    public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK)
269            throws PersistenceNotNullException, PersistenceReadOnlyException {
270        checkReadWrite();
271        _value.setCountryGeoCodePK(countryGeoCodePK);
272    }
273    
274    public void setCountryGeoCode(GeoCode entity) {
275        setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey());
276    }
277    
278    public boolean getCountryGeoCodePKHasBeenModified() {
279        return _value.getCountryGeoCodePKHasBeenModified();
280    }
281    
282    public HarmonizedTariffScheduleCodeUseTypePK getHarmonizedTariffScheduleCodeUseTypePK() {
283        return _value.getHarmonizedTariffScheduleCodeUseTypePK();
284    }
285    
286    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseType(Session session, EntityPermission entityPermission) {
287        return HarmonizedTariffScheduleCodeUseTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getHarmonizedTariffScheduleCodeUseTypePK());
288    }
289    
290    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseType(EntityPermission entityPermission) {
291        return getHarmonizedTariffScheduleCodeUseType(ThreadSession.currentSession(), entityPermission);
292    }
293    
294    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseType(Session session) {
295        return getHarmonizedTariffScheduleCodeUseType(session, EntityPermission.READ_ONLY);
296    }
297    
298    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseType() {
299        return getHarmonizedTariffScheduleCodeUseType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
300    }
301    
302    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseTypeForUpdate(Session session) {
303        return getHarmonizedTariffScheduleCodeUseType(session, EntityPermission.READ_WRITE);
304    }
305    
306    public HarmonizedTariffScheduleCodeUseType getHarmonizedTariffScheduleCodeUseTypeForUpdate() {
307        return getHarmonizedTariffScheduleCodeUseType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
308    }
309    
310    public void setHarmonizedTariffScheduleCodeUseTypePK(HarmonizedTariffScheduleCodeUseTypePK harmonizedTariffScheduleCodeUseTypePK)
311            throws PersistenceNotNullException, PersistenceReadOnlyException {
312        checkReadWrite();
313        _value.setHarmonizedTariffScheduleCodeUseTypePK(harmonizedTariffScheduleCodeUseTypePK);
314    }
315    
316    public void setHarmonizedTariffScheduleCodeUseType(HarmonizedTariffScheduleCodeUseType entity) {
317        setHarmonizedTariffScheduleCodeUseTypePK(entity == null? null: entity.getPrimaryKey());
318    }
319    
320    public boolean getHarmonizedTariffScheduleCodeUseTypePKHasBeenModified() {
321        return _value.getHarmonizedTariffScheduleCodeUseTypePKHasBeenModified();
322    }
323    
324    public HarmonizedTariffScheduleCodePK getHarmonizedTariffScheduleCodePK() {
325        return _value.getHarmonizedTariffScheduleCodePK();
326    }
327    
328    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCode(Session session, EntityPermission entityPermission) {
329        return HarmonizedTariffScheduleCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getHarmonizedTariffScheduleCodePK());
330    }
331    
332    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCode(EntityPermission entityPermission) {
333        return getHarmonizedTariffScheduleCode(ThreadSession.currentSession(), entityPermission);
334    }
335    
336    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCode(Session session) {
337        return getHarmonizedTariffScheduleCode(session, EntityPermission.READ_ONLY);
338    }
339    
340    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCode() {
341        return getHarmonizedTariffScheduleCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
342    }
343    
344    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCodeForUpdate(Session session) {
345        return getHarmonizedTariffScheduleCode(session, EntityPermission.READ_WRITE);
346    }
347    
348    public HarmonizedTariffScheduleCode getHarmonizedTariffScheduleCodeForUpdate() {
349        return getHarmonizedTariffScheduleCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
350    }
351    
352    public void setHarmonizedTariffScheduleCodePK(HarmonizedTariffScheduleCodePK harmonizedTariffScheduleCodePK)
353            throws PersistenceNotNullException, PersistenceReadOnlyException {
354        checkReadWrite();
355        _value.setHarmonizedTariffScheduleCodePK(harmonizedTariffScheduleCodePK);
356    }
357    
358    public void setHarmonizedTariffScheduleCode(HarmonizedTariffScheduleCode entity) {
359        setHarmonizedTariffScheduleCodePK(entity == null? null: entity.getPrimaryKey());
360    }
361    
362    public boolean getHarmonizedTariffScheduleCodePKHasBeenModified() {
363        return _value.getHarmonizedTariffScheduleCodePKHasBeenModified();
364    }
365    
366    public Long getFromTime() {
367        return _value.getFromTime();
368    }
369    
370    public void setFromTime(Long fromTime)
371            throws PersistenceNotNullException, PersistenceReadOnlyException {
372        checkReadWrite();
373        _value.setFromTime(fromTime);
374    }
375    
376    public boolean getFromTimeHasBeenModified() {
377        return _value.getFromTimeHasBeenModified();
378    }
379    
380    public Long getThruTime() {
381        return _value.getThruTime();
382    }
383    
384    public void setThruTime(Long thruTime)
385            throws PersistenceNotNullException, PersistenceReadOnlyException {
386        checkReadWrite();
387        _value.setThruTime(thruTime);
388    }
389    
390    public boolean getThruTimeHasBeenModified() {
391        return _value.getThruTimeHasBeenModified();
392    }
393    
394}