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