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 * ForumDetail.java 021 */ 022 023package com.echothree.model.data.forum.server.entity; 024 025import com.echothree.model.data.forum.common.pk.ForumDetailPK; 026 027import com.echothree.model.data.forum.common.pk.ForumPK; 028import com.echothree.model.data.forum.common.pk.ForumTypePK; 029import com.echothree.model.data.icon.common.pk.IconPK; 030import com.echothree.model.data.sequence.common.pk.SequencePK; 031 032import com.echothree.model.data.forum.server.entity.Forum; 033import com.echothree.model.data.forum.server.entity.ForumType; 034import com.echothree.model.data.icon.server.entity.Icon; 035import com.echothree.model.data.sequence.server.entity.Sequence; 036 037import com.echothree.model.data.forum.server.factory.ForumFactory; 038import com.echothree.model.data.forum.server.factory.ForumTypeFactory; 039import com.echothree.model.data.icon.server.factory.IconFactory; 040import com.echothree.model.data.sequence.server.factory.SequenceFactory; 041 042import com.echothree.model.data.forum.common.pk.ForumDetailPK; 043 044import com.echothree.model.data.forum.server.value.ForumDetailValue; 045 046import com.echothree.model.data.forum.server.factory.ForumDetailFactory; 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 ForumDetail 068 extends BaseEntity 069 implements Serializable { 070 071 private ForumDetailPK _pk; 072 private ForumDetailValue _value; 073 074 /** Creates a new instance of ForumDetail */ 075 public ForumDetail() 076 throws PersistenceException { 077 super(); 078 } 079 080 /** Creates a new instance of ForumDetail */ 081 public ForumDetail(ForumDetailValue value, EntityPermission entityPermission) { 082 super(entityPermission); 083 084 _value = value; 085 _pk = value.getPrimaryKey(); 086 } 087 088 @Override 089 @Nonnull 090 public ForumDetailFactory getBaseFactoryInstance() { 091 return ForumDetailFactory.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 ForumDetail that) { 116 ForumDetailValue thatValue = that.getForumDetailValue(); 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 ForumDetailValue getForumDetailValue() { 137 return _value; 138 } 139 140 public void setForumDetailValue(@Nonnull ForumDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 @Nonnull 148 public ForumDetailPK getPrimaryKey() { 149 return _pk; 150 } 151 152 @Nonnull 153 public ForumPK getForumPK() { 154 return _value.getForumPK(); 155 } 156 157 @Nonnull 158 public Forum getForum(EntityPermission entityPermission) { 159 return ForumFactory.getInstance().getEntityFromPK(entityPermission, getForumPK()); 160 } 161 162 @Nonnull 163 public Forum getForum() { 164 return getForum(EntityPermission.READ_ONLY); 165 } 166 167 @Nonnull 168 public Forum getForumForUpdate() { 169 return getForum(EntityPermission.READ_WRITE); 170 } 171 172 public void setForumPK(@Nonnull ForumPK forumPK) 173 throws PersistenceNotNullException, PersistenceReadOnlyException { 174 checkReadWrite(); 175 _value.setForumPK(forumPK); 176 } 177 178 public void setForum(@Nonnull Forum entity) { 179 setForumPK(entity == null ? null : entity.getPrimaryKey()); 180 } 181 182 public boolean getForumPKHasBeenModified() { 183 return _value.getForumPKHasBeenModified(); 184 } 185 186 @Nonnull 187 public String getForumName() { 188 return _value.getForumName(); 189 } 190 191 public void setForumName(@Nonnull String forumName) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setForumName(forumName); 195 } 196 197 public boolean getForumNameHasBeenModified() { 198 return _value.getForumNameHasBeenModified(); 199 } 200 201 @Nonnull 202 public ForumTypePK getForumTypePK() { 203 return _value.getForumTypePK(); 204 } 205 206 @Nonnull 207 public ForumType getForumType(EntityPermission entityPermission) { 208 return ForumTypeFactory.getInstance().getEntityFromPK(entityPermission, getForumTypePK()); 209 } 210 211 @Nonnull 212 public ForumType getForumType() { 213 return getForumType(EntityPermission.READ_ONLY); 214 } 215 216 @Nonnull 217 public ForumType getForumTypeForUpdate() { 218 return getForumType(EntityPermission.READ_WRITE); 219 } 220 221 public void setForumTypePK(@Nonnull ForumTypePK forumTypePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setForumTypePK(forumTypePK); 225 } 226 227 public void setForumType(@Nonnull ForumType entity) { 228 setForumTypePK(entity == null ? null : entity.getPrimaryKey()); 229 } 230 231 public boolean getForumTypePKHasBeenModified() { 232 return _value.getForumTypePKHasBeenModified(); 233 } 234 235 @Nullable 236 public IconPK getIconPK() { 237 return _value.getIconPK(); 238 } 239 240 @Nullable 241 public Icon getIcon(EntityPermission entityPermission) { 242 IconPK pk = getIconPK(); 243 Icon entity = pk == null? null: IconFactory.getInstance().getEntityFromPK(entityPermission, pk); 244 245 return entity; 246 } 247 248 @Nullable 249 public Icon getIcon() { 250 return getIcon(EntityPermission.READ_ONLY); 251 } 252 253 @Nullable 254 public Icon getIconForUpdate() { 255 return getIcon(EntityPermission.READ_WRITE); 256 } 257 258 public void setIconPK(@Nullable IconPK iconPK) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setIconPK(iconPK); 262 } 263 264 public void setIcon(@Nullable Icon entity) { 265 setIconPK(entity == null ? null : entity.getPrimaryKey()); 266 } 267 268 public boolean getIconPKHasBeenModified() { 269 return _value.getIconPKHasBeenModified(); 270 } 271 272 @Nullable 273 public SequencePK getForumThreadSequencePK() { 274 return _value.getForumThreadSequencePK(); 275 } 276 277 @Nullable 278 public Sequence getForumThreadSequence(EntityPermission entityPermission) { 279 SequencePK pk = getForumThreadSequencePK(); 280 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 281 282 return entity; 283 } 284 285 @Nullable 286 public Sequence getForumThreadSequence() { 287 return getForumThreadSequence(EntityPermission.READ_ONLY); 288 } 289 290 @Nullable 291 public Sequence getForumThreadSequenceForUpdate() { 292 return getForumThreadSequence(EntityPermission.READ_WRITE); 293 } 294 295 public void setForumThreadSequencePK(@Nullable SequencePK forumThreadSequencePK) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setForumThreadSequencePK(forumThreadSequencePK); 299 } 300 301 public void setForumThreadSequence(@Nullable Sequence entity) { 302 setForumThreadSequencePK(entity == null ? null : entity.getPrimaryKey()); 303 } 304 305 public boolean getForumThreadSequencePKHasBeenModified() { 306 return _value.getForumThreadSequencePKHasBeenModified(); 307 } 308 309 @Nullable 310 public SequencePK getForumMessageSequencePK() { 311 return _value.getForumMessageSequencePK(); 312 } 313 314 @Nullable 315 public Sequence getForumMessageSequence(EntityPermission entityPermission) { 316 SequencePK pk = getForumMessageSequencePK(); 317 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 318 319 return entity; 320 } 321 322 @Nullable 323 public Sequence getForumMessageSequence() { 324 return getForumMessageSequence(EntityPermission.READ_ONLY); 325 } 326 327 @Nullable 328 public Sequence getForumMessageSequenceForUpdate() { 329 return getForumMessageSequence(EntityPermission.READ_WRITE); 330 } 331 332 public void setForumMessageSequencePK(@Nullable SequencePK forumMessageSequencePK) 333 throws PersistenceNotNullException, PersistenceReadOnlyException { 334 checkReadWrite(); 335 _value.setForumMessageSequencePK(forumMessageSequencePK); 336 } 337 338 public void setForumMessageSequence(@Nullable Sequence entity) { 339 setForumMessageSequencePK(entity == null ? null : entity.getPrimaryKey()); 340 } 341 342 public boolean getForumMessageSequencePKHasBeenModified() { 343 return _value.getForumMessageSequencePKHasBeenModified(); 344 } 345 346 @Nonnull 347 public Integer getSortOrder() { 348 return _value.getSortOrder(); 349 } 350 351 public void setSortOrder(@Nonnull Integer sortOrder) 352 throws PersistenceNotNullException, PersistenceReadOnlyException { 353 checkReadWrite(); 354 _value.setSortOrder(sortOrder); 355 } 356 357 public boolean getSortOrderHasBeenModified() { 358 return _value.getSortOrderHasBeenModified(); 359 } 360 361 @Nonnull 362 public Long getFromTime() { 363 return _value.getFromTime(); 364 } 365 366 public void setFromTime(@Nonnull Long fromTime) 367 throws PersistenceNotNullException, PersistenceReadOnlyException { 368 checkReadWrite(); 369 _value.setFromTime(fromTime); 370 } 371 372 public boolean getFromTimeHasBeenModified() { 373 return _value.getFromTimeHasBeenModified(); 374 } 375 376 @Nonnull 377 public Long getThruTime() { 378 return _value.getThruTime(); 379 } 380 381 public void setThruTime(@Nonnull Long thruTime) 382 throws PersistenceNotNullException, PersistenceReadOnlyException { 383 checkReadWrite(); 384 _value.setThruTime(thruTime); 385 } 386 387 public boolean getThruTimeHasBeenModified() { 388 return _value.getThruTimeHasBeenModified(); 389 } 390 391}