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 * ForumMessageDetail.java 021 */ 022 023package com.echothree.model.data.forum.server.entity; 024 025import com.echothree.model.data.forum.common.pk.ForumMessageDetailPK; 026 027import com.echothree.model.data.forum.common.pk.ForumMessagePK; 028import com.echothree.model.data.forum.common.pk.ForumThreadPK; 029import com.echothree.model.data.forum.common.pk.ForumMessageTypePK; 030import com.echothree.model.data.icon.common.pk.IconPK; 031 032import com.echothree.model.data.forum.server.entity.ForumMessage; 033import com.echothree.model.data.forum.server.entity.ForumThread; 034import com.echothree.model.data.forum.server.entity.ForumMessageType; 035import com.echothree.model.data.icon.server.entity.Icon; 036 037import com.echothree.model.data.forum.server.factory.ForumMessageFactory; 038import com.echothree.model.data.forum.server.factory.ForumThreadFactory; 039import com.echothree.model.data.forum.server.factory.ForumMessageTypeFactory; 040import com.echothree.model.data.icon.server.factory.IconFactory; 041 042import com.echothree.model.data.forum.common.pk.ForumMessageDetailPK; 043 044import com.echothree.model.data.forum.server.value.ForumMessageDetailValue; 045 046import com.echothree.model.data.forum.server.factory.ForumMessageDetailFactory; 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 ForumMessageDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private ForumMessageDetailPK _pk; 069 private ForumMessageDetailValue _value; 070 071 /** Creates a new instance of ForumMessageDetail */ 072 public ForumMessageDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of ForumMessageDetail */ 078 public ForumMessageDetail(ForumMessageDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public ForumMessageDetailFactory getBaseFactoryInstance() { 087 return ForumMessageDetailFactory.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 ForumMessageDetail that) { 111 ForumMessageDetailValue thatValue = that.getForumMessageDetailValue(); 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 ForumMessageDetailValue getForumMessageDetailValue() { 131 return _value; 132 } 133 134 public void setForumMessageDetailValue(ForumMessageDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public ForumMessageDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public ForumMessagePK getForumMessagePK() { 146 return _value.getForumMessagePK(); 147 } 148 149 public ForumMessage getForumMessage(EntityPermission entityPermission) { 150 return ForumMessageFactory.getInstance().getEntityFromPK(entityPermission, getForumMessagePK()); 151 } 152 153 public ForumMessage getForumMessage() { 154 return getForumMessage(EntityPermission.READ_ONLY); 155 } 156 157 public ForumMessage getForumMessageForUpdate() { 158 return getForumMessage(EntityPermission.READ_WRITE); 159 } 160 161 public void setForumMessagePK(ForumMessagePK forumMessagePK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setForumMessagePK(forumMessagePK); 165 } 166 167 public void setForumMessage(ForumMessage entity) { 168 setForumMessagePK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getForumMessagePKHasBeenModified() { 172 return _value.getForumMessagePKHasBeenModified(); 173 } 174 175 public String getForumMessageName() { 176 return _value.getForumMessageName(); 177 } 178 179 public void setForumMessageName(String forumMessageName) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setForumMessageName(forumMessageName); 183 } 184 185 public boolean getForumMessageNameHasBeenModified() { 186 return _value.getForumMessageNameHasBeenModified(); 187 } 188 189 public ForumThreadPK getForumThreadPK() { 190 return _value.getForumThreadPK(); 191 } 192 193 public ForumThread getForumThread(EntityPermission entityPermission) { 194 return ForumThreadFactory.getInstance().getEntityFromPK(entityPermission, getForumThreadPK()); 195 } 196 197 public ForumThread getForumThread() { 198 return getForumThread(EntityPermission.READ_ONLY); 199 } 200 201 public ForumThread getForumThreadForUpdate() { 202 return getForumThread(EntityPermission.READ_WRITE); 203 } 204 205 public void setForumThreadPK(ForumThreadPK forumThreadPK) 206 throws PersistenceNotNullException, PersistenceReadOnlyException { 207 checkReadWrite(); 208 _value.setForumThreadPK(forumThreadPK); 209 } 210 211 public void setForumThread(ForumThread entity) { 212 setForumThreadPK(entity == null? null: entity.getPrimaryKey()); 213 } 214 215 public boolean getForumThreadPKHasBeenModified() { 216 return _value.getForumThreadPKHasBeenModified(); 217 } 218 219 public ForumMessageTypePK getForumMessageTypePK() { 220 return _value.getForumMessageTypePK(); 221 } 222 223 public ForumMessageType getForumMessageType(EntityPermission entityPermission) { 224 return ForumMessageTypeFactory.getInstance().getEntityFromPK(entityPermission, getForumMessageTypePK()); 225 } 226 227 public ForumMessageType getForumMessageType() { 228 return getForumMessageType(EntityPermission.READ_ONLY); 229 } 230 231 public ForumMessageType getForumMessageTypeForUpdate() { 232 return getForumMessageType(EntityPermission.READ_WRITE); 233 } 234 235 public void setForumMessageTypePK(ForumMessageTypePK forumMessageTypePK) 236 throws PersistenceNotNullException, PersistenceReadOnlyException { 237 checkReadWrite(); 238 _value.setForumMessageTypePK(forumMessageTypePK); 239 } 240 241 public void setForumMessageType(ForumMessageType entity) { 242 setForumMessageTypePK(entity == null? null: entity.getPrimaryKey()); 243 } 244 245 public boolean getForumMessageTypePKHasBeenModified() { 246 return _value.getForumMessageTypePKHasBeenModified(); 247 } 248 249 public ForumMessagePK getParentForumMessagePK() { 250 return _value.getParentForumMessagePK(); 251 } 252 253 public ForumMessage getParentForumMessage(EntityPermission entityPermission) { 254 ForumMessagePK pk = getParentForumMessagePK(); 255 ForumMessage entity = pk == null? null: ForumMessageFactory.getInstance().getEntityFromPK(entityPermission, pk); 256 257 return entity; 258 } 259 260 public ForumMessage getParentForumMessage() { 261 return getParentForumMessage(EntityPermission.READ_ONLY); 262 } 263 264 public ForumMessage getParentForumMessageForUpdate() { 265 return getParentForumMessage(EntityPermission.READ_WRITE); 266 } 267 268 public void setParentForumMessagePK(ForumMessagePK parentForumMessagePK) 269 throws PersistenceNotNullException, PersistenceReadOnlyException { 270 checkReadWrite(); 271 _value.setParentForumMessagePK(parentForumMessagePK); 272 } 273 274 public void setParentForumMessage(ForumMessage entity) { 275 setParentForumMessagePK(entity == null? null: entity.getPrimaryKey()); 276 } 277 278 public boolean getParentForumMessagePKHasBeenModified() { 279 return _value.getParentForumMessagePKHasBeenModified(); 280 } 281 282 public IconPK getIconPK() { 283 return _value.getIconPK(); 284 } 285 286 public Icon getIcon(EntityPermission entityPermission) { 287 IconPK pk = getIconPK(); 288 Icon entity = pk == null? null: IconFactory.getInstance().getEntityFromPK(entityPermission, pk); 289 290 return entity; 291 } 292 293 public Icon getIcon() { 294 return getIcon(EntityPermission.READ_ONLY); 295 } 296 297 public Icon getIconForUpdate() { 298 return getIcon(EntityPermission.READ_WRITE); 299 } 300 301 public void setIconPK(IconPK iconPK) 302 throws PersistenceNotNullException, PersistenceReadOnlyException { 303 checkReadWrite(); 304 _value.setIconPK(iconPK); 305 } 306 307 public void setIcon(Icon entity) { 308 setIconPK(entity == null? null: entity.getPrimaryKey()); 309 } 310 311 public boolean getIconPKHasBeenModified() { 312 return _value.getIconPKHasBeenModified(); 313 } 314 315 public Long getPostedTime() { 316 return _value.getPostedTime(); 317 } 318 319 public void setPostedTime(Long postedTime) 320 throws PersistenceNotNullException, PersistenceReadOnlyException { 321 checkReadWrite(); 322 _value.setPostedTime(postedTime); 323 } 324 325 public boolean getPostedTimeHasBeenModified() { 326 return _value.getPostedTimeHasBeenModified(); 327 } 328 329 public Long getFromTime() { 330 return _value.getFromTime(); 331 } 332 333 public void setFromTime(Long fromTime) 334 throws PersistenceNotNullException, PersistenceReadOnlyException { 335 checkReadWrite(); 336 _value.setFromTime(fromTime); 337 } 338 339 public boolean getFromTimeHasBeenModified() { 340 return _value.getFromTimeHasBeenModified(); 341 } 342 343 public Long getThruTime() { 344 return _value.getThruTime(); 345 } 346 347 public void setThruTime(Long thruTime) 348 throws PersistenceNotNullException, PersistenceReadOnlyException { 349 checkReadWrite(); 350 _value.setThruTime(thruTime); 351 } 352 353 public boolean getThruTimeHasBeenModified() { 354 return _value.getThruTimeHasBeenModified(); 355 } 356 357}