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 * LetterSourceDetail.java
021 */
022
023package com.echothree.model.data.letter.server.entity;
024
025import com.echothree.model.data.letter.common.pk.LetterSourceDetailPK;
026
027import com.echothree.model.data.letter.common.pk.LetterSourcePK;
028import com.echothree.model.data.party.common.pk.PartyPK;
029import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
030
031import com.echothree.model.data.letter.server.entity.LetterSource;
032import com.echothree.model.data.party.server.entity.Party;
033import com.echothree.model.data.contact.server.entity.PartyContactMechanism;
034
035import com.echothree.model.data.letter.server.factory.LetterSourceFactory;
036import com.echothree.model.data.party.server.factory.PartyFactory;
037import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory;
038
039import com.echothree.model.data.letter.common.pk.LetterSourceDetailPK;
040
041import com.echothree.model.data.letter.server.value.LetterSourceDetailValue;
042
043import com.echothree.model.data.letter.server.factory.LetterSourceDetailFactory;
044
045import com.echothree.util.common.exception.PersistenceException;
046import com.echothree.util.common.exception.PersistenceDatabaseException;
047import com.echothree.util.common.exception.PersistenceNotNullException;
048import com.echothree.util.common.exception.PersistenceReadOnlyException;
049
050import com.echothree.util.common.persistence.BasePK;
051
052import com.echothree.util.common.persistence.type.ByteArray;
053
054import com.echothree.util.server.persistence.BaseEntity;
055import com.echothree.util.server.persistence.EntityPermission;
056import com.echothree.util.server.persistence.Session;
057import com.echothree.util.server.persistence.ThreadSession;
058
059import java.io.Serializable;
060
061public class LetterSourceDetail
062        extends BaseEntity
063        implements Serializable {
064    
065    private LetterSourceDetailPK _pk;
066    private LetterSourceDetailValue _value;
067    
068    /** Creates a new instance of LetterSourceDetail */
069    public LetterSourceDetail()
070            throws PersistenceException {
071        super();
072    }
073    
074    /** Creates a new instance of LetterSourceDetail */
075    public LetterSourceDetail(LetterSourceDetailValue value, EntityPermission entityPermission) {
076        super(entityPermission);
077        
078        _value = value;
079        _pk = value.getPrimaryKey();
080    }
081    
082    @Override
083    public LetterSourceDetailFactory getBaseFactoryInstance() {
084        return LetterSourceDetailFactory.getInstance();
085    }
086    
087    @Override
088    public boolean hasBeenModified() {
089        return _value.hasBeenModified();
090    }
091    
092    @Override
093    public int hashCode() {
094        return _pk.hashCode();
095    }
096    
097    @Override
098    public String toString() {
099        return _pk.toString();
100    }
101    
102    @Override
103    public boolean equals(Object other) {
104        if(this == other)
105            return true;
106        
107        if(other instanceof LetterSourceDetail that) {
108            LetterSourceDetailValue thatValue = that.getLetterSourceDetailValue();
109            return _value.equals(thatValue);
110        } else {
111            return false;
112        }
113    }
114    
115    @Override
116    public void store(Session session)
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().store(session, this);
119    }
120    
121    @Override
122    public void remove(Session session)
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().remove(session, this);
125    }
126    
127    @Override
128    public void remove()
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
131    }
132    
133    public LetterSourceDetailValue getLetterSourceDetailValue() {
134        return _value;
135    }
136    
137    public void setLetterSourceDetailValue(LetterSourceDetailValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    public LetterSourceDetailPK getPrimaryKey() {
145        return _pk;
146    }
147    
148    public LetterSourcePK getLetterSourcePK() {
149        return _value.getLetterSourcePK();
150    }
151    
152    public LetterSource getLetterSource(Session session, EntityPermission entityPermission) {
153        return LetterSourceFactory.getInstance().getEntityFromPK(session, entityPermission, getLetterSourcePK());
154    }
155    
156    public LetterSource getLetterSource(EntityPermission entityPermission) {
157        return getLetterSource(ThreadSession.currentSession(), entityPermission);
158    }
159    
160    public LetterSource getLetterSource(Session session) {
161        return getLetterSource(session, EntityPermission.READ_ONLY);
162    }
163    
164    public LetterSource getLetterSource() {
165        return getLetterSource(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
166    }
167    
168    public LetterSource getLetterSourceForUpdate(Session session) {
169        return getLetterSource(session, EntityPermission.READ_WRITE);
170    }
171    
172    public LetterSource getLetterSourceForUpdate() {
173        return getLetterSource(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
174    }
175    
176    public void setLetterSourcePK(LetterSourcePK letterSourcePK)
177            throws PersistenceNotNullException, PersistenceReadOnlyException {
178        checkReadWrite();
179        _value.setLetterSourcePK(letterSourcePK);
180    }
181    
182    public void setLetterSource(LetterSource entity) {
183        setLetterSourcePK(entity == null? null: entity.getPrimaryKey());
184    }
185    
186    public boolean getLetterSourcePKHasBeenModified() {
187        return _value.getLetterSourcePKHasBeenModified();
188    }
189    
190    public String getLetterSourceName() {
191        return _value.getLetterSourceName();
192    }
193    
194    public void setLetterSourceName(String letterSourceName)
195            throws PersistenceNotNullException, PersistenceReadOnlyException {
196        checkReadWrite();
197        _value.setLetterSourceName(letterSourceName);
198    }
199    
200    public boolean getLetterSourceNameHasBeenModified() {
201        return _value.getLetterSourceNameHasBeenModified();
202    }
203    
204    public PartyPK getCompanyPartyPK() {
205        return _value.getCompanyPartyPK();
206    }
207    
208    public Party getCompanyParty(Session session, EntityPermission entityPermission) {
209        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getCompanyPartyPK());
210    }
211    
212    public Party getCompanyParty(EntityPermission entityPermission) {
213        return getCompanyParty(ThreadSession.currentSession(), entityPermission);
214    }
215    
216    public Party getCompanyParty(Session session) {
217        return getCompanyParty(session, EntityPermission.READ_ONLY);
218    }
219    
220    public Party getCompanyParty() {
221        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
222    }
223    
224    public Party getCompanyPartyForUpdate(Session session) {
225        return getCompanyParty(session, EntityPermission.READ_WRITE);
226    }
227    
228    public Party getCompanyPartyForUpdate() {
229        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
230    }
231    
232    public void setCompanyPartyPK(PartyPK companyPartyPK)
233            throws PersistenceNotNullException, PersistenceReadOnlyException {
234        checkReadWrite();
235        _value.setCompanyPartyPK(companyPartyPK);
236    }
237    
238    public void setCompanyParty(Party entity) {
239        setCompanyPartyPK(entity == null? null: entity.getPrimaryKey());
240    }
241    
242    public boolean getCompanyPartyPKHasBeenModified() {
243        return _value.getCompanyPartyPKHasBeenModified();
244    }
245    
246    public PartyContactMechanismPK getEmailAddressPartyContactMechanismPK() {
247        return _value.getEmailAddressPartyContactMechanismPK();
248    }
249    
250    public PartyContactMechanism getEmailAddressPartyContactMechanism(Session session, EntityPermission entityPermission) {
251        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getEmailAddressPartyContactMechanismPK());
252    }
253    
254    public PartyContactMechanism getEmailAddressPartyContactMechanism(EntityPermission entityPermission) {
255        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
256    }
257    
258    public PartyContactMechanism getEmailAddressPartyContactMechanism(Session session) {
259        return getEmailAddressPartyContactMechanism(session, EntityPermission.READ_ONLY);
260    }
261    
262    public PartyContactMechanism getEmailAddressPartyContactMechanism() {
263        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
264    }
265    
266    public PartyContactMechanism getEmailAddressPartyContactMechanismForUpdate(Session session) {
267        return getEmailAddressPartyContactMechanism(session, EntityPermission.READ_WRITE);
268    }
269    
270    public PartyContactMechanism getEmailAddressPartyContactMechanismForUpdate() {
271        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
272    }
273    
274    public void setEmailAddressPartyContactMechanismPK(PartyContactMechanismPK emailAddressPartyContactMechanismPK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setEmailAddressPartyContactMechanismPK(emailAddressPartyContactMechanismPK);
278    }
279    
280    public void setEmailAddressPartyContactMechanism(PartyContactMechanism entity) {
281        setEmailAddressPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getEmailAddressPartyContactMechanismPKHasBeenModified() {
285        return _value.getEmailAddressPartyContactMechanismPKHasBeenModified();
286    }
287    
288    public PartyContactMechanismPK getPostalAddressPartyContactMechanismPK() {
289        return _value.getPostalAddressPartyContactMechanismPK();
290    }
291    
292    public PartyContactMechanism getPostalAddressPartyContactMechanism(Session session, EntityPermission entityPermission) {
293        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getPostalAddressPartyContactMechanismPK());
294    }
295    
296    public PartyContactMechanism getPostalAddressPartyContactMechanism(EntityPermission entityPermission) {
297        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
298    }
299    
300    public PartyContactMechanism getPostalAddressPartyContactMechanism(Session session) {
301        return getPostalAddressPartyContactMechanism(session, EntityPermission.READ_ONLY);
302    }
303    
304    public PartyContactMechanism getPostalAddressPartyContactMechanism() {
305        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
306    }
307    
308    public PartyContactMechanism getPostalAddressPartyContactMechanismForUpdate(Session session) {
309        return getPostalAddressPartyContactMechanism(session, EntityPermission.READ_WRITE);
310    }
311    
312    public PartyContactMechanism getPostalAddressPartyContactMechanismForUpdate() {
313        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
314    }
315    
316    public void setPostalAddressPartyContactMechanismPK(PartyContactMechanismPK postalAddressPartyContactMechanismPK)
317            throws PersistenceNotNullException, PersistenceReadOnlyException {
318        checkReadWrite();
319        _value.setPostalAddressPartyContactMechanismPK(postalAddressPartyContactMechanismPK);
320    }
321    
322    public void setPostalAddressPartyContactMechanism(PartyContactMechanism entity) {
323        setPostalAddressPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
324    }
325    
326    public boolean getPostalAddressPartyContactMechanismPKHasBeenModified() {
327        return _value.getPostalAddressPartyContactMechanismPKHasBeenModified();
328    }
329    
330    public PartyContactMechanismPK getLetterSourcePartyContactMechanismPK() {
331        return _value.getLetterSourcePartyContactMechanismPK();
332    }
333    
334    public PartyContactMechanism getLetterSourcePartyContactMechanism(Session session, EntityPermission entityPermission) {
335        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getLetterSourcePartyContactMechanismPK());
336    }
337    
338    public PartyContactMechanism getLetterSourcePartyContactMechanism(EntityPermission entityPermission) {
339        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), entityPermission);
340    }
341    
342    public PartyContactMechanism getLetterSourcePartyContactMechanism(Session session) {
343        return getLetterSourcePartyContactMechanism(session, EntityPermission.READ_ONLY);
344    }
345    
346    public PartyContactMechanism getLetterSourcePartyContactMechanism() {
347        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
348    }
349    
350    public PartyContactMechanism getLetterSourcePartyContactMechanismForUpdate(Session session) {
351        return getLetterSourcePartyContactMechanism(session, EntityPermission.READ_WRITE);
352    }
353    
354    public PartyContactMechanism getLetterSourcePartyContactMechanismForUpdate() {
355        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
356    }
357    
358    public void setLetterSourcePartyContactMechanismPK(PartyContactMechanismPK letterSourcePartyContactMechanismPK)
359            throws PersistenceNotNullException, PersistenceReadOnlyException {
360        checkReadWrite();
361        _value.setLetterSourcePartyContactMechanismPK(letterSourcePartyContactMechanismPK);
362    }
363    
364    public void setLetterSourcePartyContactMechanism(PartyContactMechanism entity) {
365        setLetterSourcePartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
366    }
367    
368    public boolean getLetterSourcePartyContactMechanismPKHasBeenModified() {
369        return _value.getLetterSourcePartyContactMechanismPKHasBeenModified();
370    }
371    
372    public Boolean getIsDefault() {
373        return _value.getIsDefault();
374    }
375    
376    public void setIsDefault(Boolean isDefault)
377            throws PersistenceNotNullException, PersistenceReadOnlyException {
378        checkReadWrite();
379        _value.setIsDefault(isDefault);
380    }
381    
382    public boolean getIsDefaultHasBeenModified() {
383        return _value.getIsDefaultHasBeenModified();
384    }
385    
386    public Integer getSortOrder() {
387        return _value.getSortOrder();
388    }
389    
390    public void setSortOrder(Integer sortOrder)
391            throws PersistenceNotNullException, PersistenceReadOnlyException {
392        checkReadWrite();
393        _value.setSortOrder(sortOrder);
394    }
395    
396    public boolean getSortOrderHasBeenModified() {
397        return _value.getSortOrderHasBeenModified();
398    }
399    
400    public Long getFromTime() {
401        return _value.getFromTime();
402    }
403    
404    public void setFromTime(Long fromTime)
405            throws PersistenceNotNullException, PersistenceReadOnlyException {
406        checkReadWrite();
407        _value.setFromTime(fromTime);
408    }
409    
410    public boolean getFromTimeHasBeenModified() {
411        return _value.getFromTimeHasBeenModified();
412    }
413    
414    public Long getThruTime() {
415        return _value.getThruTime();
416    }
417    
418    public void setThruTime(Long thruTime)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setThruTime(thruTime);
422    }
423    
424    public boolean getThruTimeHasBeenModified() {
425        return _value.getThruTimeHasBeenModified();
426    }
427    
428}