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