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