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