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 * 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) {
108            LetterSourceDetail that = (LetterSourceDetail)other;
109            
110            LetterSourceDetailValue thatValue = that.getLetterSourceDetailValue();
111            return _value.equals(thatValue);
112        } else {
113            return false;
114        }
115    }
116    
117    @Override
118    public void store(Session session)
119            throws PersistenceDatabaseException {
120        getBaseFactoryInstance().store(session, this);
121    }
122    
123    @Override
124    public void remove(Session session)
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().remove(session, this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
133    }
134    
135    public LetterSourceDetailValue getLetterSourceDetailValue() {
136        return _value;
137    }
138    
139    public void setLetterSourceDetailValue(LetterSourceDetailValue value)
140            throws PersistenceReadOnlyException {
141        checkReadWrite();
142        _value = value;
143    }
144    
145    @Override
146    public LetterSourceDetailPK getPrimaryKey() {
147        return _pk;
148    }
149    
150    public LetterSourcePK getLetterSourcePK() {
151        return _value.getLetterSourcePK();
152    }
153    
154    public LetterSource getLetterSource(Session session, EntityPermission entityPermission) {
155        return LetterSourceFactory.getInstance().getEntityFromPK(session, entityPermission, getLetterSourcePK());
156    }
157    
158    public LetterSource getLetterSource(EntityPermission entityPermission) {
159        return getLetterSource(ThreadSession.currentSession(), entityPermission);
160    }
161    
162    public LetterSource getLetterSource(Session session) {
163        return getLetterSource(session, EntityPermission.READ_ONLY);
164    }
165    
166    public LetterSource getLetterSource() {
167        return getLetterSource(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
168    }
169    
170    public LetterSource getLetterSourceForUpdate(Session session) {
171        return getLetterSource(session, EntityPermission.READ_WRITE);
172    }
173    
174    public LetterSource getLetterSourceForUpdate() {
175        return getLetterSource(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
176    }
177    
178    public void setLetterSourcePK(LetterSourcePK letterSourcePK)
179            throws PersistenceNotNullException, PersistenceReadOnlyException {
180        checkReadWrite();
181        _value.setLetterSourcePK(letterSourcePK);
182    }
183    
184    public void setLetterSource(LetterSource entity) {
185        setLetterSourcePK(entity == null? null: entity.getPrimaryKey());
186    }
187    
188    public boolean getLetterSourcePKHasBeenModified() {
189        return _value.getLetterSourcePKHasBeenModified();
190    }
191    
192    public String getLetterSourceName() {
193        return _value.getLetterSourceName();
194    }
195    
196    public void setLetterSourceName(String letterSourceName)
197            throws PersistenceNotNullException, PersistenceReadOnlyException {
198        checkReadWrite();
199        _value.setLetterSourceName(letterSourceName);
200    }
201    
202    public boolean getLetterSourceNameHasBeenModified() {
203        return _value.getLetterSourceNameHasBeenModified();
204    }
205    
206    public PartyPK getCompanyPartyPK() {
207        return _value.getCompanyPartyPK();
208    }
209    
210    public Party getCompanyParty(Session session, EntityPermission entityPermission) {
211        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getCompanyPartyPK());
212    }
213    
214    public Party getCompanyParty(EntityPermission entityPermission) {
215        return getCompanyParty(ThreadSession.currentSession(), entityPermission);
216    }
217    
218    public Party getCompanyParty(Session session) {
219        return getCompanyParty(session, EntityPermission.READ_ONLY);
220    }
221    
222    public Party getCompanyParty() {
223        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
224    }
225    
226    public Party getCompanyPartyForUpdate(Session session) {
227        return getCompanyParty(session, EntityPermission.READ_WRITE);
228    }
229    
230    public Party getCompanyPartyForUpdate() {
231        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
232    }
233    
234    public void setCompanyPartyPK(PartyPK companyPartyPK)
235            throws PersistenceNotNullException, PersistenceReadOnlyException {
236        checkReadWrite();
237        _value.setCompanyPartyPK(companyPartyPK);
238    }
239    
240    public void setCompanyParty(Party entity) {
241        setCompanyPartyPK(entity == null? null: entity.getPrimaryKey());
242    }
243    
244    public boolean getCompanyPartyPKHasBeenModified() {
245        return _value.getCompanyPartyPKHasBeenModified();
246    }
247    
248    public PartyContactMechanismPK getEmailAddressPartyContactMechanismPK() {
249        return _value.getEmailAddressPartyContactMechanismPK();
250    }
251    
252    public PartyContactMechanism getEmailAddressPartyContactMechanism(Session session, EntityPermission entityPermission) {
253        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getEmailAddressPartyContactMechanismPK());
254    }
255    
256    public PartyContactMechanism getEmailAddressPartyContactMechanism(EntityPermission entityPermission) {
257        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
258    }
259    
260    public PartyContactMechanism getEmailAddressPartyContactMechanism(Session session) {
261        return getEmailAddressPartyContactMechanism(session, EntityPermission.READ_ONLY);
262    }
263    
264    public PartyContactMechanism getEmailAddressPartyContactMechanism() {
265        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
266    }
267    
268    public PartyContactMechanism getEmailAddressPartyContactMechanismForUpdate(Session session) {
269        return getEmailAddressPartyContactMechanism(session, EntityPermission.READ_WRITE);
270    }
271    
272    public PartyContactMechanism getEmailAddressPartyContactMechanismForUpdate() {
273        return getEmailAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
274    }
275    
276    public void setEmailAddressPartyContactMechanismPK(PartyContactMechanismPK emailAddressPartyContactMechanismPK)
277            throws PersistenceNotNullException, PersistenceReadOnlyException {
278        checkReadWrite();
279        _value.setEmailAddressPartyContactMechanismPK(emailAddressPartyContactMechanismPK);
280    }
281    
282    public void setEmailAddressPartyContactMechanism(PartyContactMechanism entity) {
283        setEmailAddressPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
284    }
285    
286    public boolean getEmailAddressPartyContactMechanismPKHasBeenModified() {
287        return _value.getEmailAddressPartyContactMechanismPKHasBeenModified();
288    }
289    
290    public PartyContactMechanismPK getPostalAddressPartyContactMechanismPK() {
291        return _value.getPostalAddressPartyContactMechanismPK();
292    }
293    
294    public PartyContactMechanism getPostalAddressPartyContactMechanism(Session session, EntityPermission entityPermission) {
295        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getPostalAddressPartyContactMechanismPK());
296    }
297    
298    public PartyContactMechanism getPostalAddressPartyContactMechanism(EntityPermission entityPermission) {
299        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
300    }
301    
302    public PartyContactMechanism getPostalAddressPartyContactMechanism(Session session) {
303        return getPostalAddressPartyContactMechanism(session, EntityPermission.READ_ONLY);
304    }
305    
306    public PartyContactMechanism getPostalAddressPartyContactMechanism() {
307        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
308    }
309    
310    public PartyContactMechanism getPostalAddressPartyContactMechanismForUpdate(Session session) {
311        return getPostalAddressPartyContactMechanism(session, EntityPermission.READ_WRITE);
312    }
313    
314    public PartyContactMechanism getPostalAddressPartyContactMechanismForUpdate() {
315        return getPostalAddressPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
316    }
317    
318    public void setPostalAddressPartyContactMechanismPK(PartyContactMechanismPK postalAddressPartyContactMechanismPK)
319            throws PersistenceNotNullException, PersistenceReadOnlyException {
320        checkReadWrite();
321        _value.setPostalAddressPartyContactMechanismPK(postalAddressPartyContactMechanismPK);
322    }
323    
324    public void setPostalAddressPartyContactMechanism(PartyContactMechanism entity) {
325        setPostalAddressPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
326    }
327    
328    public boolean getPostalAddressPartyContactMechanismPKHasBeenModified() {
329        return _value.getPostalAddressPartyContactMechanismPKHasBeenModified();
330    }
331    
332    public PartyContactMechanismPK getLetterSourcePartyContactMechanismPK() {
333        return _value.getLetterSourcePartyContactMechanismPK();
334    }
335    
336    public PartyContactMechanism getLetterSourcePartyContactMechanism(Session session, EntityPermission entityPermission) {
337        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getLetterSourcePartyContactMechanismPK());
338    }
339    
340    public PartyContactMechanism getLetterSourcePartyContactMechanism(EntityPermission entityPermission) {
341        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), entityPermission);
342    }
343    
344    public PartyContactMechanism getLetterSourcePartyContactMechanism(Session session) {
345        return getLetterSourcePartyContactMechanism(session, EntityPermission.READ_ONLY);
346    }
347    
348    public PartyContactMechanism getLetterSourcePartyContactMechanism() {
349        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
350    }
351    
352    public PartyContactMechanism getLetterSourcePartyContactMechanismForUpdate(Session session) {
353        return getLetterSourcePartyContactMechanism(session, EntityPermission.READ_WRITE);
354    }
355    
356    public PartyContactMechanism getLetterSourcePartyContactMechanismForUpdate() {
357        return getLetterSourcePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
358    }
359    
360    public void setLetterSourcePartyContactMechanismPK(PartyContactMechanismPK letterSourcePartyContactMechanismPK)
361            throws PersistenceNotNullException, PersistenceReadOnlyException {
362        checkReadWrite();
363        _value.setLetterSourcePartyContactMechanismPK(letterSourcePartyContactMechanismPK);
364    }
365    
366    public void setLetterSourcePartyContactMechanism(PartyContactMechanism entity) {
367        setLetterSourcePartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
368    }
369    
370    public boolean getLetterSourcePartyContactMechanismPKHasBeenModified() {
371        return _value.getLetterSourcePartyContactMechanismPKHasBeenModified();
372    }
373    
374    public Boolean getIsDefault() {
375        return _value.getIsDefault();
376    }
377    
378    public void setIsDefault(Boolean isDefault)
379            throws PersistenceNotNullException, PersistenceReadOnlyException {
380        checkReadWrite();
381        _value.setIsDefault(isDefault);
382    }
383    
384    public boolean getIsDefaultHasBeenModified() {
385        return _value.getIsDefaultHasBeenModified();
386    }
387    
388    public Integer getSortOrder() {
389        return _value.getSortOrder();
390    }
391    
392    public void setSortOrder(Integer sortOrder)
393            throws PersistenceNotNullException, PersistenceReadOnlyException {
394        checkReadWrite();
395        _value.setSortOrder(sortOrder);
396    }
397    
398    public boolean getSortOrderHasBeenModified() {
399        return _value.getSortOrderHasBeenModified();
400    }
401    
402    public Long getFromTime() {
403        return _value.getFromTime();
404    }
405    
406    public void setFromTime(Long fromTime)
407            throws PersistenceNotNullException, PersistenceReadOnlyException {
408        checkReadWrite();
409        _value.setFromTime(fromTime);
410    }
411    
412    public boolean getFromTimeHasBeenModified() {
413        return _value.getFromTimeHasBeenModified();
414    }
415    
416    public Long getThruTime() {
417        return _value.getThruTime();
418    }
419    
420    public void setThruTime(Long thruTime)
421            throws PersistenceNotNullException, PersistenceReadOnlyException {
422        checkReadWrite();
423        _value.setThruTime(thruTime);
424    }
425    
426    public boolean getThruTimeHasBeenModified() {
427        return _value.getThruTimeHasBeenModified();
428    }
429    
430}