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 * AssociatePartyContactMechanismDetail.java
021 */
022
023package com.echothree.model.data.associate.server.entity;
024
025import com.echothree.model.data.associate.common.pk.AssociatePartyContactMechanismDetailPK;
026
027import com.echothree.model.data.associate.common.pk.AssociatePartyContactMechanismPK;
028import com.echothree.model.data.associate.common.pk.AssociatePK;
029import com.echothree.model.data.contact.common.pk.PartyContactMechanismPK;
030
031import com.echothree.model.data.associate.server.entity.AssociatePartyContactMechanism;
032import com.echothree.model.data.associate.server.entity.Associate;
033import com.echothree.model.data.contact.server.entity.PartyContactMechanism;
034
035import com.echothree.model.data.associate.server.factory.AssociatePartyContactMechanismFactory;
036import com.echothree.model.data.associate.server.factory.AssociateFactory;
037import com.echothree.model.data.contact.server.factory.PartyContactMechanismFactory;
038
039import com.echothree.model.data.associate.common.pk.AssociatePartyContactMechanismDetailPK;
040
041import com.echothree.model.data.associate.server.value.AssociatePartyContactMechanismDetailValue;
042
043import com.echothree.model.data.associate.server.factory.AssociatePartyContactMechanismDetailFactory;
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
061import javax.annotation.Nonnull;
062import javax.annotation.Nullable;
063
064public class AssociatePartyContactMechanismDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private AssociatePartyContactMechanismDetailPK _pk;
069    private AssociatePartyContactMechanismDetailValue _value;
070    
071    /** Creates a new instance of AssociatePartyContactMechanismDetail */
072    public AssociatePartyContactMechanismDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of AssociatePartyContactMechanismDetail */
078    public AssociatePartyContactMechanismDetail(AssociatePartyContactMechanismDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    @Nonnull
087    public AssociatePartyContactMechanismDetailFactory getBaseFactoryInstance() {
088        return AssociatePartyContactMechanismDetailFactory.getInstance();
089    }
090    
091    @Override
092    public boolean hasBeenModified() {
093        return _value.hasBeenModified();
094    }
095    
096    @Override
097    public int hashCode() {
098        return _pk.hashCode();
099    }
100    
101    @Override
102    @Nonnull
103    public String toString() {
104        return _pk.toString();
105    }
106    
107    @Override
108    public boolean equals(Object other) {
109        if(this == other)
110            return true;
111        
112        if(other instanceof AssociatePartyContactMechanismDetail that) {
113            AssociatePartyContactMechanismDetailValue thatValue = that.getAssociatePartyContactMechanismDetailValue();
114            return _value.equals(thatValue);
115        } else {
116            return false;
117        }
118    }
119    
120    @Override
121    public void store()
122            throws PersistenceDatabaseException {
123        getBaseFactoryInstance().store(this);
124    }
125    
126    @Override
127    public void remove()
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().remove(this);
130    }
131    
132    @Nonnull
133    public AssociatePartyContactMechanismDetailValue getAssociatePartyContactMechanismDetailValue() {
134        return _value;
135    }
136    
137    public void setAssociatePartyContactMechanismDetailValue(@Nonnull AssociatePartyContactMechanismDetailValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    @Nonnull
145    public AssociatePartyContactMechanismDetailPK getPrimaryKey() {
146        return _pk;
147    }
148    
149    @Nullable
150    public AssociatePartyContactMechanismPK getAssociatePartyContactMechanismPK() {
151        return _value.getAssociatePartyContactMechanismPK();
152    }
153    
154    @Nullable
155    public AssociatePartyContactMechanism getAssociatePartyContactMechanism(EntityPermission entityPermission) {
156        AssociatePartyContactMechanismPK pk = getAssociatePartyContactMechanismPK();
157        AssociatePartyContactMechanism entity = pk == null? null: AssociatePartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, pk);
158        
159        return entity;
160    }
161    
162    @Nullable
163    public AssociatePartyContactMechanism getAssociatePartyContactMechanism() {
164        return getAssociatePartyContactMechanism(EntityPermission.READ_ONLY);
165    }
166    
167    @Nullable
168    public AssociatePartyContactMechanism getAssociatePartyContactMechanismForUpdate() {
169        return getAssociatePartyContactMechanism(EntityPermission.READ_WRITE);
170    }
171    
172    public void setAssociatePartyContactMechanismPK(@Nullable AssociatePartyContactMechanismPK associatePartyContactMechanismPK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setAssociatePartyContactMechanismPK(associatePartyContactMechanismPK);
176    }
177    
178    public void setAssociatePartyContactMechanism(@Nullable AssociatePartyContactMechanism entity) {
179        setAssociatePartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
180    }
181    
182    public boolean getAssociatePartyContactMechanismPKHasBeenModified() {
183        return _value.getAssociatePartyContactMechanismPKHasBeenModified();
184    }
185    
186    @Nonnull
187    public AssociatePK getAssociatePK() {
188        return _value.getAssociatePK();
189    }
190    
191    @Nonnull
192    public Associate getAssociate(EntityPermission entityPermission) {
193        return AssociateFactory.getInstance().getEntityFromPK(entityPermission, getAssociatePK());
194    }
195    
196    @Nonnull
197    public Associate getAssociate() {
198        return getAssociate(EntityPermission.READ_ONLY);
199    }
200    
201    @Nonnull
202    public Associate getAssociateForUpdate() {
203        return getAssociate(EntityPermission.READ_WRITE);
204    }
205    
206    public void setAssociatePK(@Nonnull AssociatePK associatePK)
207            throws PersistenceNotNullException, PersistenceReadOnlyException {
208        checkReadWrite();
209        _value.setAssociatePK(associatePK);
210    }
211    
212    public void setAssociate(@Nonnull Associate entity) {
213        setAssociatePK(entity == null ? null : entity.getPrimaryKey());
214    }
215    
216    public boolean getAssociatePKHasBeenModified() {
217        return _value.getAssociatePKHasBeenModified();
218    }
219    
220    @Nonnull
221    public String getAssociatePartyContactMechanismName() {
222        return _value.getAssociatePartyContactMechanismName();
223    }
224    
225    public void setAssociatePartyContactMechanismName(@Nonnull String associatePartyContactMechanismName)
226            throws PersistenceNotNullException, PersistenceReadOnlyException {
227        checkReadWrite();
228        _value.setAssociatePartyContactMechanismName(associatePartyContactMechanismName);
229    }
230    
231    public boolean getAssociatePartyContactMechanismNameHasBeenModified() {
232        return _value.getAssociatePartyContactMechanismNameHasBeenModified();
233    }
234    
235    @Nonnull
236    public PartyContactMechanismPK getPartyContactMechanismPK() {
237        return _value.getPartyContactMechanismPK();
238    }
239    
240    @Nonnull
241    public PartyContactMechanism getPartyContactMechanism(EntityPermission entityPermission) {
242        return PartyContactMechanismFactory.getInstance().getEntityFromPK(entityPermission, getPartyContactMechanismPK());
243    }
244    
245    @Nonnull
246    public PartyContactMechanism getPartyContactMechanism() {
247        return getPartyContactMechanism(EntityPermission.READ_ONLY);
248    }
249    
250    @Nonnull
251    public PartyContactMechanism getPartyContactMechanismForUpdate() {
252        return getPartyContactMechanism(EntityPermission.READ_WRITE);
253    }
254    
255    public void setPartyContactMechanismPK(@Nonnull PartyContactMechanismPK partyContactMechanismPK)
256            throws PersistenceNotNullException, PersistenceReadOnlyException {
257        checkReadWrite();
258        _value.setPartyContactMechanismPK(partyContactMechanismPK);
259    }
260    
261    public void setPartyContactMechanism(@Nonnull PartyContactMechanism entity) {
262        setPartyContactMechanismPK(entity == null ? null : entity.getPrimaryKey());
263    }
264    
265    public boolean getPartyContactMechanismPKHasBeenModified() {
266        return _value.getPartyContactMechanismPKHasBeenModified();
267    }
268    
269    @Nonnull
270    public Boolean getIsDefault() {
271        return _value.getIsDefault();
272    }
273    
274    public void setIsDefault(@Nonnull Boolean isDefault)
275            throws PersistenceNotNullException, PersistenceReadOnlyException {
276        checkReadWrite();
277        _value.setIsDefault(isDefault);
278    }
279    
280    public boolean getIsDefaultHasBeenModified() {
281        return _value.getIsDefaultHasBeenModified();
282    }
283    
284    @Nonnull
285    public Integer getSortOrder() {
286        return _value.getSortOrder();
287    }
288    
289    public void setSortOrder(@Nonnull Integer sortOrder)
290            throws PersistenceNotNullException, PersistenceReadOnlyException {
291        checkReadWrite();
292        _value.setSortOrder(sortOrder);
293    }
294    
295    public boolean getSortOrderHasBeenModified() {
296        return _value.getSortOrderHasBeenModified();
297    }
298    
299    @Nonnull
300    public Long getFromTime() {
301        return _value.getFromTime();
302    }
303    
304    public void setFromTime(@Nonnull Long fromTime)
305            throws PersistenceNotNullException, PersistenceReadOnlyException {
306        checkReadWrite();
307        _value.setFromTime(fromTime);
308    }
309    
310    public boolean getFromTimeHasBeenModified() {
311        return _value.getFromTimeHasBeenModified();
312    }
313    
314    @Nonnull
315    public Long getThruTime() {
316        return _value.getThruTime();
317    }
318    
319    public void setThruTime(@Nonnull Long thruTime)
320            throws PersistenceNotNullException, PersistenceReadOnlyException {
321        checkReadWrite();
322        _value.setThruTime(thruTime);
323    }
324    
325    public boolean getThruTimeHasBeenModified() {
326        return _value.getThruTimeHasBeenModified();
327    }
328    
329}