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 * CommunicationEventDetail.java
021 */
022
023package com.echothree.model.data.communication.server.entity;
024
025import com.echothree.model.data.communication.common.pk.CommunicationEventDetailPK;
026
027import com.echothree.model.data.communication.common.pk.CommunicationEventPK;
028import com.echothree.model.data.communication.common.pk.CommunicationEventTypePK;
029import com.echothree.model.data.communication.common.pk.CommunicationSourcePK;
030import com.echothree.model.data.communication.common.pk.CommunicationEventPurposePK;
031import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
032import com.echothree.model.data.document.common.pk.DocumentPK;
033
034import com.echothree.model.data.communication.server.entity.CommunicationEvent;
035import com.echothree.model.data.communication.server.entity.CommunicationEventType;
036import com.echothree.model.data.communication.server.entity.CommunicationSource;
037import com.echothree.model.data.communication.server.entity.CommunicationEventPurpose;
038import com.echothree.model.data.contact.server.entity.PartyContactMechanism;
039import com.echothree.model.data.document.server.entity.Document;
040
041import com.echothree.model.data.communication.server.factory.CommunicationEventFactory;
042import com.echothree.model.data.communication.server.factory.CommunicationEventTypeFactory;
043import com.echothree.model.data.communication.server.factory.CommunicationSourceFactory;
044import com.echothree.model.data.communication.server.factory.CommunicationEventPurposeFactory;
045import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory;
046import com.echothree.model.data.document.server.factory.DocumentFactory;
047
048import com.echothree.model.data.communication.common.pk.CommunicationEventDetailPK;
049
050import com.echothree.model.data.communication.server.value.CommunicationEventDetailValue;
051
052import com.echothree.model.data.communication.server.factory.CommunicationEventDetailFactory;
053
054import com.echothree.util.common.exception.PersistenceException;
055import com.echothree.util.common.exception.PersistenceDatabaseException;
056import com.echothree.util.common.exception.PersistenceNotNullException;
057import com.echothree.util.common.exception.PersistenceReadOnlyException;
058
059import com.echothree.util.common.persistence.BasePK;
060
061import com.echothree.util.common.persistence.type.ByteArray;
062
063import com.echothree.util.server.persistence.BaseEntity;
064import com.echothree.util.server.persistence.EntityPermission;
065import com.echothree.util.server.persistence.Session;
066import com.echothree.util.server.persistence.ThreadSession;
067
068import java.io.Serializable;
069
070public class CommunicationEventDetail
071        extends BaseEntity
072        implements Serializable {
073    
074    private CommunicationEventDetailPK _pk;
075    private CommunicationEventDetailValue _value;
076    
077    /** Creates a new instance of CommunicationEventDetail */
078    public CommunicationEventDetail()
079            throws PersistenceException {
080        super();
081    }
082    
083    /** Creates a new instance of CommunicationEventDetail */
084    public CommunicationEventDetail(CommunicationEventDetailValue value, EntityPermission entityPermission) {
085        super(entityPermission);
086        
087        _value = value;
088        _pk = value.getPrimaryKey();
089    }
090    
091    @Override
092    public CommunicationEventDetailFactory getBaseFactoryInstance() {
093        return CommunicationEventDetailFactory.getInstance();
094    }
095    
096    @Override
097    public boolean hasBeenModified() {
098        return _value.hasBeenModified();
099    }
100    
101    @Override
102    public int hashCode() {
103        return _pk.hashCode();
104    }
105    
106    @Override
107    public String toString() {
108        return _pk.toString();
109    }
110    
111    @Override
112    public boolean equals(Object other) {
113        if(this == other)
114            return true;
115        
116        if(other instanceof CommunicationEventDetail that) {
117            CommunicationEventDetailValue thatValue = that.getCommunicationEventDetailValue();
118            return _value.equals(thatValue);
119        } else {
120            return false;
121        }
122    }
123    
124    @Override
125    public void store(Session session)
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().store(session, this);
128    }
129    
130    @Override
131    public void remove(Session session)
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(session, this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
140    }
141    
142    public CommunicationEventDetailValue getCommunicationEventDetailValue() {
143        return _value;
144    }
145    
146    public void setCommunicationEventDetailValue(CommunicationEventDetailValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public CommunicationEventDetailPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public CommunicationEventPK getCommunicationEventPK() {
158        return _value.getCommunicationEventPK();
159    }
160    
161    public CommunicationEvent getCommunicationEvent(Session session, EntityPermission entityPermission) {
162        return CommunicationEventFactory.getInstance().getEntityFromPK(session, entityPermission, getCommunicationEventPK());
163    }
164    
165    public CommunicationEvent getCommunicationEvent(EntityPermission entityPermission) {
166        return getCommunicationEvent(ThreadSession.currentSession(), entityPermission);
167    }
168    
169    public CommunicationEvent getCommunicationEvent(Session session) {
170        return getCommunicationEvent(session, EntityPermission.READ_ONLY);
171    }
172    
173    public CommunicationEvent getCommunicationEvent() {
174        return getCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
175    }
176    
177    public CommunicationEvent getCommunicationEventForUpdate(Session session) {
178        return getCommunicationEvent(session, EntityPermission.READ_WRITE);
179    }
180    
181    public CommunicationEvent getCommunicationEventForUpdate() {
182        return getCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
183    }
184    
185    public void setCommunicationEventPK(CommunicationEventPK communicationEventPK)
186            throws PersistenceNotNullException, PersistenceReadOnlyException {
187        checkReadWrite();
188        _value.setCommunicationEventPK(communicationEventPK);
189    }
190    
191    public void setCommunicationEvent(CommunicationEvent entity) {
192        setCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
193    }
194    
195    public boolean getCommunicationEventPKHasBeenModified() {
196        return _value.getCommunicationEventPKHasBeenModified();
197    }
198    
199    public String getCommunicationEventName() {
200        return _value.getCommunicationEventName();
201    }
202    
203    public void setCommunicationEventName(String communicationEventName)
204            throws PersistenceNotNullException, PersistenceReadOnlyException {
205        checkReadWrite();
206        _value.setCommunicationEventName(communicationEventName);
207    }
208    
209    public boolean getCommunicationEventNameHasBeenModified() {
210        return _value.getCommunicationEventNameHasBeenModified();
211    }
212    
213    public CommunicationEventTypePK getCommunicationEventTypePK() {
214        return _value.getCommunicationEventTypePK();
215    }
216    
217    public CommunicationEventType getCommunicationEventType(Session session, EntityPermission entityPermission) {
218        return CommunicationEventTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getCommunicationEventTypePK());
219    }
220    
221    public CommunicationEventType getCommunicationEventType(EntityPermission entityPermission) {
222        return getCommunicationEventType(ThreadSession.currentSession(), entityPermission);
223    }
224    
225    public CommunicationEventType getCommunicationEventType(Session session) {
226        return getCommunicationEventType(session, EntityPermission.READ_ONLY);
227    }
228    
229    public CommunicationEventType getCommunicationEventType() {
230        return getCommunicationEventType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
231    }
232    
233    public CommunicationEventType getCommunicationEventTypeForUpdate(Session session) {
234        return getCommunicationEventType(session, EntityPermission.READ_WRITE);
235    }
236    
237    public CommunicationEventType getCommunicationEventTypeForUpdate() {
238        return getCommunicationEventType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
239    }
240    
241    public void setCommunicationEventTypePK(CommunicationEventTypePK communicationEventTypePK)
242            throws PersistenceNotNullException, PersistenceReadOnlyException {
243        checkReadWrite();
244        _value.setCommunicationEventTypePK(communicationEventTypePK);
245    }
246    
247    public void setCommunicationEventType(CommunicationEventType entity) {
248        setCommunicationEventTypePK(entity == null? null: entity.getPrimaryKey());
249    }
250    
251    public boolean getCommunicationEventTypePKHasBeenModified() {
252        return _value.getCommunicationEventTypePKHasBeenModified();
253    }
254    
255    public CommunicationSourcePK getCommunicationSourcePK() {
256        return _value.getCommunicationSourcePK();
257    }
258    
259    public CommunicationSource getCommunicationSource(Session session, EntityPermission entityPermission) {
260        CommunicationSourcePK pk = getCommunicationSourcePK();
261        CommunicationSource entity = pk == null? null: CommunicationSourceFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
262        
263        return entity;
264    }
265    
266    public CommunicationSource getCommunicationSource(EntityPermission entityPermission) {
267        return getCommunicationSource(ThreadSession.currentSession(), entityPermission);
268    }
269    
270    public CommunicationSource getCommunicationSource(Session session) {
271        return getCommunicationSource(session, EntityPermission.READ_ONLY);
272    }
273    
274    public CommunicationSource getCommunicationSource() {
275        return getCommunicationSource(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
276    }
277    
278    public CommunicationSource getCommunicationSourceForUpdate(Session session) {
279        return getCommunicationSource(session, EntityPermission.READ_WRITE);
280    }
281    
282    public CommunicationSource getCommunicationSourceForUpdate() {
283        return getCommunicationSource(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
284    }
285    
286    public void setCommunicationSourcePK(CommunicationSourcePK communicationSourcePK)
287            throws PersistenceNotNullException, PersistenceReadOnlyException {
288        checkReadWrite();
289        _value.setCommunicationSourcePK(communicationSourcePK);
290    }
291    
292    public void setCommunicationSource(CommunicationSource entity) {
293        setCommunicationSourcePK(entity == null? null: entity.getPrimaryKey());
294    }
295    
296    public boolean getCommunicationSourcePKHasBeenModified() {
297        return _value.getCommunicationSourcePKHasBeenModified();
298    }
299    
300    public CommunicationEventPurposePK getCommunicationEventPurposePK() {
301        return _value.getCommunicationEventPurposePK();
302    }
303    
304    public CommunicationEventPurpose getCommunicationEventPurpose(Session session, EntityPermission entityPermission) {
305        return CommunicationEventPurposeFactory.getInstance().getEntityFromPK(session, entityPermission, getCommunicationEventPurposePK());
306    }
307    
308    public CommunicationEventPurpose getCommunicationEventPurpose(EntityPermission entityPermission) {
309        return getCommunicationEventPurpose(ThreadSession.currentSession(), entityPermission);
310    }
311    
312    public CommunicationEventPurpose getCommunicationEventPurpose(Session session) {
313        return getCommunicationEventPurpose(session, EntityPermission.READ_ONLY);
314    }
315    
316    public CommunicationEventPurpose getCommunicationEventPurpose() {
317        return getCommunicationEventPurpose(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
318    }
319    
320    public CommunicationEventPurpose getCommunicationEventPurposeForUpdate(Session session) {
321        return getCommunicationEventPurpose(session, EntityPermission.READ_WRITE);
322    }
323    
324    public CommunicationEventPurpose getCommunicationEventPurposeForUpdate() {
325        return getCommunicationEventPurpose(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
326    }
327    
328    public void setCommunicationEventPurposePK(CommunicationEventPurposePK communicationEventPurposePK)
329            throws PersistenceNotNullException, PersistenceReadOnlyException {
330        checkReadWrite();
331        _value.setCommunicationEventPurposePK(communicationEventPurposePK);
332    }
333    
334    public void setCommunicationEventPurpose(CommunicationEventPurpose entity) {
335        setCommunicationEventPurposePK(entity == null? null: entity.getPrimaryKey());
336    }
337    
338    public boolean getCommunicationEventPurposePKHasBeenModified() {
339        return _value.getCommunicationEventPurposePKHasBeenModified();
340    }
341    
342    public CommunicationEventPK getOriginalCommunicationEventPK() {
343        return _value.getOriginalCommunicationEventPK();
344    }
345    
346    public CommunicationEvent getOriginalCommunicationEvent(Session session, EntityPermission entityPermission) {
347        CommunicationEventPK pk = getOriginalCommunicationEventPK();
348        CommunicationEvent entity = pk == null? null: CommunicationEventFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
349        
350        return entity;
351    }
352    
353    public CommunicationEvent getOriginalCommunicationEvent(EntityPermission entityPermission) {
354        return getOriginalCommunicationEvent(ThreadSession.currentSession(), entityPermission);
355    }
356    
357    public CommunicationEvent getOriginalCommunicationEvent(Session session) {
358        return getOriginalCommunicationEvent(session, EntityPermission.READ_ONLY);
359    }
360    
361    public CommunicationEvent getOriginalCommunicationEvent() {
362        return getOriginalCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
363    }
364    
365    public CommunicationEvent getOriginalCommunicationEventForUpdate(Session session) {
366        return getOriginalCommunicationEvent(session, EntityPermission.READ_WRITE);
367    }
368    
369    public CommunicationEvent getOriginalCommunicationEventForUpdate() {
370        return getOriginalCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
371    }
372    
373    public void setOriginalCommunicationEventPK(CommunicationEventPK originalCommunicationEventPK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setOriginalCommunicationEventPK(originalCommunicationEventPK);
377    }
378    
379    public void setOriginalCommunicationEvent(CommunicationEvent entity) {
380        setOriginalCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getOriginalCommunicationEventPKHasBeenModified() {
384        return _value.getOriginalCommunicationEventPKHasBeenModified();
385    }
386    
387    public CommunicationEventPK getParentCommunicationEventPK() {
388        return _value.getParentCommunicationEventPK();
389    }
390    
391    public CommunicationEvent getParentCommunicationEvent(Session session, EntityPermission entityPermission) {
392        CommunicationEventPK pk = getParentCommunicationEventPK();
393        CommunicationEvent entity = pk == null? null: CommunicationEventFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
394        
395        return entity;
396    }
397    
398    public CommunicationEvent getParentCommunicationEvent(EntityPermission entityPermission) {
399        return getParentCommunicationEvent(ThreadSession.currentSession(), entityPermission);
400    }
401    
402    public CommunicationEvent getParentCommunicationEvent(Session session) {
403        return getParentCommunicationEvent(session, EntityPermission.READ_ONLY);
404    }
405    
406    public CommunicationEvent getParentCommunicationEvent() {
407        return getParentCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
408    }
409    
410    public CommunicationEvent getParentCommunicationEventForUpdate(Session session) {
411        return getParentCommunicationEvent(session, EntityPermission.READ_WRITE);
412    }
413    
414    public CommunicationEvent getParentCommunicationEventForUpdate() {
415        return getParentCommunicationEvent(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
416    }
417    
418    public void setParentCommunicationEventPK(CommunicationEventPK parentCommunicationEventPK)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setParentCommunicationEventPK(parentCommunicationEventPK);
422    }
423    
424    public void setParentCommunicationEvent(CommunicationEvent entity) {
425        setParentCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
426    }
427    
428    public boolean getParentCommunicationEventPKHasBeenModified() {
429        return _value.getParentCommunicationEventPKHasBeenModified();
430    }
431    
432    public PartyContactMechanismPK getPartyContactMechanismPK() {
433        return _value.getPartyContactMechanismPK();
434    }
435    
436    public PartyContactMechanism getPartyContactMechanism(Session session, EntityPermission entityPermission) {
437        return PartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyContactMechanismPK());
438    }
439    
440    public PartyContactMechanism getPartyContactMechanism(EntityPermission entityPermission) {
441        return getPartyContactMechanism(ThreadSession.currentSession(), entityPermission);
442    }
443    
444    public PartyContactMechanism getPartyContactMechanism(Session session) {
445        return getPartyContactMechanism(session, EntityPermission.READ_ONLY);
446    }
447    
448    public PartyContactMechanism getPartyContactMechanism() {
449        return getPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
450    }
451    
452    public PartyContactMechanism getPartyContactMechanismForUpdate(Session session) {
453        return getPartyContactMechanism(session, EntityPermission.READ_WRITE);
454    }
455    
456    public PartyContactMechanism getPartyContactMechanismForUpdate() {
457        return getPartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
458    }
459    
460    public void setPartyContactMechanismPK(PartyContactMechanismPK partyContactMechanismPK)
461            throws PersistenceNotNullException, PersistenceReadOnlyException {
462        checkReadWrite();
463        _value.setPartyContactMechanismPK(partyContactMechanismPK);
464    }
465    
466    public void setPartyContactMechanism(PartyContactMechanism entity) {
467        setPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
468    }
469    
470    public boolean getPartyContactMechanismPKHasBeenModified() {
471        return _value.getPartyContactMechanismPKHasBeenModified();
472    }
473    
474    public DocumentPK getDocumentPK() {
475        return _value.getDocumentPK();
476    }
477    
478    public Document getDocument(Session session, EntityPermission entityPermission) {
479        return DocumentFactory.getInstance().getEntityFromPK(session, entityPermission, getDocumentPK());
480    }
481    
482    public Document getDocument(EntityPermission entityPermission) {
483        return getDocument(ThreadSession.currentSession(), entityPermission);
484    }
485    
486    public Document getDocument(Session session) {
487        return getDocument(session, EntityPermission.READ_ONLY);
488    }
489    
490    public Document getDocument() {
491        return getDocument(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
492    }
493    
494    public Document getDocumentForUpdate(Session session) {
495        return getDocument(session, EntityPermission.READ_WRITE);
496    }
497    
498    public Document getDocumentForUpdate() {
499        return getDocument(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
500    }
501    
502    public void setDocumentPK(DocumentPK documentPK)
503            throws PersistenceNotNullException, PersistenceReadOnlyException {
504        checkReadWrite();
505        _value.setDocumentPK(documentPK);
506    }
507    
508    public void setDocument(Document entity) {
509        setDocumentPK(entity == null? null: entity.getPrimaryKey());
510    }
511    
512    public boolean getDocumentPKHasBeenModified() {
513        return _value.getDocumentPKHasBeenModified();
514    }
515    
516    public Long getFromTime() {
517        return _value.getFromTime();
518    }
519    
520    public void setFromTime(Long fromTime)
521            throws PersistenceNotNullException, PersistenceReadOnlyException {
522        checkReadWrite();
523        _value.setFromTime(fromTime);
524    }
525    
526    public boolean getFromTimeHasBeenModified() {
527        return _value.getFromTimeHasBeenModified();
528    }
529    
530    public Long getThruTime() {
531        return _value.getThruTime();
532    }
533    
534    public void setThruTime(Long thruTime)
535            throws PersistenceNotNullException, PersistenceReadOnlyException {
536        checkReadWrite();
537        _value.setThruTime(thruTime);
538    }
539    
540    public boolean getThruTimeHasBeenModified() {
541        return _value.getThruTimeHasBeenModified();
542    }
543    
544}