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