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 * ContentCategoryDetail.java
021 */
022
023package com.echothree.model.data.content.server.entity;
024
025import com.echothree.model.data.content.common.pk.ContentCategoryDetailPK;
026
027import com.echothree.model.data.content.common.pk.ContentCategoryPK;
028import com.echothree.model.data.content.common.pk.ContentCatalogPK;
029import com.echothree.model.data.offer.common.pk.OfferUsePK;
030import com.echothree.model.data.selector.common.pk.SelectorPK;
031
032import com.echothree.model.data.content.server.entity.ContentCategory;
033import com.echothree.model.data.content.server.entity.ContentCatalog;
034import com.echothree.model.data.offer.server.entity.OfferUse;
035import com.echothree.model.data.selector.server.entity.Selector;
036
037import com.echothree.model.data.content.server.factory.ContentCategoryFactory;
038import com.echothree.model.data.content.server.factory.ContentCatalogFactory;
039import com.echothree.model.data.offer.server.factory.OfferUseFactory;
040import com.echothree.model.data.selector.server.factory.SelectorFactory;
041
042import com.echothree.model.data.content.common.pk.ContentCategoryDetailPK;
043
044import com.echothree.model.data.content.server.value.ContentCategoryDetailValue;
045
046import com.echothree.model.data.content.server.factory.ContentCategoryDetailFactory;
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
064import javax.annotation.Nonnull;
065import javax.annotation.Nullable;
066
067public class ContentCategoryDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private ContentCategoryDetailPK _pk;
072    private ContentCategoryDetailValue _value;
073    
074    /** Creates a new instance of ContentCategoryDetail */
075    public ContentCategoryDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of ContentCategoryDetail */
081    public ContentCategoryDetail(ContentCategoryDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    @Nonnull
090    public ContentCategoryDetailFactory getBaseFactoryInstance() {
091        return ContentCategoryDetailFactory.getInstance();
092    }
093    
094    @Override
095    public boolean hasBeenModified() {
096        return _value.hasBeenModified();
097    }
098    
099    @Override
100    public int hashCode() {
101        return _pk.hashCode();
102    }
103    
104    @Override
105    @Nonnull
106    public String toString() {
107        return _pk.toString();
108    }
109    
110    @Override
111    public boolean equals(Object other) {
112        if(this == other)
113            return true;
114        
115        if(other instanceof ContentCategoryDetail that) {
116            ContentCategoryDetailValue thatValue = that.getContentCategoryDetailValue();
117            return _value.equals(thatValue);
118        } else {
119            return false;
120        }
121    }
122    
123    @Override
124    public void store()
125            throws PersistenceDatabaseException {
126        getBaseFactoryInstance().store(this);
127    }
128    
129    @Override
130    public void remove()
131            throws PersistenceDatabaseException {
132        getBaseFactoryInstance().remove(this);
133    }
134    
135    @Nonnull
136    public ContentCategoryDetailValue getContentCategoryDetailValue() {
137        return _value;
138    }
139    
140    public void setContentCategoryDetailValue(@Nonnull ContentCategoryDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    @Nonnull
148    public ContentCategoryDetailPK getPrimaryKey() {
149        return _pk;
150    }
151    
152    @Nonnull
153    public ContentCategoryPK getContentCategoryPK() {
154        return _value.getContentCategoryPK();
155    }
156    
157    @Nonnull
158    public ContentCategory getContentCategory(EntityPermission entityPermission) {
159        return ContentCategoryFactory.getInstance().getEntityFromPK(entityPermission, getContentCategoryPK());
160    }
161    
162    @Nonnull
163    public ContentCategory getContentCategory() {
164        return getContentCategory(EntityPermission.READ_ONLY);
165    }
166    
167    @Nonnull
168    public ContentCategory getContentCategoryForUpdate() {
169        return getContentCategory(EntityPermission.READ_WRITE);
170    }
171    
172    public void setContentCategoryPK(@Nonnull ContentCategoryPK contentCategoryPK)
173            throws PersistenceNotNullException, PersistenceReadOnlyException {
174        checkReadWrite();
175        _value.setContentCategoryPK(contentCategoryPK);
176    }
177    
178    public void setContentCategory(@Nonnull ContentCategory entity) {
179        setContentCategoryPK(entity == null ? null : entity.getPrimaryKey());
180    }
181    
182    public boolean getContentCategoryPKHasBeenModified() {
183        return _value.getContentCategoryPKHasBeenModified();
184    }
185    
186    @Nonnull
187    public ContentCatalogPK getContentCatalogPK() {
188        return _value.getContentCatalogPK();
189    }
190    
191    @Nonnull
192    public ContentCatalog getContentCatalog(EntityPermission entityPermission) {
193        return ContentCatalogFactory.getInstance().getEntityFromPK(entityPermission, getContentCatalogPK());
194    }
195    
196    @Nonnull
197    public ContentCatalog getContentCatalog() {
198        return getContentCatalog(EntityPermission.READ_ONLY);
199    }
200    
201    @Nonnull
202    public ContentCatalog getContentCatalogForUpdate() {
203        return getContentCatalog(EntityPermission.READ_WRITE);
204    }
205    
206    public void setContentCatalogPK(@Nonnull ContentCatalogPK contentCatalogPK)
207            throws PersistenceNotNullException, PersistenceReadOnlyException {
208        checkReadWrite();
209        _value.setContentCatalogPK(contentCatalogPK);
210    }
211    
212    public void setContentCatalog(@Nonnull ContentCatalog entity) {
213        setContentCatalogPK(entity == null ? null : entity.getPrimaryKey());
214    }
215    
216    public boolean getContentCatalogPKHasBeenModified() {
217        return _value.getContentCatalogPKHasBeenModified();
218    }
219    
220    @Nonnull
221    public String getContentCategoryName() {
222        return _value.getContentCategoryName();
223    }
224    
225    public void setContentCategoryName(@Nonnull String contentCategoryName)
226            throws PersistenceNotNullException, PersistenceReadOnlyException {
227        checkReadWrite();
228        _value.setContentCategoryName(contentCategoryName);
229    }
230    
231    public boolean getContentCategoryNameHasBeenModified() {
232        return _value.getContentCategoryNameHasBeenModified();
233    }
234    
235    @Nullable
236    public ContentCategoryPK getParentContentCategoryPK() {
237        return _value.getParentContentCategoryPK();
238    }
239    
240    @Nullable
241    public ContentCategory getParentContentCategory(EntityPermission entityPermission) {
242        ContentCategoryPK pk = getParentContentCategoryPK();
243        ContentCategory entity = pk == null? null: ContentCategoryFactory.getInstance().getEntityFromPK(entityPermission, pk);
244        
245        return entity;
246    }
247    
248    @Nullable
249    public ContentCategory getParentContentCategory() {
250        return getParentContentCategory(EntityPermission.READ_ONLY);
251    }
252    
253    @Nullable
254    public ContentCategory getParentContentCategoryForUpdate() {
255        return getParentContentCategory(EntityPermission.READ_WRITE);
256    }
257    
258    public void setParentContentCategoryPK(@Nullable ContentCategoryPK parentContentCategoryPK)
259            throws PersistenceNotNullException, PersistenceReadOnlyException {
260        checkReadWrite();
261        _value.setParentContentCategoryPK(parentContentCategoryPK);
262    }
263    
264    public void setParentContentCategory(@Nullable ContentCategory entity) {
265        setParentContentCategoryPK(entity == null ? null : entity.getPrimaryKey());
266    }
267    
268    public boolean getParentContentCategoryPKHasBeenModified() {
269        return _value.getParentContentCategoryPKHasBeenModified();
270    }
271    
272    @Nullable
273    public OfferUsePK getDefaultOfferUsePK() {
274        return _value.getDefaultOfferUsePK();
275    }
276    
277    @Nullable
278    public OfferUse getDefaultOfferUse(EntityPermission entityPermission) {
279        OfferUsePK pk = getDefaultOfferUsePK();
280        OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(entityPermission, pk);
281        
282        return entity;
283    }
284    
285    @Nullable
286    public OfferUse getDefaultOfferUse() {
287        return getDefaultOfferUse(EntityPermission.READ_ONLY);
288    }
289    
290    @Nullable
291    public OfferUse getDefaultOfferUseForUpdate() {
292        return getDefaultOfferUse(EntityPermission.READ_WRITE);
293    }
294    
295    public void setDefaultOfferUsePK(@Nullable OfferUsePK defaultOfferUsePK)
296            throws PersistenceNotNullException, PersistenceReadOnlyException {
297        checkReadWrite();
298        _value.setDefaultOfferUsePK(defaultOfferUsePK);
299    }
300    
301    public void setDefaultOfferUse(@Nullable OfferUse entity) {
302        setDefaultOfferUsePK(entity == null ? null : entity.getPrimaryKey());
303    }
304    
305    public boolean getDefaultOfferUsePKHasBeenModified() {
306        return _value.getDefaultOfferUsePKHasBeenModified();
307    }
308    
309    @Nullable
310    public SelectorPK getContentCategoryItemSelectorPK() {
311        return _value.getContentCategoryItemSelectorPK();
312    }
313    
314    @Nullable
315    public Selector getContentCategoryItemSelector(EntityPermission entityPermission) {
316        SelectorPK pk = getContentCategoryItemSelectorPK();
317        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk);
318        
319        return entity;
320    }
321    
322    @Nullable
323    public Selector getContentCategoryItemSelector() {
324        return getContentCategoryItemSelector(EntityPermission.READ_ONLY);
325    }
326    
327    @Nullable
328    public Selector getContentCategoryItemSelectorForUpdate() {
329        return getContentCategoryItemSelector(EntityPermission.READ_WRITE);
330    }
331    
332    public void setContentCategoryItemSelectorPK(@Nullable SelectorPK contentCategoryItemSelectorPK)
333            throws PersistenceNotNullException, PersistenceReadOnlyException {
334        checkReadWrite();
335        _value.setContentCategoryItemSelectorPK(contentCategoryItemSelectorPK);
336    }
337    
338    public void setContentCategoryItemSelector(@Nullable Selector entity) {
339        setContentCategoryItemSelectorPK(entity == null ? null : entity.getPrimaryKey());
340    }
341    
342    public boolean getContentCategoryItemSelectorPKHasBeenModified() {
343        return _value.getContentCategoryItemSelectorPKHasBeenModified();
344    }
345    
346    @Nonnull
347    public Boolean getIsDefault() {
348        return _value.getIsDefault();
349    }
350    
351    public void setIsDefault(@Nonnull Boolean isDefault)
352            throws PersistenceNotNullException, PersistenceReadOnlyException {
353        checkReadWrite();
354        _value.setIsDefault(isDefault);
355    }
356    
357    public boolean getIsDefaultHasBeenModified() {
358        return _value.getIsDefaultHasBeenModified();
359    }
360    
361    @Nonnull
362    public Integer getSortOrder() {
363        return _value.getSortOrder();
364    }
365    
366    public void setSortOrder(@Nonnull Integer sortOrder)
367            throws PersistenceNotNullException, PersistenceReadOnlyException {
368        checkReadWrite();
369        _value.setSortOrder(sortOrder);
370    }
371    
372    public boolean getSortOrderHasBeenModified() {
373        return _value.getSortOrderHasBeenModified();
374    }
375    
376    @Nonnull
377    public Long getFromTime() {
378        return _value.getFromTime();
379    }
380    
381    public void setFromTime(@Nonnull Long fromTime)
382            throws PersistenceNotNullException, PersistenceReadOnlyException {
383        checkReadWrite();
384        _value.setFromTime(fromTime);
385    }
386    
387    public boolean getFromTimeHasBeenModified() {
388        return _value.getFromTimeHasBeenModified();
389    }
390    
391    @Nonnull
392    public Long getThruTime() {
393        return _value.getThruTime();
394    }
395    
396    public void setThruTime(@Nonnull Long thruTime)
397            throws PersistenceNotNullException, PersistenceReadOnlyException {
398        checkReadWrite();
399        _value.setThruTime(thruTime);
400    }
401    
402    public boolean getThruTimeHasBeenModified() {
403        return _value.getThruTimeHasBeenModified();
404    }
405    
406}