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 * AssociateDetail.java
021 */
022
023package com.echothree.model.data.associate.server.entity;
024
025import com.echothree.model.data.associate.common.pk.AssociateDetailPK;
026
027import com.echothree.model.data.associate.common.pk.AssociatePK;
028import com.echothree.model.data.associate.common.pk.AssociateProgramPK;
029import com.echothree.model.data.party.common.pk.PartyPK;
030import com.echothree.model.data.core.common.pk.MimeTypePK;
031
032import com.echothree.model.data.associate.server.entity.Associate;
033import com.echothree.model.data.associate.server.entity.AssociateProgram;
034import com.echothree.model.data.party.server.entity.Party;
035import com.echothree.model.data.core.server.entity.MimeType;
036
037import com.echothree.model.data.associate.server.factory.AssociateFactory;
038import com.echothree.model.data.associate.server.factory.AssociateProgramFactory;
039import com.echothree.model.data.party.server.factory.PartyFactory;
040import com.echothree.model.data.core.server.factory.MimeTypeFactory;
041
042import com.echothree.model.data.associate.common.pk.AssociateDetailPK;
043
044import com.echothree.model.data.associate.server.value.AssociateDetailValue;
045
046import com.echothree.model.data.associate.server.factory.AssociateDetailFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064public class AssociateDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private AssociateDetailPK _pk;
069    private AssociateDetailValue _value;
070    
071    /** Creates a new instance of AssociateDetail */
072    public AssociateDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of AssociateDetail */
078    public AssociateDetail(AssociateDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public AssociateDetailFactory getBaseFactoryInstance() {
087        return AssociateDetailFactory.getInstance();
088    }
089    
090    @Override
091    public boolean hasBeenModified() {
092        return _value.hasBeenModified();
093    }
094    
095    @Override
096    public int hashCode() {
097        return _pk.hashCode();
098    }
099    
100    @Override
101    public String toString() {
102        return _pk.toString();
103    }
104    
105    @Override
106    public boolean equals(Object other) {
107        if(this == other)
108            return true;
109        
110        if(other instanceof AssociateDetail that) {
111            AssociateDetailValue thatValue = that.getAssociateDetailValue();
112            return _value.equals(thatValue);
113        } else {
114            return false;
115        }
116    }
117    
118    @Override
119    public void store(Session session)
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().store(session, this);
122    }
123    
124    @Override
125    public void remove(Session session)
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(session, this);
128    }
129    
130    @Override
131    public void remove()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
134    }
135    
136    public AssociateDetailValue getAssociateDetailValue() {
137        return _value;
138    }
139    
140    public void setAssociateDetailValue(AssociateDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public AssociateDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public AssociatePK getAssociatePK() {
152        return _value.getAssociatePK();
153    }
154    
155    public Associate getAssociate(Session session, EntityPermission entityPermission) {
156        AssociatePK pk = getAssociatePK();
157        Associate entity = pk == null? null: AssociateFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
158        
159        return entity;
160    }
161    
162    public Associate getAssociate(EntityPermission entityPermission) {
163        return getAssociate(ThreadSession.currentSession(), entityPermission);
164    }
165    
166    public Associate getAssociate(Session session) {
167        return getAssociate(session, EntityPermission.READ_ONLY);
168    }
169    
170    public Associate getAssociate() {
171        return getAssociate(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
172    }
173    
174    public Associate getAssociateForUpdate(Session session) {
175        return getAssociate(session, EntityPermission.READ_WRITE);
176    }
177    
178    public Associate getAssociateForUpdate() {
179        return getAssociate(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
180    }
181    
182    public void setAssociatePK(AssociatePK associatePK)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setAssociatePK(associatePK);
186    }
187    
188    public void setAssociate(Associate entity) {
189        setAssociatePK(entity == null? null: entity.getPrimaryKey());
190    }
191    
192    public boolean getAssociatePKHasBeenModified() {
193        return _value.getAssociatePKHasBeenModified();
194    }
195    
196    public AssociateProgramPK getAssociateProgramPK() {
197        return _value.getAssociateProgramPK();
198    }
199    
200    public AssociateProgram getAssociateProgram(Session session, EntityPermission entityPermission) {
201        return AssociateProgramFactory.getInstance().getEntityFromPK(session, entityPermission, getAssociateProgramPK());
202    }
203    
204    public AssociateProgram getAssociateProgram(EntityPermission entityPermission) {
205        return getAssociateProgram(ThreadSession.currentSession(), entityPermission);
206    }
207    
208    public AssociateProgram getAssociateProgram(Session session) {
209        return getAssociateProgram(session, EntityPermission.READ_ONLY);
210    }
211    
212    public AssociateProgram getAssociateProgram() {
213        return getAssociateProgram(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
214    }
215    
216    public AssociateProgram getAssociateProgramForUpdate(Session session) {
217        return getAssociateProgram(session, EntityPermission.READ_WRITE);
218    }
219    
220    public AssociateProgram getAssociateProgramForUpdate() {
221        return getAssociateProgram(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
222    }
223    
224    public void setAssociateProgramPK(AssociateProgramPK associateProgramPK)
225            throws PersistenceNotNullException, PersistenceReadOnlyException {
226        checkReadWrite();
227        _value.setAssociateProgramPK(associateProgramPK);
228    }
229    
230    public void setAssociateProgram(AssociateProgram entity) {
231        setAssociateProgramPK(entity == null? null: entity.getPrimaryKey());
232    }
233    
234    public boolean getAssociateProgramPKHasBeenModified() {
235        return _value.getAssociateProgramPKHasBeenModified();
236    }
237    
238    public String getAssociateName() {
239        return _value.getAssociateName();
240    }
241    
242    public void setAssociateName(String associateName)
243            throws PersistenceNotNullException, PersistenceReadOnlyException {
244        checkReadWrite();
245        _value.setAssociateName(associateName);
246    }
247    
248    public boolean getAssociateNameHasBeenModified() {
249        return _value.getAssociateNameHasBeenModified();
250    }
251    
252    public PartyPK getPartyPK() {
253        return _value.getPartyPK();
254    }
255    
256    public Party getParty(Session session, EntityPermission entityPermission) {
257        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK());
258    }
259    
260    public Party getParty(EntityPermission entityPermission) {
261        return getParty(ThreadSession.currentSession(), entityPermission);
262    }
263    
264    public Party getParty(Session session) {
265        return getParty(session, EntityPermission.READ_ONLY);
266    }
267    
268    public Party getParty() {
269        return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
270    }
271    
272    public Party getPartyForUpdate(Session session) {
273        return getParty(session, EntityPermission.READ_WRITE);
274    }
275    
276    public Party getPartyForUpdate() {
277        return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
278    }
279    
280    public void setPartyPK(PartyPK partyPK)
281            throws PersistenceNotNullException, PersistenceReadOnlyException {
282        checkReadWrite();
283        _value.setPartyPK(partyPK);
284    }
285    
286    public void setParty(Party entity) {
287        setPartyPK(entity == null? null: entity.getPrimaryKey());
288    }
289    
290    public boolean getPartyPKHasBeenModified() {
291        return _value.getPartyPKHasBeenModified();
292    }
293    
294    public String getDescription() {
295        return _value.getDescription();
296    }
297    
298    public void setDescription(String description)
299            throws PersistenceNotNullException, PersistenceReadOnlyException {
300        checkReadWrite();
301        _value.setDescription(description);
302    }
303    
304    public boolean getDescriptionHasBeenModified() {
305        return _value.getDescriptionHasBeenModified();
306    }
307    
308    public MimeTypePK getSummaryMimeTypePK() {
309        return _value.getSummaryMimeTypePK();
310    }
311    
312    public MimeType getSummaryMimeType(Session session, EntityPermission entityPermission) {
313        return MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getSummaryMimeTypePK());
314    }
315    
316    public MimeType getSummaryMimeType(EntityPermission entityPermission) {
317        return getSummaryMimeType(ThreadSession.currentSession(), entityPermission);
318    }
319    
320    public MimeType getSummaryMimeType(Session session) {
321        return getSummaryMimeType(session, EntityPermission.READ_ONLY);
322    }
323    
324    public MimeType getSummaryMimeType() {
325        return getSummaryMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
326    }
327    
328    public MimeType getSummaryMimeTypeForUpdate(Session session) {
329        return getSummaryMimeType(session, EntityPermission.READ_WRITE);
330    }
331    
332    public MimeType getSummaryMimeTypeForUpdate() {
333        return getSummaryMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
334    }
335    
336    public void setSummaryMimeTypePK(MimeTypePK summaryMimeTypePK)
337            throws PersistenceNotNullException, PersistenceReadOnlyException {
338        checkReadWrite();
339        _value.setSummaryMimeTypePK(summaryMimeTypePK);
340    }
341    
342    public void setSummaryMimeType(MimeType entity) {
343        setSummaryMimeTypePK(entity == null? null: entity.getPrimaryKey());
344    }
345    
346    public boolean getSummaryMimeTypePKHasBeenModified() {
347        return _value.getSummaryMimeTypePKHasBeenModified();
348    }
349    
350    public String getSummary() {
351        return _value.getSummary();
352    }
353    
354    public void setSummary(String summary)
355            throws PersistenceNotNullException, PersistenceReadOnlyException {
356        checkReadWrite();
357        _value.setSummary(summary);
358    }
359    
360    public boolean getSummaryHasBeenModified() {
361        return _value.getSummaryHasBeenModified();
362    }
363    
364    public Long getFromTime() {
365        return _value.getFromTime();
366    }
367    
368    public void setFromTime(Long fromTime)
369            throws PersistenceNotNullException, PersistenceReadOnlyException {
370        checkReadWrite();
371        _value.setFromTime(fromTime);
372    }
373    
374    public boolean getFromTimeHasBeenModified() {
375        return _value.getFromTimeHasBeenModified();
376    }
377    
378    public Long getThruTime() {
379        return _value.getThruTime();
380    }
381    
382    public void setThruTime(Long thruTime)
383            throws PersistenceNotNullException, PersistenceReadOnlyException {
384        checkReadWrite();
385        _value.setThruTime(thruTime);
386    }
387    
388    public boolean getThruTimeHasBeenModified() {
389        return _value.getThruTimeHasBeenModified();
390    }
391    
392}