001// --------------------------------------------------------------------------------
002// Copyright 2002-2025 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(Session session)
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().store(session, this);
125    }
126    
127    @Override
128    public void remove(Session session)
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(session, this);
131    }
132    
133    @Override
134    public void remove()
135            throws PersistenceDatabaseException {
136        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
137    }
138    
139    public ForumMessagePartDetailValue getForumMessagePartDetailValue() {
140        return _value;
141    }
142    
143    public void setForumMessagePartDetailValue(ForumMessagePartDetailValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    public ForumMessagePartDetailPK getPrimaryKey() {
151        return _pk;
152    }
153    
154    public ForumMessagePartPK getForumMessagePartPK() {
155        return _value.getForumMessagePartPK();
156    }
157    
158    public ForumMessagePart getForumMessagePart(Session session, EntityPermission entityPermission) {
159        return ForumMessagePartFactory.getInstance().getEntityFromPK(session, entityPermission, getForumMessagePartPK());
160    }
161    
162    public ForumMessagePart getForumMessagePart(EntityPermission entityPermission) {
163        return getForumMessagePart(ThreadSession.currentSession(), entityPermission);
164    }
165    
166    public ForumMessagePart getForumMessagePart(Session session) {
167        return getForumMessagePart(session, EntityPermission.READ_ONLY);
168    }
169    
170    public ForumMessagePart getForumMessagePart() {
171        return getForumMessagePart(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
172    }
173    
174    public ForumMessagePart getForumMessagePartForUpdate(Session session) {
175        return getForumMessagePart(session, EntityPermission.READ_WRITE);
176    }
177    
178    public ForumMessagePart getForumMessagePartForUpdate() {
179        return getForumMessagePart(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
180    }
181    
182    public void setForumMessagePartPK(ForumMessagePartPK forumMessagePartPK)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setForumMessagePartPK(forumMessagePartPK);
186    }
187    
188    public void setForumMessagePart(ForumMessagePart entity) {
189        setForumMessagePartPK(entity == null? null: entity.getPrimaryKey());
190    }
191    
192    public boolean getForumMessagePartPKHasBeenModified() {
193        return _value.getForumMessagePartPKHasBeenModified();
194    }
195    
196    public ForumMessagePK getForumMessagePK() {
197        return _value.getForumMessagePK();
198    }
199    
200    public ForumMessage getForumMessage(Session session, EntityPermission entityPermission) {
201        return ForumMessageFactory.getInstance().getEntityFromPK(session, entityPermission, getForumMessagePK());
202    }
203    
204    public ForumMessage getForumMessage(EntityPermission entityPermission) {
205        return getForumMessage(ThreadSession.currentSession(), entityPermission);
206    }
207    
208    public ForumMessage getForumMessage(Session session) {
209        return getForumMessage(session, EntityPermission.READ_ONLY);
210    }
211    
212    public ForumMessage getForumMessage() {
213        return getForumMessage(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
214    }
215    
216    public ForumMessage getForumMessageForUpdate(Session session) {
217        return getForumMessage(session, EntityPermission.READ_WRITE);
218    }
219    
220    public ForumMessage getForumMessageForUpdate() {
221        return getForumMessage(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
222    }
223    
224    public void setForumMessagePK(ForumMessagePK forumMessagePK)
225            throws PersistenceNotNullException, PersistenceReadOnlyException {
226        checkReadWrite();
227        _value.setForumMessagePK(forumMessagePK);
228    }
229    
230    public void setForumMessage(ForumMessage entity) {
231        setForumMessagePK(entity == null? null: entity.getPrimaryKey());
232    }
233    
234    public boolean getForumMessagePKHasBeenModified() {
235        return _value.getForumMessagePKHasBeenModified();
236    }
237    
238    public ForumMessagePartTypePK getForumMessagePartTypePK() {
239        return _value.getForumMessagePartTypePK();
240    }
241    
242    public ForumMessagePartType getForumMessagePartType(Session session, EntityPermission entityPermission) {
243        return ForumMessagePartTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getForumMessagePartTypePK());
244    }
245    
246    public ForumMessagePartType getForumMessagePartType(EntityPermission entityPermission) {
247        return getForumMessagePartType(ThreadSession.currentSession(), entityPermission);
248    }
249    
250    public ForumMessagePartType getForumMessagePartType(Session session) {
251        return getForumMessagePartType(session, EntityPermission.READ_ONLY);
252    }
253    
254    public ForumMessagePartType getForumMessagePartType() {
255        return getForumMessagePartType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
256    }
257    
258    public ForumMessagePartType getForumMessagePartTypeForUpdate(Session session) {
259        return getForumMessagePartType(session, EntityPermission.READ_WRITE);
260    }
261    
262    public ForumMessagePartType getForumMessagePartTypeForUpdate() {
263        return getForumMessagePartType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
264    }
265    
266    public void setForumMessagePartTypePK(ForumMessagePartTypePK forumMessagePartTypePK)
267            throws PersistenceNotNullException, PersistenceReadOnlyException {
268        checkReadWrite();
269        _value.setForumMessagePartTypePK(forumMessagePartTypePK);
270    }
271    
272    public void setForumMessagePartType(ForumMessagePartType entity) {
273        setForumMessagePartTypePK(entity == null? null: entity.getPrimaryKey());
274    }
275    
276    public boolean getForumMessagePartTypePKHasBeenModified() {
277        return _value.getForumMessagePartTypePKHasBeenModified();
278    }
279    
280    public LanguagePK getLanguagePK() {
281        return _value.getLanguagePK();
282    }
283    
284    public Language getLanguage(Session session, EntityPermission entityPermission) {
285        return LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, getLanguagePK());
286    }
287    
288    public Language getLanguage(EntityPermission entityPermission) {
289        return getLanguage(ThreadSession.currentSession(), entityPermission);
290    }
291    
292    public Language getLanguage(Session session) {
293        return getLanguage(session, EntityPermission.READ_ONLY);
294    }
295    
296    public Language getLanguage() {
297        return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
298    }
299    
300    public Language getLanguageForUpdate(Session session) {
301        return getLanguage(session, EntityPermission.READ_WRITE);
302    }
303    
304    public Language getLanguageForUpdate() {
305        return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
306    }
307    
308    public void setLanguagePK(LanguagePK languagePK)
309            throws PersistenceNotNullException, PersistenceReadOnlyException {
310        checkReadWrite();
311        _value.setLanguagePK(languagePK);
312    }
313    
314    public void setLanguage(Language entity) {
315        setLanguagePK(entity == null? null: entity.getPrimaryKey());
316    }
317    
318    public boolean getLanguagePKHasBeenModified() {
319        return _value.getLanguagePKHasBeenModified();
320    }
321    
322    public MimeTypePK getMimeTypePK() {
323        return _value.getMimeTypePK();
324    }
325    
326    public MimeType getMimeType(Session session, EntityPermission entityPermission) {
327        MimeTypePK pk = getMimeTypePK();
328        MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
329        
330        return entity;
331    }
332    
333    public MimeType getMimeType(EntityPermission entityPermission) {
334        return getMimeType(ThreadSession.currentSession(), entityPermission);
335    }
336    
337    public MimeType getMimeType(Session session) {
338        return getMimeType(session, EntityPermission.READ_ONLY);
339    }
340    
341    public MimeType getMimeType() {
342        return getMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
343    }
344    
345    public MimeType getMimeTypeForUpdate(Session session) {
346        return getMimeType(session, EntityPermission.READ_WRITE);
347    }
348    
349    public MimeType getMimeTypeForUpdate() {
350        return getMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
351    }
352    
353    public void setMimeTypePK(MimeTypePK mimeTypePK)
354            throws PersistenceNotNullException, PersistenceReadOnlyException {
355        checkReadWrite();
356        _value.setMimeTypePK(mimeTypePK);
357    }
358    
359    public void setMimeType(MimeType entity) {
360        setMimeTypePK(entity == null? null: entity.getPrimaryKey());
361    }
362    
363    public boolean getMimeTypePKHasBeenModified() {
364        return _value.getMimeTypePKHasBeenModified();
365    }
366    
367    public Long getFromTime() {
368        return _value.getFromTime();
369    }
370    
371    public void setFromTime(Long fromTime)
372            throws PersistenceNotNullException, PersistenceReadOnlyException {
373        checkReadWrite();
374        _value.setFromTime(fromTime);
375    }
376    
377    public boolean getFromTimeHasBeenModified() {
378        return _value.getFromTimeHasBeenModified();
379    }
380    
381    public Long getThruTime() {
382        return _value.getThruTime();
383    }
384    
385    public void setThruTime(Long thruTime)
386            throws PersistenceNotNullException, PersistenceReadOnlyException {
387        checkReadWrite();
388        _value.setThruTime(thruTime);
389    }
390    
391    public boolean getThruTimeHasBeenModified() {
392        return _value.getThruTimeHasBeenModified();
393    }
394    
395}