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 * ContactPostalAddressCorrection.java
021 */
022
023package com.echothree.model.data.contact.server.entity;
024
025import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK;
026
027import com.echothree.model.data.contact.common.pk.ContactMechanismPK;
028import com.echothree.model.data.geo.common.pk.GeoCodePK;
029
030import com.echothree.model.data.contact.server.entity.ContactMechanism;
031import com.echothree.model.data.geo.server.entity.GeoCode;
032
033import com.echothree.model.data.contact.server.factory.ContactMechanismFactory;
034import com.echothree.model.data.geo.server.factory.GeoCodeFactory;
035
036import com.echothree.model.data.contact.common.pk.ContactPostalAddressCorrectionPK;
037
038import com.echothree.model.data.contact.server.value.ContactPostalAddressCorrectionValue;
039
040import com.echothree.model.data.contact.server.factory.ContactPostalAddressCorrectionFactory;
041
042import com.echothree.util.common.exception.PersistenceException;
043import com.echothree.util.common.exception.PersistenceDatabaseException;
044import com.echothree.util.common.exception.PersistenceNotNullException;
045import com.echothree.util.common.exception.PersistenceReadOnlyException;
046
047import com.echothree.util.common.persistence.BasePK;
048
049import com.echothree.util.common.persistence.type.ByteArray;
050
051import com.echothree.util.server.persistence.BaseEntity;
052import com.echothree.util.server.persistence.EntityPermission;
053import com.echothree.util.server.persistence.Session;
054import com.echothree.util.server.persistence.ThreadSession;
055
056import java.io.Serializable;
057
058public class ContactPostalAddressCorrection
059        extends BaseEntity
060        implements Serializable {
061    
062    private ContactPostalAddressCorrectionPK _pk;
063    private ContactPostalAddressCorrectionValue _value;
064    
065    /** Creates a new instance of ContactPostalAddressCorrection */
066    public ContactPostalAddressCorrection()
067            throws PersistenceException {
068        super();
069    }
070    
071    /** Creates a new instance of ContactPostalAddressCorrection */
072    public ContactPostalAddressCorrection(ContactPostalAddressCorrectionValue value, EntityPermission entityPermission) {
073        super(entityPermission);
074        
075        _value = value;
076        _pk = value.getPrimaryKey();
077    }
078    
079    @Override
080    public ContactPostalAddressCorrectionFactory getBaseFactoryInstance() {
081        return ContactPostalAddressCorrectionFactory.getInstance();
082    }
083    
084    @Override
085    public boolean hasBeenModified() {
086        return _value.hasBeenModified();
087    }
088    
089    @Override
090    public int hashCode() {
091        return _pk.hashCode();
092    }
093    
094    @Override
095    public String toString() {
096        return _pk.toString();
097    }
098    
099    @Override
100    public boolean equals(Object other) {
101        if(this == other)
102            return true;
103        
104        if(other instanceof ContactPostalAddressCorrection that) {
105            ContactPostalAddressCorrectionValue thatValue = that.getContactPostalAddressCorrectionValue();
106            return _value.equals(thatValue);
107        } else {
108            return false;
109        }
110    }
111    
112    @Override
113    public void store(Session session)
114            throws PersistenceDatabaseException {
115        getBaseFactoryInstance().store(session, this);
116    }
117    
118    @Override
119    public void remove(Session session)
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().remove(session, this);
122    }
123    
124    @Override
125    public void remove()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
128    }
129    
130    public ContactPostalAddressCorrectionValue getContactPostalAddressCorrectionValue() {
131        return _value;
132    }
133    
134    public void setContactPostalAddressCorrectionValue(ContactPostalAddressCorrectionValue value)
135            throws PersistenceReadOnlyException {
136        checkReadWrite();
137        _value = value;
138    }
139    
140    @Override
141    public ContactPostalAddressCorrectionPK getPrimaryKey() {
142        return _pk;
143    }
144    
145    public ContactMechanismPK getContactMechanismPK() {
146        return _value.getContactMechanismPK();
147    }
148    
149    public ContactMechanism getContactMechanism(Session session, EntityPermission entityPermission) {
150        return ContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getContactMechanismPK());
151    }
152    
153    public ContactMechanism getContactMechanism(EntityPermission entityPermission) {
154        return getContactMechanism(ThreadSession.currentSession(), entityPermission);
155    }
156    
157    public ContactMechanism getContactMechanism(Session session) {
158        return getContactMechanism(session, EntityPermission.READ_ONLY);
159    }
160    
161    public ContactMechanism getContactMechanism() {
162        return getContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
163    }
164    
165    public ContactMechanism getContactMechanismForUpdate(Session session) {
166        return getContactMechanism(session, EntityPermission.READ_WRITE);
167    }
168    
169    public ContactMechanism getContactMechanismForUpdate() {
170        return getContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
171    }
172    
173    public void setContactMechanismPK(ContactMechanismPK contactMechanismPK)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setContactMechanismPK(contactMechanismPK);
177    }
178    
179    public void setContactMechanism(ContactMechanism entity) {
180        setContactMechanismPK(entity == null? null: entity.getPrimaryKey());
181    }
182    
183    public boolean getContactMechanismPKHasBeenModified() {
184        return _value.getContactMechanismPKHasBeenModified();
185    }
186    
187    public String getAddress1() {
188        return _value.getAddress1();
189    }
190    
191    public void setAddress1(String address1)
192            throws PersistenceNotNullException, PersistenceReadOnlyException {
193        checkReadWrite();
194        _value.setAddress1(address1);
195    }
196    
197    public boolean getAddress1HasBeenModified() {
198        return _value.getAddress1HasBeenModified();
199    }
200    
201    public String getAddress2() {
202        return _value.getAddress2();
203    }
204    
205    public void setAddress2(String address2)
206            throws PersistenceNotNullException, PersistenceReadOnlyException {
207        checkReadWrite();
208        _value.setAddress2(address2);
209    }
210    
211    public boolean getAddress2HasBeenModified() {
212        return _value.getAddress2HasBeenModified();
213    }
214    
215    public String getAddress3() {
216        return _value.getAddress3();
217    }
218    
219    public void setAddress3(String address3)
220            throws PersistenceNotNullException, PersistenceReadOnlyException {
221        checkReadWrite();
222        _value.setAddress3(address3);
223    }
224    
225    public boolean getAddress3HasBeenModified() {
226        return _value.getAddress3HasBeenModified();
227    }
228    
229    public String getCity() {
230        return _value.getCity();
231    }
232    
233    public void setCity(String city)
234            throws PersistenceNotNullException, PersistenceReadOnlyException {
235        checkReadWrite();
236        _value.setCity(city);
237    }
238    
239    public boolean getCityHasBeenModified() {
240        return _value.getCityHasBeenModified();
241    }
242    
243    public GeoCodePK getCityGeoCodePK() {
244        return _value.getCityGeoCodePK();
245    }
246    
247    public GeoCode getCityGeoCode(Session session, EntityPermission entityPermission) {
248        GeoCodePK pk = getCityGeoCodePK();
249        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
250        
251        return entity;
252    }
253    
254    public GeoCode getCityGeoCode(EntityPermission entityPermission) {
255        return getCityGeoCode(ThreadSession.currentSession(), entityPermission);
256    }
257    
258    public GeoCode getCityGeoCode(Session session) {
259        return getCityGeoCode(session, EntityPermission.READ_ONLY);
260    }
261    
262    public GeoCode getCityGeoCode() {
263        return getCityGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
264    }
265    
266    public GeoCode getCityGeoCodeForUpdate(Session session) {
267        return getCityGeoCode(session, EntityPermission.READ_WRITE);
268    }
269    
270    public GeoCode getCityGeoCodeForUpdate() {
271        return getCityGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
272    }
273    
274    public void setCityGeoCodePK(GeoCodePK cityGeoCodePK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setCityGeoCodePK(cityGeoCodePK);
278    }
279    
280    public void setCityGeoCode(GeoCode entity) {
281        setCityGeoCodePK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getCityGeoCodePKHasBeenModified() {
285        return _value.getCityGeoCodePKHasBeenModified();
286    }
287    
288    public GeoCodePK getCountyGeoCodePK() {
289        return _value.getCountyGeoCodePK();
290    }
291    
292    public GeoCode getCountyGeoCode(Session session, EntityPermission entityPermission) {
293        GeoCodePK pk = getCountyGeoCodePK();
294        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
295        
296        return entity;
297    }
298    
299    public GeoCode getCountyGeoCode(EntityPermission entityPermission) {
300        return getCountyGeoCode(ThreadSession.currentSession(), entityPermission);
301    }
302    
303    public GeoCode getCountyGeoCode(Session session) {
304        return getCountyGeoCode(session, EntityPermission.READ_ONLY);
305    }
306    
307    public GeoCode getCountyGeoCode() {
308        return getCountyGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
309    }
310    
311    public GeoCode getCountyGeoCodeForUpdate(Session session) {
312        return getCountyGeoCode(session, EntityPermission.READ_WRITE);
313    }
314    
315    public GeoCode getCountyGeoCodeForUpdate() {
316        return getCountyGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
317    }
318    
319    public void setCountyGeoCodePK(GeoCodePK countyGeoCodePK)
320            throws PersistenceNotNullException, PersistenceReadOnlyException {
321        checkReadWrite();
322        _value.setCountyGeoCodePK(countyGeoCodePK);
323    }
324    
325    public void setCountyGeoCode(GeoCode entity) {
326        setCountyGeoCodePK(entity == null? null: entity.getPrimaryKey());
327    }
328    
329    public boolean getCountyGeoCodePKHasBeenModified() {
330        return _value.getCountyGeoCodePKHasBeenModified();
331    }
332    
333    public String getState() {
334        return _value.getState();
335    }
336    
337    public void setState(String state)
338            throws PersistenceNotNullException, PersistenceReadOnlyException {
339        checkReadWrite();
340        _value.setState(state);
341    }
342    
343    public boolean getStateHasBeenModified() {
344        return _value.getStateHasBeenModified();
345    }
346    
347    public GeoCodePK getStateGeoCodePK() {
348        return _value.getStateGeoCodePK();
349    }
350    
351    public GeoCode getStateGeoCode(Session session, EntityPermission entityPermission) {
352        GeoCodePK pk = getStateGeoCodePK();
353        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
354        
355        return entity;
356    }
357    
358    public GeoCode getStateGeoCode(EntityPermission entityPermission) {
359        return getStateGeoCode(ThreadSession.currentSession(), entityPermission);
360    }
361    
362    public GeoCode getStateGeoCode(Session session) {
363        return getStateGeoCode(session, EntityPermission.READ_ONLY);
364    }
365    
366    public GeoCode getStateGeoCode() {
367        return getStateGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
368    }
369    
370    public GeoCode getStateGeoCodeForUpdate(Session session) {
371        return getStateGeoCode(session, EntityPermission.READ_WRITE);
372    }
373    
374    public GeoCode getStateGeoCodeForUpdate() {
375        return getStateGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
376    }
377    
378    public void setStateGeoCodePK(GeoCodePK stateGeoCodePK)
379            throws PersistenceNotNullException, PersistenceReadOnlyException {
380        checkReadWrite();
381        _value.setStateGeoCodePK(stateGeoCodePK);
382    }
383    
384    public void setStateGeoCode(GeoCode entity) {
385        setStateGeoCodePK(entity == null? null: entity.getPrimaryKey());
386    }
387    
388    public boolean getStateGeoCodePKHasBeenModified() {
389        return _value.getStateGeoCodePKHasBeenModified();
390    }
391    
392    public String getPostalCode() {
393        return _value.getPostalCode();
394    }
395    
396    public void setPostalCode(String postalCode)
397            throws PersistenceNotNullException, PersistenceReadOnlyException {
398        checkReadWrite();
399        _value.setPostalCode(postalCode);
400    }
401    
402    public boolean getPostalCodeHasBeenModified() {
403        return _value.getPostalCodeHasBeenModified();
404    }
405    
406    public GeoCodePK getPostalCodeGeoCodePK() {
407        return _value.getPostalCodeGeoCodePK();
408    }
409    
410    public GeoCode getPostalCodeGeoCode(Session session, EntityPermission entityPermission) {
411        GeoCodePK pk = getPostalCodeGeoCodePK();
412        GeoCode entity = pk == null? null: GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
413        
414        return entity;
415    }
416    
417    public GeoCode getPostalCodeGeoCode(EntityPermission entityPermission) {
418        return getPostalCodeGeoCode(ThreadSession.currentSession(), entityPermission);
419    }
420    
421    public GeoCode getPostalCodeGeoCode(Session session) {
422        return getPostalCodeGeoCode(session, EntityPermission.READ_ONLY);
423    }
424    
425    public GeoCode getPostalCodeGeoCode() {
426        return getPostalCodeGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
427    }
428    
429    public GeoCode getPostalCodeGeoCodeForUpdate(Session session) {
430        return getPostalCodeGeoCode(session, EntityPermission.READ_WRITE);
431    }
432    
433    public GeoCode getPostalCodeGeoCodeForUpdate() {
434        return getPostalCodeGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
435    }
436    
437    public void setPostalCodeGeoCodePK(GeoCodePK postalCodeGeoCodePK)
438            throws PersistenceNotNullException, PersistenceReadOnlyException {
439        checkReadWrite();
440        _value.setPostalCodeGeoCodePK(postalCodeGeoCodePK);
441    }
442    
443    public void setPostalCodeGeoCode(GeoCode entity) {
444        setPostalCodeGeoCodePK(entity == null? null: entity.getPrimaryKey());
445    }
446    
447    public boolean getPostalCodeGeoCodePKHasBeenModified() {
448        return _value.getPostalCodeGeoCodePKHasBeenModified();
449    }
450    
451    public GeoCodePK getCountryGeoCodePK() {
452        return _value.getCountryGeoCodePK();
453    }
454    
455    public GeoCode getCountryGeoCode(Session session, EntityPermission entityPermission) {
456        return GeoCodeFactory.getInstance().getEntityFromPK(session, entityPermission, getCountryGeoCodePK());
457    }
458    
459    public GeoCode getCountryGeoCode(EntityPermission entityPermission) {
460        return getCountryGeoCode(ThreadSession.currentSession(), entityPermission);
461    }
462    
463    public GeoCode getCountryGeoCode(Session session) {
464        return getCountryGeoCode(session, EntityPermission.READ_ONLY);
465    }
466    
467    public GeoCode getCountryGeoCode() {
468        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
469    }
470    
471    public GeoCode getCountryGeoCodeForUpdate(Session session) {
472        return getCountryGeoCode(session, EntityPermission.READ_WRITE);
473    }
474    
475    public GeoCode getCountryGeoCodeForUpdate() {
476        return getCountryGeoCode(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
477    }
478    
479    public void setCountryGeoCodePK(GeoCodePK countryGeoCodePK)
480            throws PersistenceNotNullException, PersistenceReadOnlyException {
481        checkReadWrite();
482        _value.setCountryGeoCodePK(countryGeoCodePK);
483    }
484    
485    public void setCountryGeoCode(GeoCode entity) {
486        setCountryGeoCodePK(entity == null? null: entity.getPrimaryKey());
487    }
488    
489    public boolean getCountryGeoCodePKHasBeenModified() {
490        return _value.getCountryGeoCodePKHasBeenModified();
491    }
492    
493    public Long getFromTime() {
494        return _value.getFromTime();
495    }
496    
497    public void setFromTime(Long fromTime)
498            throws PersistenceNotNullException, PersistenceReadOnlyException {
499        checkReadWrite();
500        _value.setFromTime(fromTime);
501    }
502    
503    public boolean getFromTimeHasBeenModified() {
504        return _value.getFromTimeHasBeenModified();
505    }
506    
507    public Long getThruTime() {
508        return _value.getThruTime();
509    }
510    
511    public void setThruTime(Long thruTime)
512            throws PersistenceNotNullException, PersistenceReadOnlyException {
513        checkReadWrite();
514        _value.setThruTime(thruTime);
515    }
516    
517    public boolean getThruTimeHasBeenModified() {
518        return _value.getThruTimeHasBeenModified();
519    }
520    
521}