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 * 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
064public class ContentCategoryDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private ContentCategoryDetailPK _pk;
069    private ContentCategoryDetailValue _value;
070    
071    /** Creates a new instance of ContentCategoryDetail */
072    public ContentCategoryDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of ContentCategoryDetail */
078    public ContentCategoryDetail(ContentCategoryDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public ContentCategoryDetailFactory getBaseFactoryInstance() {
087        return ContentCategoryDetailFactory.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 ContentCategoryDetail that) {
111            ContentCategoryDetailValue thatValue = that.getContentCategoryDetailValue();
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 ContentCategoryDetailValue getContentCategoryDetailValue() {
137        return _value;
138    }
139    
140    public void setContentCategoryDetailValue(ContentCategoryDetailValue value)
141            throws PersistenceReadOnlyException {
142        checkReadWrite();
143        _value = value;
144    }
145    
146    @Override
147    public ContentCategoryDetailPK getPrimaryKey() {
148        return _pk;
149    }
150    
151    public ContentCategoryPK getContentCategoryPK() {
152        return _value.getContentCategoryPK();
153    }
154    
155    public ContentCategory getContentCategory(Session session, EntityPermission entityPermission) {
156        return ContentCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, getContentCategoryPK());
157    }
158    
159    public ContentCategory getContentCategory(EntityPermission entityPermission) {
160        return getContentCategory(ThreadSession.currentSession(), entityPermission);
161    }
162    
163    public ContentCategory getContentCategory(Session session) {
164        return getContentCategory(session, EntityPermission.READ_ONLY);
165    }
166    
167    public ContentCategory getContentCategory() {
168        return getContentCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
169    }
170    
171    public ContentCategory getContentCategoryForUpdate(Session session) {
172        return getContentCategory(session, EntityPermission.READ_WRITE);
173    }
174    
175    public ContentCategory getContentCategoryForUpdate() {
176        return getContentCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
177    }
178    
179    public void setContentCategoryPK(ContentCategoryPK contentCategoryPK)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setContentCategoryPK(contentCategoryPK);
183    }
184    
185    public void setContentCategory(ContentCategory entity) {
186        setContentCategoryPK(entity == null? null: entity.getPrimaryKey());
187    }
188    
189    public boolean getContentCategoryPKHasBeenModified() {
190        return _value.getContentCategoryPKHasBeenModified();
191    }
192    
193    public ContentCatalogPK getContentCatalogPK() {
194        return _value.getContentCatalogPK();
195    }
196    
197    public ContentCatalog getContentCatalog(Session session, EntityPermission entityPermission) {
198        return ContentCatalogFactory.getInstance().getEntityFromPK(session, entityPermission, getContentCatalogPK());
199    }
200    
201    public ContentCatalog getContentCatalog(EntityPermission entityPermission) {
202        return getContentCatalog(ThreadSession.currentSession(), entityPermission);
203    }
204    
205    public ContentCatalog getContentCatalog(Session session) {
206        return getContentCatalog(session, EntityPermission.READ_ONLY);
207    }
208    
209    public ContentCatalog getContentCatalog() {
210        return getContentCatalog(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
211    }
212    
213    public ContentCatalog getContentCatalogForUpdate(Session session) {
214        return getContentCatalog(session, EntityPermission.READ_WRITE);
215    }
216    
217    public ContentCatalog getContentCatalogForUpdate() {
218        return getContentCatalog(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
219    }
220    
221    public void setContentCatalogPK(ContentCatalogPK contentCatalogPK)
222            throws PersistenceNotNullException, PersistenceReadOnlyException {
223        checkReadWrite();
224        _value.setContentCatalogPK(contentCatalogPK);
225    }
226    
227    public void setContentCatalog(ContentCatalog entity) {
228        setContentCatalogPK(entity == null? null: entity.getPrimaryKey());
229    }
230    
231    public boolean getContentCatalogPKHasBeenModified() {
232        return _value.getContentCatalogPKHasBeenModified();
233    }
234    
235    public String getContentCategoryName() {
236        return _value.getContentCategoryName();
237    }
238    
239    public void setContentCategoryName(String contentCategoryName)
240            throws PersistenceNotNullException, PersistenceReadOnlyException {
241        checkReadWrite();
242        _value.setContentCategoryName(contentCategoryName);
243    }
244    
245    public boolean getContentCategoryNameHasBeenModified() {
246        return _value.getContentCategoryNameHasBeenModified();
247    }
248    
249    public ContentCategoryPK getParentContentCategoryPK() {
250        return _value.getParentContentCategoryPK();
251    }
252    
253    public ContentCategory getParentContentCategory(Session session, EntityPermission entityPermission) {
254        ContentCategoryPK pk = getParentContentCategoryPK();
255        ContentCategory entity = pk == null? null: ContentCategoryFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
256        
257        return entity;
258    }
259    
260    public ContentCategory getParentContentCategory(EntityPermission entityPermission) {
261        return getParentContentCategory(ThreadSession.currentSession(), entityPermission);
262    }
263    
264    public ContentCategory getParentContentCategory(Session session) {
265        return getParentContentCategory(session, EntityPermission.READ_ONLY);
266    }
267    
268    public ContentCategory getParentContentCategory() {
269        return getParentContentCategory(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
270    }
271    
272    public ContentCategory getParentContentCategoryForUpdate(Session session) {
273        return getParentContentCategory(session, EntityPermission.READ_WRITE);
274    }
275    
276    public ContentCategory getParentContentCategoryForUpdate() {
277        return getParentContentCategory(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
278    }
279    
280    public void setParentContentCategoryPK(ContentCategoryPK parentContentCategoryPK)
281            throws PersistenceNotNullException, PersistenceReadOnlyException {
282        checkReadWrite();
283        _value.setParentContentCategoryPK(parentContentCategoryPK);
284    }
285    
286    public void setParentContentCategory(ContentCategory entity) {
287        setParentContentCategoryPK(entity == null? null: entity.getPrimaryKey());
288    }
289    
290    public boolean getParentContentCategoryPKHasBeenModified() {
291        return _value.getParentContentCategoryPKHasBeenModified();
292    }
293    
294    public OfferUsePK getDefaultOfferUsePK() {
295        return _value.getDefaultOfferUsePK();
296    }
297    
298    public OfferUse getDefaultOfferUse(Session session, EntityPermission entityPermission) {
299        OfferUsePK pk = getDefaultOfferUsePK();
300        OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
301        
302        return entity;
303    }
304    
305    public OfferUse getDefaultOfferUse(EntityPermission entityPermission) {
306        return getDefaultOfferUse(ThreadSession.currentSession(), entityPermission);
307    }
308    
309    public OfferUse getDefaultOfferUse(Session session) {
310        return getDefaultOfferUse(session, EntityPermission.READ_ONLY);
311    }
312    
313    public OfferUse getDefaultOfferUse() {
314        return getDefaultOfferUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
315    }
316    
317    public OfferUse getDefaultOfferUseForUpdate(Session session) {
318        return getDefaultOfferUse(session, EntityPermission.READ_WRITE);
319    }
320    
321    public OfferUse getDefaultOfferUseForUpdate() {
322        return getDefaultOfferUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
323    }
324    
325    public void setDefaultOfferUsePK(OfferUsePK defaultOfferUsePK)
326            throws PersistenceNotNullException, PersistenceReadOnlyException {
327        checkReadWrite();
328        _value.setDefaultOfferUsePK(defaultOfferUsePK);
329    }
330    
331    public void setDefaultOfferUse(OfferUse entity) {
332        setDefaultOfferUsePK(entity == null? null: entity.getPrimaryKey());
333    }
334    
335    public boolean getDefaultOfferUsePKHasBeenModified() {
336        return _value.getDefaultOfferUsePKHasBeenModified();
337    }
338    
339    public SelectorPK getContentCategoryItemSelectorPK() {
340        return _value.getContentCategoryItemSelectorPK();
341    }
342    
343    public Selector getContentCategoryItemSelector(Session session, EntityPermission entityPermission) {
344        SelectorPK pk = getContentCategoryItemSelectorPK();
345        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
346        
347        return entity;
348    }
349    
350    public Selector getContentCategoryItemSelector(EntityPermission entityPermission) {
351        return getContentCategoryItemSelector(ThreadSession.currentSession(), entityPermission);
352    }
353    
354    public Selector getContentCategoryItemSelector(Session session) {
355        return getContentCategoryItemSelector(session, EntityPermission.READ_ONLY);
356    }
357    
358    public Selector getContentCategoryItemSelector() {
359        return getContentCategoryItemSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
360    }
361    
362    public Selector getContentCategoryItemSelectorForUpdate(Session session) {
363        return getContentCategoryItemSelector(session, EntityPermission.READ_WRITE);
364    }
365    
366    public Selector getContentCategoryItemSelectorForUpdate() {
367        return getContentCategoryItemSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
368    }
369    
370    public void setContentCategoryItemSelectorPK(SelectorPK contentCategoryItemSelectorPK)
371            throws PersistenceNotNullException, PersistenceReadOnlyException {
372        checkReadWrite();
373        _value.setContentCategoryItemSelectorPK(contentCategoryItemSelectorPK);
374    }
375    
376    public void setContentCategoryItemSelector(Selector entity) {
377        setContentCategoryItemSelectorPK(entity == null? null: entity.getPrimaryKey());
378    }
379    
380    public boolean getContentCategoryItemSelectorPKHasBeenModified() {
381        return _value.getContentCategoryItemSelectorPKHasBeenModified();
382    }
383    
384    public Boolean getIsDefault() {
385        return _value.getIsDefault();
386    }
387    
388    public void setIsDefault(Boolean isDefault)
389            throws PersistenceNotNullException, PersistenceReadOnlyException {
390        checkReadWrite();
391        _value.setIsDefault(isDefault);
392    }
393    
394    public boolean getIsDefaultHasBeenModified() {
395        return _value.getIsDefaultHasBeenModified();
396    }
397    
398    public Integer getSortOrder() {
399        return _value.getSortOrder();
400    }
401    
402    public void setSortOrder(Integer sortOrder)
403            throws PersistenceNotNullException, PersistenceReadOnlyException {
404        checkReadWrite();
405        _value.setSortOrder(sortOrder);
406    }
407    
408    public boolean getSortOrderHasBeenModified() {
409        return _value.getSortOrderHasBeenModified();
410    }
411    
412    public Long getFromTime() {
413        return _value.getFromTime();
414    }
415    
416    public void setFromTime(Long fromTime)
417            throws PersistenceNotNullException, PersistenceReadOnlyException {
418        checkReadWrite();
419        _value.setFromTime(fromTime);
420    }
421    
422    public boolean getFromTimeHasBeenModified() {
423        return _value.getFromTimeHasBeenModified();
424    }
425    
426    public Long getThruTime() {
427        return _value.getThruTime();
428    }
429    
430    public void setThruTime(Long thruTime)
431            throws PersistenceNotNullException, PersistenceReadOnlyException {
432        checkReadWrite();
433        _value.setThruTime(thruTime);
434    }
435    
436    public boolean getThruTimeHasBeenModified() {
437        return _value.getThruTimeHasBeenModified();
438    }
439    
440}