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 * AppearanceDetail.java
021 */
022
023package com.echothree.model.data.core.server.entity;
024
025import com.echothree.model.data.core.common.pk.AppearanceDetailPK;
026
027import com.echothree.model.data.core.common.pk.AppearancePK;
028import com.echothree.model.data.core.common.pk.ColorPK;
029import com.echothree.model.data.core.common.pk.FontStylePK;
030import com.echothree.model.data.core.common.pk.FontWeightPK;
031
032import com.echothree.model.data.core.server.entity.Appearance;
033import com.echothree.model.data.core.server.entity.Color;
034import com.echothree.model.data.core.server.entity.FontStyle;
035import com.echothree.model.data.core.server.entity.FontWeight;
036
037import com.echothree.model.data.core.server.factory.AppearanceFactory;
038import com.echothree.model.data.core.server.factory.ColorFactory;
039import com.echothree.model.data.core.server.factory.FontStyleFactory;
040import com.echothree.model.data.core.server.factory.FontWeightFactory;
041
042import com.echothree.model.data.core.common.pk.AppearanceDetailPK;
043
044import com.echothree.model.data.core.server.value.AppearanceDetailValue;
045
046import com.echothree.model.data.core.server.factory.AppearanceDetailFactory;
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 AppearanceDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private AppearanceDetailPK _pk;
069    private AppearanceDetailValue _value;
070    
071    /** Creates a new instance of AppearanceDetail */
072    public AppearanceDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of AppearanceDetail */
078    public AppearanceDetail(AppearanceDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public AppearanceDetailFactory getBaseFactoryInstance() {
087        return AppearanceDetailFactory.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 AppearanceDetail that) {
111            AppearanceDetailValue thatValue = that.getAppearanceDetailValue();
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 AppearanceDetailValue getAppearanceDetailValue() {
137        return _value;
138    }
139    
140    public void setAppearanceDetailValue(AppearanceDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public AppearanceDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public AppearancePK getAppearancePK() {
152        return _value.getAppearancePK();
153    }
154    
155    public Appearance getAppearance(Session session, EntityPermission entityPermission) {
156        return AppearanceFactory.getInstance().getEntityFromPK(session, entityPermission, getAppearancePK());
157    }
158    
159    public Appearance getAppearance(EntityPermission entityPermission) {
160        return getAppearance(ThreadSession.currentSession(), entityPermission);
161    }
162    
163    public Appearance getAppearance(Session session) {
164        return getAppearance(session, EntityPermission.READ_ONLY);
165    }
166    
167    public Appearance getAppearance() {
168        return getAppearance(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
169    }
170    
171    public Appearance getAppearanceForUpdate(Session session) {
172        return getAppearance(session, EntityPermission.READ_WRITE);
173    }
174    
175    public Appearance getAppearanceForUpdate() {
176        return getAppearance(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
177    }
178    
179    public void setAppearancePK(AppearancePK appearancePK)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setAppearancePK(appearancePK);
183    }
184    
185    public void setAppearance(Appearance entity) {
186        setAppearancePK(entity == null? null: entity.getPrimaryKey());
187    }
188    
189    public boolean getAppearancePKHasBeenModified() {
190        return _value.getAppearancePKHasBeenModified();
191    }
192    
193    public String getAppearanceName() {
194        return _value.getAppearanceName();
195    }
196    
197    public void setAppearanceName(String appearanceName)
198            throws PersistenceNotNullException, PersistenceReadOnlyException {
199        checkReadWrite();
200        _value.setAppearanceName(appearanceName);
201    }
202    
203    public boolean getAppearanceNameHasBeenModified() {
204        return _value.getAppearanceNameHasBeenModified();
205    }
206    
207    public ColorPK getTextColorPK() {
208        return _value.getTextColorPK();
209    }
210    
211    public Color getTextColor(Session session, EntityPermission entityPermission) {
212        ColorPK pk = getTextColorPK();
213        Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
214        
215        return entity;
216    }
217    
218    public Color getTextColor(EntityPermission entityPermission) {
219        return getTextColor(ThreadSession.currentSession(), entityPermission);
220    }
221    
222    public Color getTextColor(Session session) {
223        return getTextColor(session, EntityPermission.READ_ONLY);
224    }
225    
226    public Color getTextColor() {
227        return getTextColor(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
228    }
229    
230    public Color getTextColorForUpdate(Session session) {
231        return getTextColor(session, EntityPermission.READ_WRITE);
232    }
233    
234    public Color getTextColorForUpdate() {
235        return getTextColor(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
236    }
237    
238    public void setTextColorPK(ColorPK textColorPK)
239            throws PersistenceNotNullException, PersistenceReadOnlyException {
240        checkReadWrite();
241        _value.setTextColorPK(textColorPK);
242    }
243    
244    public void setTextColor(Color entity) {
245        setTextColorPK(entity == null? null: entity.getPrimaryKey());
246    }
247    
248    public boolean getTextColorPKHasBeenModified() {
249        return _value.getTextColorPKHasBeenModified();
250    }
251    
252    public ColorPK getBackgroundColorPK() {
253        return _value.getBackgroundColorPK();
254    }
255    
256    public Color getBackgroundColor(Session session, EntityPermission entityPermission) {
257        ColorPK pk = getBackgroundColorPK();
258        Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
259        
260        return entity;
261    }
262    
263    public Color getBackgroundColor(EntityPermission entityPermission) {
264        return getBackgroundColor(ThreadSession.currentSession(), entityPermission);
265    }
266    
267    public Color getBackgroundColor(Session session) {
268        return getBackgroundColor(session, EntityPermission.READ_ONLY);
269    }
270    
271    public Color getBackgroundColor() {
272        return getBackgroundColor(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
273    }
274    
275    public Color getBackgroundColorForUpdate(Session session) {
276        return getBackgroundColor(session, EntityPermission.READ_WRITE);
277    }
278    
279    public Color getBackgroundColorForUpdate() {
280        return getBackgroundColor(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
281    }
282    
283    public void setBackgroundColorPK(ColorPK backgroundColorPK)
284            throws PersistenceNotNullException, PersistenceReadOnlyException {
285        checkReadWrite();
286        _value.setBackgroundColorPK(backgroundColorPK);
287    }
288    
289    public void setBackgroundColor(Color entity) {
290        setBackgroundColorPK(entity == null? null: entity.getPrimaryKey());
291    }
292    
293    public boolean getBackgroundColorPKHasBeenModified() {
294        return _value.getBackgroundColorPKHasBeenModified();
295    }
296    
297    public FontStylePK getFontStylePK() {
298        return _value.getFontStylePK();
299    }
300    
301    public FontStyle getFontStyle(Session session, EntityPermission entityPermission) {
302        FontStylePK pk = getFontStylePK();
303        FontStyle entity = pk == null? null: FontStyleFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
304        
305        return entity;
306    }
307    
308    public FontStyle getFontStyle(EntityPermission entityPermission) {
309        return getFontStyle(ThreadSession.currentSession(), entityPermission);
310    }
311    
312    public FontStyle getFontStyle(Session session) {
313        return getFontStyle(session, EntityPermission.READ_ONLY);
314    }
315    
316    public FontStyle getFontStyle() {
317        return getFontStyle(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
318    }
319    
320    public FontStyle getFontStyleForUpdate(Session session) {
321        return getFontStyle(session, EntityPermission.READ_WRITE);
322    }
323    
324    public FontStyle getFontStyleForUpdate() {
325        return getFontStyle(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
326    }
327    
328    public void setFontStylePK(FontStylePK fontStylePK)
329            throws PersistenceNotNullException, PersistenceReadOnlyException {
330        checkReadWrite();
331        _value.setFontStylePK(fontStylePK);
332    }
333    
334    public void setFontStyle(FontStyle entity) {
335        setFontStylePK(entity == null? null: entity.getPrimaryKey());
336    }
337    
338    public boolean getFontStylePKHasBeenModified() {
339        return _value.getFontStylePKHasBeenModified();
340    }
341    
342    public FontWeightPK getFontWeightPK() {
343        return _value.getFontWeightPK();
344    }
345    
346    public FontWeight getFontWeight(Session session, EntityPermission entityPermission) {
347        FontWeightPK pk = getFontWeightPK();
348        FontWeight entity = pk == null? null: FontWeightFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
349        
350        return entity;
351    }
352    
353    public FontWeight getFontWeight(EntityPermission entityPermission) {
354        return getFontWeight(ThreadSession.currentSession(), entityPermission);
355    }
356    
357    public FontWeight getFontWeight(Session session) {
358        return getFontWeight(session, EntityPermission.READ_ONLY);
359    }
360    
361    public FontWeight getFontWeight() {
362        return getFontWeight(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
363    }
364    
365    public FontWeight getFontWeightForUpdate(Session session) {
366        return getFontWeight(session, EntityPermission.READ_WRITE);
367    }
368    
369    public FontWeight getFontWeightForUpdate() {
370        return getFontWeight(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
371    }
372    
373    public void setFontWeightPK(FontWeightPK fontWeightPK)
374            throws PersistenceNotNullException, PersistenceReadOnlyException {
375        checkReadWrite();
376        _value.setFontWeightPK(fontWeightPK);
377    }
378    
379    public void setFontWeight(FontWeight entity) {
380        setFontWeightPK(entity == null? null: entity.getPrimaryKey());
381    }
382    
383    public boolean getFontWeightPKHasBeenModified() {
384        return _value.getFontWeightPKHasBeenModified();
385    }
386    
387    public Boolean getIsDefault() {
388        return _value.getIsDefault();
389    }
390    
391    public void setIsDefault(Boolean isDefault)
392            throws PersistenceNotNullException, PersistenceReadOnlyException {
393        checkReadWrite();
394        _value.setIsDefault(isDefault);
395    }
396    
397    public boolean getIsDefaultHasBeenModified() {
398        return _value.getIsDefaultHasBeenModified();
399    }
400    
401    public Integer getSortOrder() {
402        return _value.getSortOrder();
403    }
404    
405    public void setSortOrder(Integer sortOrder)
406            throws PersistenceNotNullException, PersistenceReadOnlyException {
407        checkReadWrite();
408        _value.setSortOrder(sortOrder);
409    }
410    
411    public boolean getSortOrderHasBeenModified() {
412        return _value.getSortOrderHasBeenModified();
413    }
414    
415    public Long getFromTime() {
416        return _value.getFromTime();
417    }
418    
419    public void setFromTime(Long fromTime)
420            throws PersistenceNotNullException, PersistenceReadOnlyException {
421        checkReadWrite();
422        _value.setFromTime(fromTime);
423    }
424    
425    public boolean getFromTimeHasBeenModified() {
426        return _value.getFromTimeHasBeenModified();
427    }
428    
429    public Long getThruTime() {
430        return _value.getThruTime();
431    }
432    
433    public void setThruTime(Long thruTime)
434            throws PersistenceNotNullException, PersistenceReadOnlyException {
435        checkReadWrite();
436        _value.setThruTime(thruTime);
437    }
438    
439    public boolean getThruTimeHasBeenModified() {
440        return _value.getThruTimeHasBeenModified();
441    }
442    
443}