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