001// --------------------------------------------------------------------------------
002// Copyright 2002-2026 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()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().store(this);
128    }
129    
130    @Override
131    public void remove()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(this);
134    }
135    
136    public CommunicationEventDetailValue getCommunicationEventDetailValue() {
137        return _value;
138    }
139    
140    public void setCommunicationEventDetailValue(CommunicationEventDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public CommunicationEventDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public CommunicationEventPK getCommunicationEventPK() {
152        return _value.getCommunicationEventPK();
153    }
154    
155    public CommunicationEvent getCommunicationEvent(EntityPermission entityPermission) {
156        return CommunicationEventFactory.getInstance().getEntityFromPK(entityPermission, getCommunicationEventPK());
157    }
158    
159    public CommunicationEvent getCommunicationEvent() {
160        return getCommunicationEvent(EntityPermission.READ_ONLY);
161    }
162    
163    public CommunicationEvent getCommunicationEventForUpdate() {
164        return getCommunicationEvent(EntityPermission.READ_WRITE);
165    }
166    
167    public void setCommunicationEventPK(CommunicationEventPK communicationEventPK)
168            throws PersistenceNotNullException, PersistenceReadOnlyException {
169        checkReadWrite();
170        _value.setCommunicationEventPK(communicationEventPK);
171    }
172    
173    public void setCommunicationEvent(CommunicationEvent entity) {
174        setCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
175    }
176    
177    public boolean getCommunicationEventPKHasBeenModified() {
178        return _value.getCommunicationEventPKHasBeenModified();
179    }
180    
181    public String getCommunicationEventName() {
182        return _value.getCommunicationEventName();
183    }
184    
185    public void setCommunicationEventName(String communicationEventName)
186            throws PersistenceNotNullException, PersistenceReadOnlyException {
187        checkReadWrite();
188        _value.setCommunicationEventName(communicationEventName);
189    }
190    
191    public boolean getCommunicationEventNameHasBeenModified() {
192        return _value.getCommunicationEventNameHasBeenModified();
193    }
194    
195    public CommunicationEventTypePK getCommunicationEventTypePK() {
196        return _value.getCommunicationEventTypePK();
197    }
198    
199    public CommunicationEventType getCommunicationEventType(EntityPermission entityPermission) {
200        return CommunicationEventTypeFactory.getInstance().getEntityFromPK(entityPermission, getCommunicationEventTypePK());
201    }
202    
203    public CommunicationEventType getCommunicationEventType() {
204        return getCommunicationEventType(EntityPermission.READ_ONLY);
205    }
206    
207    public CommunicationEventType getCommunicationEventTypeForUpdate() {
208        return getCommunicationEventType(EntityPermission.READ_WRITE);
209    }
210    
211    public void setCommunicationEventTypePK(CommunicationEventTypePK communicationEventTypePK)
212            throws PersistenceNotNullException, PersistenceReadOnlyException {
213        checkReadWrite();
214        _value.setCommunicationEventTypePK(communicationEventTypePK);
215    }
216    
217    public void setCommunicationEventType(CommunicationEventType entity) {
218        setCommunicationEventTypePK(entity == null? null: entity.getPrimaryKey());
219    }
220    
221    public boolean getCommunicationEventTypePKHasBeenModified() {
222        return _value.getCommunicationEventTypePKHasBeenModified();
223    }
224    
225    public CommunicationSourcePK getCommunicationSourcePK() {
226        return _value.getCommunicationSourcePK();
227    }
228    
229    public CommunicationSource getCommunicationSource(EntityPermission entityPermission) {
230        CommunicationSourcePK pk = getCommunicationSourcePK();
231        CommunicationSource entity = pk == null? null: CommunicationSourceFactory.getInstance().getEntityFromPK(entityPermission, pk);
232        
233        return entity;
234    }
235    
236    public CommunicationSource getCommunicationSource() {
237        return getCommunicationSource(EntityPermission.READ_ONLY);
238    }
239    
240    public CommunicationSource getCommunicationSourceForUpdate() {
241        return getCommunicationSource(EntityPermission.READ_WRITE);
242    }
243    
244    public void setCommunicationSourcePK(CommunicationSourcePK communicationSourcePK)
245            throws PersistenceNotNullException, PersistenceReadOnlyException {
246        checkReadWrite();
247        _value.setCommunicationSourcePK(communicationSourcePK);
248    }
249    
250    public void setCommunicationSource(CommunicationSource entity) {
251        setCommunicationSourcePK(entity == null? null: entity.getPrimaryKey());
252    }
253    
254    public boolean getCommunicationSourcePKHasBeenModified() {
255        return _value.getCommunicationSourcePKHasBeenModified();
256    }
257    
258    public CommunicationEventPurposePK getCommunicationEventPurposePK() {
259        return _value.getCommunicationEventPurposePK();
260    }
261    
262    public CommunicationEventPurpose getCommunicationEventPurpose(EntityPermission entityPermission) {
263        return CommunicationEventPurposeFactory.getInstance().getEntityFromPK(entityPermission, getCommunicationEventPurposePK());
264    }
265    
266    public CommunicationEventPurpose getCommunicationEventPurpose() {
267        return getCommunicationEventPurpose(EntityPermission.READ_ONLY);
268    }
269    
270    public CommunicationEventPurpose getCommunicationEventPurposeForUpdate() {
271        return getCommunicationEventPurpose(EntityPermission.READ_WRITE);
272    }
273    
274    public void setCommunicationEventPurposePK(CommunicationEventPurposePK communicationEventPurposePK)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setCommunicationEventPurposePK(communicationEventPurposePK);
278    }
279    
280    public void setCommunicationEventPurpose(CommunicationEventPurpose entity) {
281        setCommunicationEventPurposePK(entity == null? null: entity.getPrimaryKey());
282    }
283    
284    public boolean getCommunicationEventPurposePKHasBeenModified() {
285        return _value.getCommunicationEventPurposePKHasBeenModified();
286    }
287    
288    public CommunicationEventPK getOriginalCommunicationEventPK() {
289        return _value.getOriginalCommunicationEventPK();
290    }
291    
292    public CommunicationEvent getOriginalCommunicationEvent(EntityPermission entityPermission) {
293        CommunicationEventPK pk = getOriginalCommunicationEventPK();
294        CommunicationEvent entity = pk == null? null: CommunicationEventFactory.getInstance().getEntityFromPK(entityPermission, pk);
295        
296        return entity;
297    }
298    
299    public CommunicationEvent getOriginalCommunicationEvent() {
300        return getOriginalCommunicationEvent(EntityPermission.READ_ONLY);
301    }
302    
303    public CommunicationEvent getOriginalCommunicationEventForUpdate() {
304        return getOriginalCommunicationEvent(EntityPermission.READ_WRITE);
305    }
306    
307    public void setOriginalCommunicationEventPK(CommunicationEventPK originalCommunicationEventPK)
308            throws PersistenceNotNullException, PersistenceReadOnlyException {
309        checkReadWrite();
310        _value.setOriginalCommunicationEventPK(originalCommunicationEventPK);
311    }
312    
313    public void setOriginalCommunicationEvent(CommunicationEvent entity) {
314        setOriginalCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
315    }
316    
317    public boolean getOriginalCommunicationEventPKHasBeenModified() {
318        return _value.getOriginalCommunicationEventPKHasBeenModified();
319    }
320    
321    public CommunicationEventPK getParentCommunicationEventPK() {
322        return _value.getParentCommunicationEventPK();
323    }
324    
325    public CommunicationEvent getParentCommunicationEvent(EntityPermission entityPermission) {
326        CommunicationEventPK pk = getParentCommunicationEventPK();
327        CommunicationEvent entity = pk == null? null: CommunicationEventFactory.getInstance().getEntityFromPK(entityPermission, pk);
328        
329        return entity;
330    }
331    
332    public CommunicationEvent getParentCommunicationEvent() {
333        return getParentCommunicationEvent(EntityPermission.READ_ONLY);
334    }
335    
336    public CommunicationEvent getParentCommunicationEventForUpdate() {
337        return getParentCommunicationEvent(EntityPermission.READ_WRITE);
338    }
339    
340    public void setParentCommunicationEventPK(CommunicationEventPK parentCommunicationEventPK)
341            throws PersistenceNotNullException, PersistenceReadOnlyException {
342        checkReadWrite();
343        _value.setParentCommunicationEventPK(parentCommunicationEventPK);
344    }
345    
346    public void setParentCommunicationEvent(CommunicationEvent entity) {
347        setParentCommunicationEventPK(entity == null? null: entity.getPrimaryKey());
348    }
349    
350    public boolean getParentCommunicationEventPKHasBeenModified() {
351        return _value.getParentCommunicationEventPKHasBeenModified();
352    }
353    
354    public PartyContactMechanismPK getPartyContactMechanismPK() {
355        return _value.getPartyContactMechanismPK();
356    }
357    
358    public PartyContactMechanism getPartyContactMechanism(EntityPermission entityPermission) {
359        return PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getPartyContactMechanismPK());
360    }
361    
362    public PartyContactMechanism getPartyContactMechanism() {
363        return getPartyContactMechanism(EntityPermission.READ_ONLY);
364    }
365    
366    public PartyContactMechanism getPartyContactMechanismForUpdate() {
367        return getPartyContactMechanism(EntityPermission.READ_WRITE);
368    }
369    
370    public void setPartyContactMechanismPK(PartyContactMechanismPK partyContactMechanismPK)
371            throws PersistenceNotNullException, PersistenceReadOnlyException {
372        checkReadWrite();
373        _value.setPartyContactMechanismPK(partyContactMechanismPK);
374    }
375    
376    public void setPartyContactMechanism(PartyContactMechanism entity) {
377        setPartyContactMechanismPK(entity == null? null: entity.getPrimaryKey());
378    }
379    
380    public boolean getPartyContactMechanismPKHasBeenModified() {
381        return _value.getPartyContactMechanismPKHasBeenModified();
382    }
383    
384    public DocumentPK getDocumentPK() {
385        return _value.getDocumentPK();
386    }
387    
388    public Document getDocument(EntityPermission entityPermission) {
389        return DocumentFactory.getInstance().getEntityFromPK(entityPermission, getDocumentPK());
390    }
391    
392    public Document getDocument() {
393        return getDocument(EntityPermission.READ_ONLY);
394    }
395    
396    public Document getDocumentForUpdate() {
397        return getDocument(EntityPermission.READ_WRITE);
398    }
399    
400    public void setDocumentPK(DocumentPK documentPK)
401            throws PersistenceNotNullException, PersistenceReadOnlyException {
402        checkReadWrite();
403        _value.setDocumentPK(documentPK);
404    }
405    
406    public void setDocument(Document entity) {
407        setDocumentPK(entity == null? null: entity.getPrimaryKey());
408    }
409    
410    public boolean getDocumentPKHasBeenModified() {
411        return _value.getDocumentPKHasBeenModified();
412    }
413    
414    public Long getFromTime() {
415        return _value.getFromTime();
416    }
417    
418    public void setFromTime(Long fromTime)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setFromTime(fromTime);
422    }
423    
424    public boolean getFromTimeHasBeenModified() {
425        return _value.getFromTimeHasBeenModified();
426    }
427    
428    public Long getThruTime() {
429        return _value.getThruTime();
430    }
431    
432    public void setThruTime(Long thruTime)
433            throws PersistenceNotNullException, PersistenceReadOnlyException {
434        checkReadWrite();
435        _value.setThruTime(thruTime);
436    }
437    
438    public boolean getThruTimeHasBeenModified() {
439        return _value.getThruTimeHasBeenModified();
440    }
441    
442}