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 * Profile.java
021 */
022
023package com.echothree.model.data.party.server.entity;
024
025import com.echothree.model.data.party.common.pk.ProfilePK;
026
027import com.echothree.model.data.party.common.pk.PartyPK;
028import com.echothree.model.data.icon.common.pk.IconPK;
029import com.echothree.model.data.party.common.pk.GenderPK;
030import com.echothree.model.data.party.common.pk.BirthdayFormatPK;
031import com.echothree.model.data.core.common.pk.MimeTypePK;
032
033import com.echothree.model.data.party.server.entity.Party;
034import com.echothree.model.data.icon.server.entity.Icon;
035import com.echothree.model.data.party.server.entity.Gender;
036import com.echothree.model.data.party.server.entity.BirthdayFormat;
037import com.echothree.model.data.core.server.entity.MimeType;
038
039import com.echothree.model.data.party.server.factory.PartyFactory;
040import com.echothree.model.data.icon.server.factory.IconFactory;
041import com.echothree.model.data.party.server.factory.GenderFactory;
042import com.echothree.model.data.party.server.factory.BirthdayFormatFactory;
043import com.echothree.model.data.core.server.factory.MimeTypeFactory;
044
045import com.echothree.model.data.party.common.pk.ProfilePK;
046
047import com.echothree.model.data.party.server.value.ProfileValue;
048
049import com.echothree.model.data.party.server.factory.ProfileFactory;
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 Profile
068        extends BaseEntity
069        implements Serializable {
070    
071    private ProfilePK _pk;
072    private ProfileValue _value;
073    
074    /** Creates a new instance of Profile */
075    public Profile()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of Profile */
081    public Profile(ProfileValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    public ProfileFactory getBaseFactoryInstance() {
090        return ProfileFactory.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 Profile that) {
114            ProfileValue thatValue = that.getProfileValue();
115            return _value.equals(thatValue);
116        } else {
117            return false;
118        }
119    }
120    
121    @Override
122    public void store(Session session)
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(session, this);
125    }
126    
127    @Override
128    public void remove(Session session)
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(session, this);
131    }
132    
133    @Override
134    public void remove()
135            throws PersistenceDatabaseException {
136        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
137    }
138    
139    public ProfileValue getProfileValue() {
140        return _value;
141    }
142    
143    public void setProfileValue(ProfileValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    public ProfilePK getPrimaryKey() {
151        return _pk;
152    }
153    
154    public PartyPK getPartyPK() {
155        return _value.getPartyPK();
156    }
157    
158    public Party getParty(Session session, EntityPermission entityPermission) {
159        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK());
160    }
161    
162    public Party getParty(EntityPermission entityPermission) {
163        return getParty(ThreadSession.currentSession(), entityPermission);
164    }
165    
166    public Party getParty(Session session) {
167        return getParty(session, EntityPermission.READ_ONLY);
168    }
169    
170    public Party getParty() {
171        return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
172    }
173    
174    public Party getPartyForUpdate(Session session) {
175        return getParty(session, EntityPermission.READ_WRITE);
176    }
177    
178    public Party getPartyForUpdate() {
179        return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
180    }
181    
182    public void setPartyPK(PartyPK partyPK)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setPartyPK(partyPK);
186    }
187    
188    public void setParty(Party entity) {
189        setPartyPK(entity == null? null: entity.getPrimaryKey());
190    }
191    
192    public boolean getPartyPKHasBeenModified() {
193        return _value.getPartyPKHasBeenModified();
194    }
195    
196    public String getNickname() {
197        return _value.getNickname();
198    }
199    
200    public void setNickname(String nickname)
201            throws PersistenceNotNullException, PersistenceReadOnlyException {
202        checkReadWrite();
203        _value.setNickname(nickname);
204    }
205    
206    public boolean getNicknameHasBeenModified() {
207        return _value.getNicknameHasBeenModified();
208    }
209    
210    public IconPK getIconPK() {
211        return _value.getIconPK();
212    }
213    
214    public Icon getIcon(Session session, EntityPermission entityPermission) {
215        IconPK pk = getIconPK();
216        Icon entity = pk == null? null: IconFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
217        
218        return entity;
219    }
220    
221    public Icon getIcon(EntityPermission entityPermission) {
222        return getIcon(ThreadSession.currentSession(), entityPermission);
223    }
224    
225    public Icon getIcon(Session session) {
226        return getIcon(session, EntityPermission.READ_ONLY);
227    }
228    
229    public Icon getIcon() {
230        return getIcon(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
231    }
232    
233    public Icon getIconForUpdate(Session session) {
234        return getIcon(session, EntityPermission.READ_WRITE);
235    }
236    
237    public Icon getIconForUpdate() {
238        return getIcon(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
239    }
240    
241    public void setIconPK(IconPK iconPK)
242            throws PersistenceNotNullException, PersistenceReadOnlyException {
243        checkReadWrite();
244        _value.setIconPK(iconPK);
245    }
246    
247    public void setIcon(Icon entity) {
248        setIconPK(entity == null? null: entity.getPrimaryKey());
249    }
250    
251    public boolean getIconPKHasBeenModified() {
252        return _value.getIconPKHasBeenModified();
253    }
254    
255    public String getPronunciation() {
256        return _value.getPronunciation();
257    }
258    
259    public void setPronunciation(String pronunciation)
260            throws PersistenceNotNullException, PersistenceReadOnlyException {
261        checkReadWrite();
262        _value.setPronunciation(pronunciation);
263    }
264    
265    public boolean getPronunciationHasBeenModified() {
266        return _value.getPronunciationHasBeenModified();
267    }
268    
269    public GenderPK getGenderPK() {
270        return _value.getGenderPK();
271    }
272    
273    public Gender getGender(Session session, EntityPermission entityPermission) {
274        GenderPK pk = getGenderPK();
275        Gender entity = pk == null? null: GenderFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
276        
277        return entity;
278    }
279    
280    public Gender getGender(EntityPermission entityPermission) {
281        return getGender(ThreadSession.currentSession(), entityPermission);
282    }
283    
284    public Gender getGender(Session session) {
285        return getGender(session, EntityPermission.READ_ONLY);
286    }
287    
288    public Gender getGender() {
289        return getGender(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
290    }
291    
292    public Gender getGenderForUpdate(Session session) {
293        return getGender(session, EntityPermission.READ_WRITE);
294    }
295    
296    public Gender getGenderForUpdate() {
297        return getGender(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
298    }
299    
300    public void setGenderPK(GenderPK genderPK)
301            throws PersistenceNotNullException, PersistenceReadOnlyException {
302        checkReadWrite();
303        _value.setGenderPK(genderPK);
304    }
305    
306    public void setGender(Gender entity) {
307        setGenderPK(entity == null? null: entity.getPrimaryKey());
308    }
309    
310    public boolean getGenderPKHasBeenModified() {
311        return _value.getGenderPKHasBeenModified();
312    }
313    
314    public String getPronouns() {
315        return _value.getPronouns();
316    }
317    
318    public void setPronouns(String pronouns)
319            throws PersistenceNotNullException, PersistenceReadOnlyException {
320        checkReadWrite();
321        _value.setPronouns(pronouns);
322    }
323    
324    public boolean getPronounsHasBeenModified() {
325        return _value.getPronounsHasBeenModified();
326    }
327    
328    public Integer getBirthday() {
329        return _value.getBirthday();
330    }
331    
332    public void setBirthday(Integer birthday)
333            throws PersistenceNotNullException, PersistenceReadOnlyException {
334        checkReadWrite();
335        _value.setBirthday(birthday);
336    }
337    
338    public boolean getBirthdayHasBeenModified() {
339        return _value.getBirthdayHasBeenModified();
340    }
341    
342    public BirthdayFormatPK getBirthdayFormatPK() {
343        return _value.getBirthdayFormatPK();
344    }
345    
346    public BirthdayFormat getBirthdayFormat(Session session, EntityPermission entityPermission) {
347        return BirthdayFormatFactory.getInstance().getEntityFromPK(session, entityPermission, getBirthdayFormatPK());
348    }
349    
350    public BirthdayFormat getBirthdayFormat(EntityPermission entityPermission) {
351        return getBirthdayFormat(ThreadSession.currentSession(), entityPermission);
352    }
353    
354    public BirthdayFormat getBirthdayFormat(Session session) {
355        return getBirthdayFormat(session, EntityPermission.READ_ONLY);
356    }
357    
358    public BirthdayFormat getBirthdayFormat() {
359        return getBirthdayFormat(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
360    }
361    
362    public BirthdayFormat getBirthdayFormatForUpdate(Session session) {
363        return getBirthdayFormat(session, EntityPermission.READ_WRITE);
364    }
365    
366    public BirthdayFormat getBirthdayFormatForUpdate() {
367        return getBirthdayFormat(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
368    }
369    
370    public void setBirthdayFormatPK(BirthdayFormatPK birthdayFormatPK)
371            throws PersistenceNotNullException, PersistenceReadOnlyException {
372        checkReadWrite();
373        _value.setBirthdayFormatPK(birthdayFormatPK);
374    }
375    
376    public void setBirthdayFormat(BirthdayFormat entity) {
377        setBirthdayFormatPK(entity == null? null: entity.getPrimaryKey());
378    }
379    
380    public boolean getBirthdayFormatPKHasBeenModified() {
381        return _value.getBirthdayFormatPKHasBeenModified();
382    }
383    
384    public String getOccupation() {
385        return _value.getOccupation();
386    }
387    
388    public void setOccupation(String occupation)
389            throws PersistenceNotNullException, PersistenceReadOnlyException {
390        checkReadWrite();
391        _value.setOccupation(occupation);
392    }
393    
394    public boolean getOccupationHasBeenModified() {
395        return _value.getOccupationHasBeenModified();
396    }
397    
398    public String getHobbies() {
399        return _value.getHobbies();
400    }
401    
402    public void setHobbies(String hobbies)
403            throws PersistenceNotNullException, PersistenceReadOnlyException {
404        checkReadWrite();
405        _value.setHobbies(hobbies);
406    }
407    
408    public boolean getHobbiesHasBeenModified() {
409        return _value.getHobbiesHasBeenModified();
410    }
411    
412    public String getLocation() {
413        return _value.getLocation();
414    }
415    
416    public void setLocation(String location)
417            throws PersistenceNotNullException, PersistenceReadOnlyException {
418        checkReadWrite();
419        _value.setLocation(location);
420    }
421    
422    public boolean getLocationHasBeenModified() {
423        return _value.getLocationHasBeenModified();
424    }
425    
426    public MimeTypePK getBioMimeTypePK() {
427        return _value.getBioMimeTypePK();
428    }
429    
430    public MimeType getBioMimeType(Session session, EntityPermission entityPermission) {
431        MimeTypePK pk = getBioMimeTypePK();
432        MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
433        
434        return entity;
435    }
436    
437    public MimeType getBioMimeType(EntityPermission entityPermission) {
438        return getBioMimeType(ThreadSession.currentSession(), entityPermission);
439    }
440    
441    public MimeType getBioMimeType(Session session) {
442        return getBioMimeType(session, EntityPermission.READ_ONLY);
443    }
444    
445    public MimeType getBioMimeType() {
446        return getBioMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
447    }
448    
449    public MimeType getBioMimeTypeForUpdate(Session session) {
450        return getBioMimeType(session, EntityPermission.READ_WRITE);
451    }
452    
453    public MimeType getBioMimeTypeForUpdate() {
454        return getBioMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
455    }
456    
457    public void setBioMimeTypePK(MimeTypePK bioMimeTypePK)
458            throws PersistenceNotNullException, PersistenceReadOnlyException {
459        checkReadWrite();
460        _value.setBioMimeTypePK(bioMimeTypePK);
461    }
462    
463    public void setBioMimeType(MimeType entity) {
464        setBioMimeTypePK(entity == null? null: entity.getPrimaryKey());
465    }
466    
467    public boolean getBioMimeTypePKHasBeenModified() {
468        return _value.getBioMimeTypePKHasBeenModified();
469    }
470    
471    public String getBio() {
472        return _value.getBio();
473    }
474    
475    public void setBio(String bio)
476            throws PersistenceNotNullException, PersistenceReadOnlyException {
477        checkReadWrite();
478        _value.setBio(bio);
479    }
480    
481    public boolean getBioHasBeenModified() {
482        return _value.getBioHasBeenModified();
483    }
484    
485    public MimeTypePK getSignatureMimeTypePK() {
486        return _value.getSignatureMimeTypePK();
487    }
488    
489    public MimeType getSignatureMimeType(Session session, EntityPermission entityPermission) {
490        MimeTypePK pk = getSignatureMimeTypePK();
491        MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
492        
493        return entity;
494    }
495    
496    public MimeType getSignatureMimeType(EntityPermission entityPermission) {
497        return getSignatureMimeType(ThreadSession.currentSession(), entityPermission);
498    }
499    
500    public MimeType getSignatureMimeType(Session session) {
501        return getSignatureMimeType(session, EntityPermission.READ_ONLY);
502    }
503    
504    public MimeType getSignatureMimeType() {
505        return getSignatureMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
506    }
507    
508    public MimeType getSignatureMimeTypeForUpdate(Session session) {
509        return getSignatureMimeType(session, EntityPermission.READ_WRITE);
510    }
511    
512    public MimeType getSignatureMimeTypeForUpdate() {
513        return getSignatureMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
514    }
515    
516    public void setSignatureMimeTypePK(MimeTypePK signatureMimeTypePK)
517            throws PersistenceNotNullException, PersistenceReadOnlyException {
518        checkReadWrite();
519        _value.setSignatureMimeTypePK(signatureMimeTypePK);
520    }
521    
522    public void setSignatureMimeType(MimeType entity) {
523        setSignatureMimeTypePK(entity == null? null: entity.getPrimaryKey());
524    }
525    
526    public boolean getSignatureMimeTypePKHasBeenModified() {
527        return _value.getSignatureMimeTypePKHasBeenModified();
528    }
529    
530    public String getSignature() {
531        return _value.getSignature();
532    }
533    
534    public void setSignature(String signature)
535            throws PersistenceNotNullException, PersistenceReadOnlyException {
536        checkReadWrite();
537        _value.setSignature(signature);
538    }
539    
540    public boolean getSignatureHasBeenModified() {
541        return _value.getSignatureHasBeenModified();
542    }
543    
544    public Long getFromTime() {
545        return _value.getFromTime();
546    }
547    
548    public void setFromTime(Long fromTime)
549            throws PersistenceNotNullException, PersistenceReadOnlyException {
550        checkReadWrite();
551        _value.setFromTime(fromTime);
552    }
553    
554    public boolean getFromTimeHasBeenModified() {
555        return _value.getFromTimeHasBeenModified();
556    }
557    
558    public Long getThruTime() {
559        return _value.getThruTime();
560    }
561    
562    public void setThruTime(Long thruTime)
563            throws PersistenceNotNullException, PersistenceReadOnlyException {
564        checkReadWrite();
565        _value.setThruTime(thruTime);
566    }
567    
568    public boolean getThruTimeHasBeenModified() {
569        return _value.getThruTimeHasBeenModified();
570    }
571    
572}