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 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() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public ContentCategoryDetailValue getContentCategoryDetailValue() { 131 return _value; 132 } 133 134 public void setContentCategoryDetailValue(ContentCategoryDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public ContentCategoryDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public ContentCategoryPK getContentCategoryPK() { 146 return _value.getContentCategoryPK(); 147 } 148 149 public ContentCategory getContentCategory(EntityPermission entityPermission) { 150 return ContentCategoryFactory.getInstance().getEntityFromPK(entityPermission, getContentCategoryPK()); 151 } 152 153 public ContentCategory getContentCategory() { 154 return getContentCategory(EntityPermission.READ_ONLY); 155 } 156 157 public ContentCategory getContentCategoryForUpdate() { 158 return getContentCategory(EntityPermission.READ_WRITE); 159 } 160 161 public void setContentCategoryPK(ContentCategoryPK contentCategoryPK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setContentCategoryPK(contentCategoryPK); 165 } 166 167 public void setContentCategory(ContentCategory entity) { 168 setContentCategoryPK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getContentCategoryPKHasBeenModified() { 172 return _value.getContentCategoryPKHasBeenModified(); 173 } 174 175 public ContentCatalogPK getContentCatalogPK() { 176 return _value.getContentCatalogPK(); 177 } 178 179 public ContentCatalog getContentCatalog(EntityPermission entityPermission) { 180 return ContentCatalogFactory.getInstance().getEntityFromPK(entityPermission, getContentCatalogPK()); 181 } 182 183 public ContentCatalog getContentCatalog() { 184 return getContentCatalog(EntityPermission.READ_ONLY); 185 } 186 187 public ContentCatalog getContentCatalogForUpdate() { 188 return getContentCatalog(EntityPermission.READ_WRITE); 189 } 190 191 public void setContentCatalogPK(ContentCatalogPK contentCatalogPK) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setContentCatalogPK(contentCatalogPK); 195 } 196 197 public void setContentCatalog(ContentCatalog entity) { 198 setContentCatalogPK(entity == null? null: entity.getPrimaryKey()); 199 } 200 201 public boolean getContentCatalogPKHasBeenModified() { 202 return _value.getContentCatalogPKHasBeenModified(); 203 } 204 205 public String getContentCategoryName() { 206 return _value.getContentCategoryName(); 207 } 208 209 public void setContentCategoryName(String contentCategoryName) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setContentCategoryName(contentCategoryName); 213 } 214 215 public boolean getContentCategoryNameHasBeenModified() { 216 return _value.getContentCategoryNameHasBeenModified(); 217 } 218 219 public ContentCategoryPK getParentContentCategoryPK() { 220 return _value.getParentContentCategoryPK(); 221 } 222 223 public ContentCategory getParentContentCategory(EntityPermission entityPermission) { 224 ContentCategoryPK pk = getParentContentCategoryPK(); 225 ContentCategory entity = pk == null? null: ContentCategoryFactory.getInstance().getEntityFromPK(entityPermission, pk); 226 227 return entity; 228 } 229 230 public ContentCategory getParentContentCategory() { 231 return getParentContentCategory(EntityPermission.READ_ONLY); 232 } 233 234 public ContentCategory getParentContentCategoryForUpdate() { 235 return getParentContentCategory(EntityPermission.READ_WRITE); 236 } 237 238 public void setParentContentCategoryPK(ContentCategoryPK parentContentCategoryPK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setParentContentCategoryPK(parentContentCategoryPK); 242 } 243 244 public void setParentContentCategory(ContentCategory entity) { 245 setParentContentCategoryPK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getParentContentCategoryPKHasBeenModified() { 249 return _value.getParentContentCategoryPKHasBeenModified(); 250 } 251 252 public OfferUsePK getDefaultOfferUsePK() { 253 return _value.getDefaultOfferUsePK(); 254 } 255 256 public OfferUse getDefaultOfferUse(EntityPermission entityPermission) { 257 OfferUsePK pk = getDefaultOfferUsePK(); 258 OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(entityPermission, pk); 259 260 return entity; 261 } 262 263 public OfferUse getDefaultOfferUse() { 264 return getDefaultOfferUse(EntityPermission.READ_ONLY); 265 } 266 267 public OfferUse getDefaultOfferUseForUpdate() { 268 return getDefaultOfferUse(EntityPermission.READ_WRITE); 269 } 270 271 public void setDefaultOfferUsePK(OfferUsePK defaultOfferUsePK) 272 throws PersistenceNotNullException, PersistenceReadOnlyException { 273 checkReadWrite(); 274 _value.setDefaultOfferUsePK(defaultOfferUsePK); 275 } 276 277 public void setDefaultOfferUse(OfferUse entity) { 278 setDefaultOfferUsePK(entity == null? null: entity.getPrimaryKey()); 279 } 280 281 public boolean getDefaultOfferUsePKHasBeenModified() { 282 return _value.getDefaultOfferUsePKHasBeenModified(); 283 } 284 285 public SelectorPK getContentCategoryItemSelectorPK() { 286 return _value.getContentCategoryItemSelectorPK(); 287 } 288 289 public Selector getContentCategoryItemSelector(EntityPermission entityPermission) { 290 SelectorPK pk = getContentCategoryItemSelectorPK(); 291 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 292 293 return entity; 294 } 295 296 public Selector getContentCategoryItemSelector() { 297 return getContentCategoryItemSelector(EntityPermission.READ_ONLY); 298 } 299 300 public Selector getContentCategoryItemSelectorForUpdate() { 301 return getContentCategoryItemSelector(EntityPermission.READ_WRITE); 302 } 303 304 public void setContentCategoryItemSelectorPK(SelectorPK contentCategoryItemSelectorPK) 305 throws PersistenceNotNullException, PersistenceReadOnlyException { 306 checkReadWrite(); 307 _value.setContentCategoryItemSelectorPK(contentCategoryItemSelectorPK); 308 } 309 310 public void setContentCategoryItemSelector(Selector entity) { 311 setContentCategoryItemSelectorPK(entity == null? null: entity.getPrimaryKey()); 312 } 313 314 public boolean getContentCategoryItemSelectorPKHasBeenModified() { 315 return _value.getContentCategoryItemSelectorPKHasBeenModified(); 316 } 317 318 public Boolean getIsDefault() { 319 return _value.getIsDefault(); 320 } 321 322 public void setIsDefault(Boolean isDefault) 323 throws PersistenceNotNullException, PersistenceReadOnlyException { 324 checkReadWrite(); 325 _value.setIsDefault(isDefault); 326 } 327 328 public boolean getIsDefaultHasBeenModified() { 329 return _value.getIsDefaultHasBeenModified(); 330 } 331 332 public Integer getSortOrder() { 333 return _value.getSortOrder(); 334 } 335 336 public void setSortOrder(Integer sortOrder) 337 throws PersistenceNotNullException, PersistenceReadOnlyException { 338 checkReadWrite(); 339 _value.setSortOrder(sortOrder); 340 } 341 342 public boolean getSortOrderHasBeenModified() { 343 return _value.getSortOrderHasBeenModified(); 344 } 345 346 public Long getFromTime() { 347 return _value.getFromTime(); 348 } 349 350 public void setFromTime(Long fromTime) 351 throws PersistenceNotNullException, PersistenceReadOnlyException { 352 checkReadWrite(); 353 _value.setFromTime(fromTime); 354 } 355 356 public boolean getFromTimeHasBeenModified() { 357 return _value.getFromTimeHasBeenModified(); 358 } 359 360 public Long getThruTime() { 361 return _value.getThruTime(); 362 } 363 364 public void setThruTime(Long thruTime) 365 throws PersistenceNotNullException, PersistenceReadOnlyException { 366 checkReadWrite(); 367 _value.setThruTime(thruTime); 368 } 369 370 public boolean getThruTimeHasBeenModified() { 371 return _value.getThruTimeHasBeenModified(); 372 } 373 374}