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 * TrainingClassTranslation.java
021 */
022
023package com.echothree.model.data.training.server.entity;
024
025import com.echothree.model.data.training.common.pk.TrainingClassTranslationPK;
026
027import com.echothree.model.data.training.common.pk.TrainingClassPK;
028import com.echothree.model.data.party.common.pk.LanguagePK;
029import com.echothree.model.data.core.common.pk.MimeTypePK;
030
031import com.echothree.model.data.training.server.entity.TrainingClass;
032import com.echothree.model.data.party.server.entity.Language;
033import com.echothree.model.data.core.server.entity.MimeType;
034
035import com.echothree.model.data.training.server.factory.TrainingClassFactory;
036import com.echothree.model.data.party.server.factory.LanguageFactory;
037import com.echothree.model.data.core.server.factory.MimeTypeFactory;
038
039import com.echothree.model.data.training.common.pk.TrainingClassTranslationPK;
040
041import com.echothree.model.data.training.server.value.TrainingClassTranslationValue;
042
043import com.echothree.model.data.training.server.factory.TrainingClassTranslationFactory;
044
045import com.echothree.util.common.exception.PersistenceException;
046import com.echothree.util.common.exception.PersistenceDatabaseException;
047import com.echothree.util.common.exception.PersistenceNotNullException;
048import com.echothree.util.common.exception.PersistenceReadOnlyException;
049
050import com.echothree.util.common.persistence.BasePK;
051
052import com.echothree.util.common.persistence.type.ByteArray;
053
054import com.echothree.util.server.persistence.BaseEntity;
055import com.echothree.util.server.persistence.EntityPermission;
056import com.echothree.util.server.persistence.Session;
057import com.echothree.util.server.persistence.ThreadSession;
058
059import java.io.Serializable;
060
061public class TrainingClassTranslation
062        extends BaseEntity
063        implements Serializable {
064    
065    private TrainingClassTranslationPK _pk;
066    private TrainingClassTranslationValue _value;
067    
068    /** Creates a new instance of TrainingClassTranslation */
069    public TrainingClassTranslation()
070            throws PersistenceException {
071        super();
072    }
073    
074    /** Creates a new instance of TrainingClassTranslation */
075    public TrainingClassTranslation(TrainingClassTranslationValue value, EntityPermission entityPermission) {
076        super(entityPermission);
077        
078        _value = value;
079        _pk = value.getPrimaryKey();
080    }
081    
082    @Override
083    public TrainingClassTranslationFactory getBaseFactoryInstance() {
084        return TrainingClassTranslationFactory.getInstance();
085    }
086    
087    @Override
088    public boolean hasBeenModified() {
089        return _value.hasBeenModified();
090    }
091    
092    @Override
093    public int hashCode() {
094        return _pk.hashCode();
095    }
096    
097    @Override
098    public String toString() {
099        return _pk.toString();
100    }
101    
102    @Override
103    public boolean equals(Object other) {
104        if(this == other)
105            return true;
106        
107        if(other instanceof TrainingClassTranslation that) {
108            TrainingClassTranslationValue thatValue = that.getTrainingClassTranslationValue();
109            return _value.equals(thatValue);
110        } else {
111            return false;
112        }
113    }
114    
115    @Override
116    public void store(Session session)
117            throws PersistenceDatabaseException {
118        getBaseFactoryInstance().store(session, this);
119    }
120    
121    @Override
122    public void remove(Session session)
123            throws PersistenceDatabaseException {
124        getBaseFactoryInstance().remove(session, this);
125    }
126    
127    @Override
128    public void remove()
129            throws PersistenceDatabaseException {
130        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
131    }
132    
133    public TrainingClassTranslationValue getTrainingClassTranslationValue() {
134        return _value;
135    }
136    
137    public void setTrainingClassTranslationValue(TrainingClassTranslationValue value)
138            throws PersistenceReadOnlyException {
139        checkReadWrite();
140        _value = value;
141    }
142    
143    @Override
144    public TrainingClassTranslationPK getPrimaryKey() {
145        return _pk;
146    }
147    
148    public TrainingClassPK getTrainingClassPK() {
149        return _value.getTrainingClassPK();
150    }
151    
152    public TrainingClass getTrainingClass(Session session, EntityPermission entityPermission) {
153        return TrainingClassFactory.getInstance().getEntityFromPK(session, entityPermission, getTrainingClassPK());
154    }
155    
156    public TrainingClass getTrainingClass(EntityPermission entityPermission) {
157        return getTrainingClass(ThreadSession.currentSession(), entityPermission);
158    }
159    
160    public TrainingClass getTrainingClass(Session session) {
161        return getTrainingClass(session, EntityPermission.READ_ONLY);
162    }
163    
164    public TrainingClass getTrainingClass() {
165        return getTrainingClass(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
166    }
167    
168    public TrainingClass getTrainingClassForUpdate(Session session) {
169        return getTrainingClass(session, EntityPermission.READ_WRITE);
170    }
171    
172    public TrainingClass getTrainingClassForUpdate() {
173        return getTrainingClass(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
174    }
175    
176    public void setTrainingClassPK(TrainingClassPK trainingClassPK)
177            throws PersistenceNotNullException, PersistenceReadOnlyException {
178        checkReadWrite();
179        _value.setTrainingClassPK(trainingClassPK);
180    }
181    
182    public void setTrainingClass(TrainingClass entity) {
183        setTrainingClassPK(entity == null? null: entity.getPrimaryKey());
184    }
185    
186    public boolean getTrainingClassPKHasBeenModified() {
187        return _value.getTrainingClassPKHasBeenModified();
188    }
189    
190    public LanguagePK getLanguagePK() {
191        return _value.getLanguagePK();
192    }
193    
194    public Language getLanguage(Session session, EntityPermission entityPermission) {
195        return LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, getLanguagePK());
196    }
197    
198    public Language getLanguage(EntityPermission entityPermission) {
199        return getLanguage(ThreadSession.currentSession(), entityPermission);
200    }
201    
202    public Language getLanguage(Session session) {
203        return getLanguage(session, EntityPermission.READ_ONLY);
204    }
205    
206    public Language getLanguage() {
207        return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
208    }
209    
210    public Language getLanguageForUpdate(Session session) {
211        return getLanguage(session, EntityPermission.READ_WRITE);
212    }
213    
214    public Language getLanguageForUpdate() {
215        return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
216    }
217    
218    public void setLanguagePK(LanguagePK languagePK)
219            throws PersistenceNotNullException, PersistenceReadOnlyException {
220        checkReadWrite();
221        _value.setLanguagePK(languagePK);
222    }
223    
224    public void setLanguage(Language entity) {
225        setLanguagePK(entity == null? null: entity.getPrimaryKey());
226    }
227    
228    public boolean getLanguagePKHasBeenModified() {
229        return _value.getLanguagePKHasBeenModified();
230    }
231    
232    public String getDescription() {
233        return _value.getDescription();
234    }
235    
236    public void setDescription(String description)
237            throws PersistenceNotNullException, PersistenceReadOnlyException {
238        checkReadWrite();
239        _value.setDescription(description);
240    }
241    
242    public boolean getDescriptionHasBeenModified() {
243        return _value.getDescriptionHasBeenModified();
244    }
245    
246    public MimeTypePK getOverviewMimeTypePK() {
247        return _value.getOverviewMimeTypePK();
248    }
249    
250    public MimeType getOverviewMimeType(Session session, EntityPermission entityPermission) {
251        MimeTypePK pk = getOverviewMimeTypePK();
252        MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
253        
254        return entity;
255    }
256    
257    public MimeType getOverviewMimeType(EntityPermission entityPermission) {
258        return getOverviewMimeType(ThreadSession.currentSession(), entityPermission);
259    }
260    
261    public MimeType getOverviewMimeType(Session session) {
262        return getOverviewMimeType(session, EntityPermission.READ_ONLY);
263    }
264    
265    public MimeType getOverviewMimeType() {
266        return getOverviewMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
267    }
268    
269    public MimeType getOverviewMimeTypeForUpdate(Session session) {
270        return getOverviewMimeType(session, EntityPermission.READ_WRITE);
271    }
272    
273    public MimeType getOverviewMimeTypeForUpdate() {
274        return getOverviewMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
275    }
276    
277    public void setOverviewMimeTypePK(MimeTypePK overviewMimeTypePK)
278            throws PersistenceNotNullException, PersistenceReadOnlyException {
279        checkReadWrite();
280        _value.setOverviewMimeTypePK(overviewMimeTypePK);
281    }
282    
283    public void setOverviewMimeType(MimeType entity) {
284        setOverviewMimeTypePK(entity == null? null: entity.getPrimaryKey());
285    }
286    
287    public boolean getOverviewMimeTypePKHasBeenModified() {
288        return _value.getOverviewMimeTypePKHasBeenModified();
289    }
290    
291    public String getOverview() {
292        return _value.getOverview();
293    }
294    
295    public void setOverview(String overview)
296            throws PersistenceNotNullException, PersistenceReadOnlyException {
297        checkReadWrite();
298        _value.setOverview(overview);
299    }
300    
301    public boolean getOverviewHasBeenModified() {
302        return _value.getOverviewHasBeenModified();
303    }
304    
305    public MimeTypePK getIntroductionMimeTypePK() {
306        return _value.getIntroductionMimeTypePK();
307    }
308    
309    public MimeType getIntroductionMimeType(Session session, EntityPermission entityPermission) {
310        MimeTypePK pk = getIntroductionMimeTypePK();
311        MimeType entity = pk == null? null: MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
312        
313        return entity;
314    }
315    
316    public MimeType getIntroductionMimeType(EntityPermission entityPermission) {
317        return getIntroductionMimeType(ThreadSession.currentSession(), entityPermission);
318    }
319    
320    public MimeType getIntroductionMimeType(Session session) {
321        return getIntroductionMimeType(session, EntityPermission.READ_ONLY);
322    }
323    
324    public MimeType getIntroductionMimeType() {
325        return getIntroductionMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
326    }
327    
328    public MimeType getIntroductionMimeTypeForUpdate(Session session) {
329        return getIntroductionMimeType(session, EntityPermission.READ_WRITE);
330    }
331    
332    public MimeType getIntroductionMimeTypeForUpdate() {
333        return getIntroductionMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
334    }
335    
336    public void setIntroductionMimeTypePK(MimeTypePK introductionMimeTypePK)
337            throws PersistenceNotNullException, PersistenceReadOnlyException {
338        checkReadWrite();
339        _value.setIntroductionMimeTypePK(introductionMimeTypePK);
340    }
341    
342    public void setIntroductionMimeType(MimeType entity) {
343        setIntroductionMimeTypePK(entity == null? null: entity.getPrimaryKey());
344    }
345    
346    public boolean getIntroductionMimeTypePKHasBeenModified() {
347        return _value.getIntroductionMimeTypePKHasBeenModified();
348    }
349    
350    public String getIntroduction() {
351        return _value.getIntroduction();
352    }
353    
354    public void setIntroduction(String introduction)
355            throws PersistenceNotNullException, PersistenceReadOnlyException {
356        checkReadWrite();
357        _value.setIntroduction(introduction);
358    }
359    
360    public boolean getIntroductionHasBeenModified() {
361        return _value.getIntroductionHasBeenModified();
362    }
363    
364    public Long getFromTime() {
365        return _value.getFromTime();
366    }
367    
368    public void setFromTime(Long fromTime)
369            throws PersistenceNotNullException, PersistenceReadOnlyException {
370        checkReadWrite();
371        _value.setFromTime(fromTime);
372    }
373    
374    public boolean getFromTimeHasBeenModified() {
375        return _value.getFromTimeHasBeenModified();
376    }
377    
378    public Long getThruTime() {
379        return _value.getThruTime();
380    }
381    
382    public void setThruTime(Long thruTime)
383            throws PersistenceNotNullException, PersistenceReadOnlyException {
384        checkReadWrite();
385        _value.setThruTime(thruTime);
386    }
387    
388    public boolean getThruTimeHasBeenModified() {
389        return _value.getThruTimeHasBeenModified();
390    }
391    
392}