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