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 * ForumMessagePartDetail.java 021 */ 022 023package com.echothree.model.data.forum.server.entity; 024 025import com.echothree.model.data.forum.common.pk.ForumMessagePartDetailPK; 026 027import com.echothree.model.data.forum.common.pk.ForumMessagePartPK; 028import com.echothree.model.data.forum.common.pk.ForumMessagePK; 029import com.echothree.model.data.forum.common.pk.ForumMessagePartTypePK; 030import com.echothree.model.data.party.common.pk.LanguagePK; 031import com.echothree.model.data.core.common.pk.MimeTypePK; 032 033import com.echothree.model.data.forum.server.entity.ForumMessagePart; 034import com.echothree.model.data.forum.server.entity.ForumMessage; 035import com.echothree.model.data.forum.server.entity.ForumMessagePartType; 036import com.echothree.model.data.party.server.entity.Language; 037import com.echothree.model.data.core.server.entity.MimeType; 038 039import com.echothree.model.data.forum.server.factory.ForumMessagePartFactory; 040import com.echothree.model.data.forum.server.factory.ForumMessageFactory; 041import com.echothree.model.data.forum.server.factory.ForumMessagePartTypeFactory; 042import com.echothree.model.data.party.server.factory.LanguageFactory; 043import com.echothree.model.data.core.server.factory.MimeTypeFactory; 044 045import com.echothree.model.data.forum.common.pk.ForumMessagePartDetailPK; 046 047import com.echothree.model.data.forum.server.value.ForumMessagePartDetailValue; 048 049import com.echothree.model.data.forum.server.factory.ForumMessagePartDetailFactory; 050 051import com.echothree.util.common.exception.PersistenceException; 052import com.echothree.util.common.exception.PersistenceDatabaseException; 053import com.echothree.util.common.exception.PersistenceNotNullException; 054import com.echothree.util.common.exception.PersistenceReadOnlyException; 055 056import com.echothree.util.common.persistence.BasePK; 057 058import com.echothree.util.common.persistence.type.ByteArray; 059 060import com.echothree.util.server.persistence.BaseEntity; 061import com.echothree.util.server.persistence.EntityPermission; 062import com.echothree.util.server.persistence.Session; 063import com.echothree.util.server.persistence.ThreadSession; 064 065import java.io.Serializable; 066 067import javax.annotation.Nonnull; 068import javax.annotation.Nullable; 069 070public class ForumMessagePartDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private ForumMessagePartDetailPK _pk; 075 private ForumMessagePartDetailValue _value; 076 077 /** Creates a new instance of ForumMessagePartDetail */ 078 public ForumMessagePartDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of ForumMessagePartDetail */ 084 public ForumMessagePartDetail(ForumMessagePartDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 @Nonnull 093 public ForumMessagePartDetailFactory getBaseFactoryInstance() { 094 return ForumMessagePartDetailFactory.getInstance(); 095 } 096 097 @Override 098 public boolean hasBeenModified() { 099 return _value.hasBeenModified(); 100 } 101 102 @Override 103 public int hashCode() { 104 return _pk.hashCode(); 105 } 106 107 @Override 108 @Nonnull 109 public String toString() { 110 return _pk.toString(); 111 } 112 113 @Override 114 public boolean equals(Object other) { 115 if(this == other) 116 return true; 117 118 if(other instanceof ForumMessagePartDetail that) { 119 ForumMessagePartDetailValue thatValue = that.getForumMessagePartDetailValue(); 120 return _value.equals(thatValue); 121 } else { 122 return false; 123 } 124 } 125 126 @Override 127 public void store() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().store(this); 130 } 131 132 @Override 133 public void remove() 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(this); 136 } 137 138 @Nonnull 139 public ForumMessagePartDetailValue getForumMessagePartDetailValue() { 140 return _value; 141 } 142 143 public void setForumMessagePartDetailValue(@Nonnull ForumMessagePartDetailValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 @Nonnull 151 public ForumMessagePartDetailPK getPrimaryKey() { 152 return _pk; 153 } 154 155 @Nonnull 156 public ForumMessagePartPK getForumMessagePartPK() { 157 return _value.getForumMessagePartPK(); 158 } 159 160 @Nonnull 161 public ForumMessagePart getForumMessagePart(EntityPermission entityPermission) { 162 return ForumMessagePartFactory.getInstance().getEntityFromPK(entityPermission, getForumMessagePartPK()); 163 } 164 165 @Nonnull 166 public ForumMessagePart getForumMessagePart() { 167 return getForumMessagePart(EntityPermission.READ_ONLY); 168 } 169 170 @Nonnull 171 public ForumMessagePart getForumMessagePartForUpdate() { 172 return getForumMessagePart(EntityPermission.READ_WRITE); 173 } 174 175 public void setForumMessagePartPK(@Nonnull ForumMessagePartPK forumMessagePartPK) 176 throws PersistenceNotNullException, PersistenceReadOnlyException { 177 checkReadWrite(); 178 _value.setForumMessagePartPK(forumMessagePartPK); 179 } 180 181 public void setForumMessagePart(@Nonnull ForumMessagePart entity) { 182 setForumMessagePartPK(entity == null ? null : entity.getPrimaryKey()); 183 } 184 185 public boolean getForumMessagePartPKHasBeenModified() { 186 return _value.getForumMessagePartPKHasBeenModified(); 187 } 188 189 @Nonnull 190 public ForumMessagePK getForumMessagePK() { 191 return _value.getForumMessagePK(); 192 } 193 194 @Nonnull 195 public ForumMessage getForumMessage(EntityPermission entityPermission) { 196 return ForumMessageFactory.getInstance().getEntityFromPK(entityPermission, getForumMessagePK()); 197 } 198 199 @Nonnull 200 public ForumMessage getForumMessage() { 201 return getForumMessage(EntityPermission.READ_ONLY); 202 } 203 204 @Nonnull 205 public ForumMessage getForumMessageForUpdate() { 206 return getForumMessage(EntityPermission.READ_WRITE); 207 } 208 209 public void setForumMessagePK(@Nonnull ForumMessagePK forumMessagePK) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setForumMessagePK(forumMessagePK); 213 } 214 215 public void setForumMessage(@Nonnull ForumMessage entity) { 216 setForumMessagePK(entity == null ? null : entity.getPrimaryKey()); 217 } 218 219 public boolean getForumMessagePKHasBeenModified() { 220 return _value.getForumMessagePKHasBeenModified(); 221 } 222 223 @Nonnull 224 public ForumMessagePartTypePK getForumMessagePartTypePK() { 225 return _value.getForumMessagePartTypePK(); 226 } 227 228 @Nonnull 229 public ForumMessagePartType getForumMessagePartType(EntityPermission entityPermission) { 230 return ForumMessagePartTypeFactory.getInstance().getEntityFromPK(entityPermission, getForumMessagePartTypePK()); 231 } 232 233 @Nonnull 234 public ForumMessagePartType getForumMessagePartType() { 235 return getForumMessagePartType(EntityPermission.READ_ONLY); 236 } 237 238 @Nonnull 239 public ForumMessagePartType getForumMessagePartTypeForUpdate() { 240 return getForumMessagePartType(EntityPermission.READ_WRITE); 241 } 242 243 public void setForumMessagePartTypePK(@Nonnull ForumMessagePartTypePK forumMessagePartTypePK) 244 throws PersistenceNotNullException, PersistenceReadOnlyException { 245 checkReadWrite(); 246 _value.setForumMessagePartTypePK(forumMessagePartTypePK); 247 } 248 249 public void setForumMessagePartType(@Nonnull ForumMessagePartType entity) { 250 setForumMessagePartTypePK(entity == null ? null : entity.getPrimaryKey()); 251 } 252 253 public boolean getForumMessagePartTypePKHasBeenModified() { 254 return _value.getForumMessagePartTypePKHasBeenModified(); 255 } 256 257 @Nonnull 258 public LanguagePK getLanguagePK() { 259 return _value.getLanguagePK(); 260 } 261 262 @Nonnull 263 public Language getLanguage(EntityPermission entityPermission) { 264 return LanguageFactory.getInstance().getEntityFromPK(entityPermission, getLanguagePK()); 265 } 266 267 @Nonnull 268 public Language getLanguage() { 269 return getLanguage(EntityPermission.READ_ONLY); 270 } 271 272 @Nonnull 273 public Language getLanguageForUpdate() { 274 return getLanguage(EntityPermission.READ_WRITE); 275 } 276 277 public void setLanguagePK(@Nonnull LanguagePK languagePK) 278 throws PersistenceNotNullException, PersistenceReadOnlyException { 279 checkReadWrite(); 280 _value.setLanguagePK(languagePK); 281 } 282 283 public void setLanguage(@Nonnull Language entity) { 284 setLanguagePK(entity == null ? null : entity.getPrimaryKey()); 285 } 286 287 public boolean getLanguagePKHasBeenModified() { 288 return _value.getLanguagePKHasBeenModified(); 289 } 290 291 @Nullable 292 public MimeTypePK getMimeTypePK() { 293 return _value.getMimeTypePK(); 294 } 295 296 @Nullable 297 public MimeType getMimeType(EntityPermission entityPermission) { 298 MimeTypePK pk = getMimeTypePK(); 299 MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(entityPermission, pk); 300 301 return entity; 302 } 303 304 @Nullable 305 public MimeType getMimeType() { 306 return getMimeType(EntityPermission.READ_ONLY); 307 } 308 309 @Nullable 310 public MimeType getMimeTypeForUpdate() { 311 return getMimeType(EntityPermission.READ_WRITE); 312 } 313 314 public void setMimeTypePK(@Nullable MimeTypePK mimeTypePK) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setMimeTypePK(mimeTypePK); 318 } 319 320 public void setMimeType(@Nullable MimeType entity) { 321 setMimeTypePK(entity == null ? null : entity.getPrimaryKey()); 322 } 323 324 public boolean getMimeTypePKHasBeenModified() { 325 return _value.getMimeTypePKHasBeenModified(); 326 } 327 328 @Nonnull 329 public Long getFromTime() { 330 return _value.getFromTime(); 331 } 332 333 public void setFromTime(@Nonnull 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 @Nonnull 344 public Long getThruTime() { 345 return _value.getThruTime(); 346 } 347 348 public void setThruTime(@Nonnull Long thruTime) 349 throws PersistenceNotNullException, PersistenceReadOnlyException { 350 checkReadWrite(); 351 _value.setThruTime(thruTime); 352 } 353 354 public boolean getThruTimeHasBeenModified() { 355 return _value.getThruTimeHasBeenModified(); 356 } 357 358}