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 * TrainingClassDetail.java
021 */
022
023package com.echothree.model.data.training.server.entity;
024
025import com.echothree.model.data.training.common.pk.TrainingClassDetailPK;
026
027import com.echothree.model.data.training.common.pk.TrainingClassPK;
028import com.echothree.model.data.workeffort.common.pk.WorkEffortScopePK;
029
030import com.echothree.model.data.training.server.entity.TrainingClass;
031import com.echothree.model.data.workeffort.server.entity.WorkEffortScope;
032
033import com.echothree.model.data.training.server.factory.TrainingClassFactory;
034import com.echothree.model.data.workeffort.server.factory.WorkEffortScopeFactory;
035
036import com.echothree.model.data.training.common.pk.TrainingClassDetailPK;
037
038import com.echothree.model.data.training.server.value.TrainingClassDetailValue;
039
040import com.echothree.model.data.training.server.factory.TrainingClassDetailFactory;
041
042import com.echothree.util.common.exception.PersistenceException;
043import com.echothree.util.common.exception.PersistenceDatabaseException;
044import com.echothree.util.common.exception.PersistenceNotNullException;
045import com.echothree.util.common.exception.PersistenceReadOnlyException;
046
047import com.echothree.util.common.persistence.BasePK;
048
049import com.echothree.util.common.persistence.type.ByteArray;
050
051import com.echothree.util.server.persistence.BaseEntity;
052import com.echothree.util.server.persistence.EntityPermission;
053import com.echothree.util.server.persistence.Session;
054import com.echothree.util.server.persistence.ThreadSession;
055
056import java.io.Serializable;
057
058public class TrainingClassDetail
059        extends BaseEntity
060        implements Serializable {
061    
062    private TrainingClassDetailPK _pk;
063    private TrainingClassDetailValue _value;
064    
065    /** Creates a new instance of TrainingClassDetail */
066    public TrainingClassDetail()
067            throws PersistenceException {
068        super();
069    }
070    
071    /** Creates a new instance of TrainingClassDetail */
072    public TrainingClassDetail(TrainingClassDetailValue value, EntityPermission entityPermission) {
073        super(entityPermission);
074        
075        _value = value;
076        _pk = value.getPrimaryKey();
077    }
078    
079    @Override
080    public TrainingClassDetailFactory getBaseFactoryInstance() {
081        return TrainingClassDetailFactory.getInstance();
082    }
083    
084    @Override
085    public boolean hasBeenModified() {
086        return _value.hasBeenModified();
087    }
088    
089    @Override
090    public int hashCode() {
091        return _pk.hashCode();
092    }
093    
094    @Override
095    public String toString() {
096        return _pk.toString();
097    }
098    
099    @Override
100    public boolean equals(Object other) {
101        if(this == other)
102            return true;
103        
104        if(other instanceof TrainingClassDetail that) {
105            TrainingClassDetailValue thatValue = that.getTrainingClassDetailValue();
106            return _value.equals(thatValue);
107        } else {
108            return false;
109        }
110    }
111    
112    @Override
113    public void store(Session session)
114            throws PersistenceDatabaseException {
115        getBaseFactoryInstance().store(session, this);
116    }
117    
118    @Override
119    public void remove(Session session)
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().remove(session, this);
122    }
123    
124    @Override
125    public void remove()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
128    }
129    
130    public TrainingClassDetailValue getTrainingClassDetailValue() {
131        return _value;
132    }
133    
134    public void setTrainingClassDetailValue(TrainingClassDetailValue value)
135            throws PersistenceReadOnlyException {
136        checkReadWrite();
137        _value = value;
138    }
139    
140    @Override
141    public TrainingClassDetailPK getPrimaryKey() {
142        return _pk;
143    }
144    
145    public TrainingClassPK getTrainingClassPK() {
146        return _value.getTrainingClassPK();
147    }
148    
149    public TrainingClass getTrainingClass(Session session, EntityPermission entityPermission) {
150        return TrainingClassFactory.getInstance().getEntityFromPK(session, entityPermission, getTrainingClassPK());
151    }
152    
153    public TrainingClass getTrainingClass(EntityPermission entityPermission) {
154        return getTrainingClass(ThreadSession.currentSession(), entityPermission);
155    }
156    
157    public TrainingClass getTrainingClass(Session session) {
158        return getTrainingClass(session, EntityPermission.READ_ONLY);
159    }
160    
161    public TrainingClass getTrainingClass() {
162        return getTrainingClass(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
163    }
164    
165    public TrainingClass getTrainingClassForUpdate(Session session) {
166        return getTrainingClass(session, EntityPermission.READ_WRITE);
167    }
168    
169    public TrainingClass getTrainingClassForUpdate() {
170        return getTrainingClass(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
171    }
172    
173    public void setTrainingClassPK(TrainingClassPK trainingClassPK)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setTrainingClassPK(trainingClassPK);
177    }
178    
179    public void setTrainingClass(TrainingClass entity) {
180        setTrainingClassPK(entity == null? null: entity.getPrimaryKey());
181    }
182    
183    public boolean getTrainingClassPKHasBeenModified() {
184        return _value.getTrainingClassPKHasBeenModified();
185    }
186    
187    public String getTrainingClassName() {
188        return _value.getTrainingClassName();
189    }
190    
191    public void setTrainingClassName(String trainingClassName)
192            throws PersistenceNotNullException, PersistenceReadOnlyException {
193        checkReadWrite();
194        _value.setTrainingClassName(trainingClassName);
195    }
196    
197    public boolean getTrainingClassNameHasBeenModified() {
198        return _value.getTrainingClassNameHasBeenModified();
199    }
200    
201    public Long getEstimatedReadingTime() {
202        return _value.getEstimatedReadingTime();
203    }
204    
205    public void setEstimatedReadingTime(Long estimatedReadingTime)
206            throws PersistenceNotNullException, PersistenceReadOnlyException {
207        checkReadWrite();
208        _value.setEstimatedReadingTime(estimatedReadingTime);
209    }
210    
211    public boolean getEstimatedReadingTimeHasBeenModified() {
212        return _value.getEstimatedReadingTimeHasBeenModified();
213    }
214    
215    public Long getReadingTimeAllowed() {
216        return _value.getReadingTimeAllowed();
217    }
218    
219    public void setReadingTimeAllowed(Long readingTimeAllowed)
220            throws PersistenceNotNullException, PersistenceReadOnlyException {
221        checkReadWrite();
222        _value.setReadingTimeAllowed(readingTimeAllowed);
223    }
224    
225    public boolean getReadingTimeAllowedHasBeenModified() {
226        return _value.getReadingTimeAllowedHasBeenModified();
227    }
228    
229    public Long getEstimatedTestingTime() {
230        return _value.getEstimatedTestingTime();
231    }
232    
233    public void setEstimatedTestingTime(Long estimatedTestingTime)
234            throws PersistenceNotNullException, PersistenceReadOnlyException {
235        checkReadWrite();
236        _value.setEstimatedTestingTime(estimatedTestingTime);
237    }
238    
239    public boolean getEstimatedTestingTimeHasBeenModified() {
240        return _value.getEstimatedTestingTimeHasBeenModified();
241    }
242    
243    public Long getTestingTimeAllowed() {
244        return _value.getTestingTimeAllowed();
245    }
246    
247    public void setTestingTimeAllowed(Long testingTimeAllowed)
248            throws PersistenceNotNullException, PersistenceReadOnlyException {
249        checkReadWrite();
250        _value.setTestingTimeAllowed(testingTimeAllowed);
251    }
252    
253    public boolean getTestingTimeAllowedHasBeenModified() {
254        return _value.getTestingTimeAllowedHasBeenModified();
255    }
256    
257    public Long getRequiredCompletionTime() {
258        return _value.getRequiredCompletionTime();
259    }
260    
261    public void setRequiredCompletionTime(Long requiredCompletionTime)
262            throws PersistenceNotNullException, PersistenceReadOnlyException {
263        checkReadWrite();
264        _value.setRequiredCompletionTime(requiredCompletionTime);
265    }
266    
267    public boolean getRequiredCompletionTimeHasBeenModified() {
268        return _value.getRequiredCompletionTimeHasBeenModified();
269    }
270    
271    public WorkEffortScopePK getWorkEffortScopePK() {
272        return _value.getWorkEffortScopePK();
273    }
274    
275    public WorkEffortScope getWorkEffortScope(Session session, EntityPermission entityPermission) {
276        WorkEffortScopePK pk = getWorkEffortScopePK();
277        WorkEffortScope entity = pk == null? null: WorkEffortScopeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
278        
279        return entity;
280    }
281    
282    public WorkEffortScope getWorkEffortScope(EntityPermission entityPermission) {
283        return getWorkEffortScope(ThreadSession.currentSession(), entityPermission);
284    }
285    
286    public WorkEffortScope getWorkEffortScope(Session session) {
287        return getWorkEffortScope(session, EntityPermission.READ_ONLY);
288    }
289    
290    public WorkEffortScope getWorkEffortScope() {
291        return getWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
292    }
293    
294    public WorkEffortScope getWorkEffortScopeForUpdate(Session session) {
295        return getWorkEffortScope(session, EntityPermission.READ_WRITE);
296    }
297    
298    public WorkEffortScope getWorkEffortScopeForUpdate() {
299        return getWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
300    }
301    
302    public void setWorkEffortScopePK(WorkEffortScopePK workEffortScopePK)
303            throws PersistenceNotNullException, PersistenceReadOnlyException {
304        checkReadWrite();
305        _value.setWorkEffortScopePK(workEffortScopePK);
306    }
307    
308    public void setWorkEffortScope(WorkEffortScope entity) {
309        setWorkEffortScopePK(entity == null? null: entity.getPrimaryKey());
310    }
311    
312    public boolean getWorkEffortScopePKHasBeenModified() {
313        return _value.getWorkEffortScopePKHasBeenModified();
314    }
315    
316    public Integer getDefaultPercentageToPass() {
317        return _value.getDefaultPercentageToPass();
318    }
319    
320    public void setDefaultPercentageToPass(Integer defaultPercentageToPass)
321            throws PersistenceNotNullException, PersistenceReadOnlyException {
322        checkReadWrite();
323        _value.setDefaultPercentageToPass(defaultPercentageToPass);
324    }
325    
326    public boolean getDefaultPercentageToPassHasBeenModified() {
327        return _value.getDefaultPercentageToPassHasBeenModified();
328    }
329    
330    public Integer getOverallQuestionCount() {
331        return _value.getOverallQuestionCount();
332    }
333    
334    public void setOverallQuestionCount(Integer overallQuestionCount)
335            throws PersistenceNotNullException, PersistenceReadOnlyException {
336        checkReadWrite();
337        _value.setOverallQuestionCount(overallQuestionCount);
338    }
339    
340    public boolean getOverallQuestionCountHasBeenModified() {
341        return _value.getOverallQuestionCountHasBeenModified();
342    }
343    
344    public Long getTestingValidityTime() {
345        return _value.getTestingValidityTime();
346    }
347    
348    public void setTestingValidityTime(Long testingValidityTime)
349            throws PersistenceNotNullException, PersistenceReadOnlyException {
350        checkReadWrite();
351        _value.setTestingValidityTime(testingValidityTime);
352    }
353    
354    public boolean getTestingValidityTimeHasBeenModified() {
355        return _value.getTestingValidityTimeHasBeenModified();
356    }
357    
358    public Long getExpiredRetentionTime() {
359        return _value.getExpiredRetentionTime();
360    }
361    
362    public void setExpiredRetentionTime(Long expiredRetentionTime)
363            throws PersistenceNotNullException, PersistenceReadOnlyException {
364        checkReadWrite();
365        _value.setExpiredRetentionTime(expiredRetentionTime);
366    }
367    
368    public boolean getExpiredRetentionTimeHasBeenModified() {
369        return _value.getExpiredRetentionTimeHasBeenModified();
370    }
371    
372    public Boolean getAlwaysReassignOnExpiration() {
373        return _value.getAlwaysReassignOnExpiration();
374    }
375    
376    public void setAlwaysReassignOnExpiration(Boolean alwaysReassignOnExpiration)
377            throws PersistenceNotNullException, PersistenceReadOnlyException {
378        checkReadWrite();
379        _value.setAlwaysReassignOnExpiration(alwaysReassignOnExpiration);
380    }
381    
382    public boolean getAlwaysReassignOnExpirationHasBeenModified() {
383        return _value.getAlwaysReassignOnExpirationHasBeenModified();
384    }
385    
386    public Boolean getIsDefault() {
387        return _value.getIsDefault();
388    }
389    
390    public void setIsDefault(Boolean isDefault)
391            throws PersistenceNotNullException, PersistenceReadOnlyException {
392        checkReadWrite();
393        _value.setIsDefault(isDefault);
394    }
395    
396    public boolean getIsDefaultHasBeenModified() {
397        return _value.getIsDefaultHasBeenModified();
398    }
399    
400    public Integer getSortOrder() {
401        return _value.getSortOrder();
402    }
403    
404    public void setSortOrder(Integer sortOrder)
405            throws PersistenceNotNullException, PersistenceReadOnlyException {
406        checkReadWrite();
407        _value.setSortOrder(sortOrder);
408    }
409    
410    public boolean getSortOrderHasBeenModified() {
411        return _value.getSortOrderHasBeenModified();
412    }
413    
414    public Long getFromTime() {
415        return _value.getFromTime();
416    }
417    
418    public void setFromTime(Long fromTime)
419            throws PersistenceNotNullException, PersistenceReadOnlyException {
420        checkReadWrite();
421        _value.setFromTime(fromTime);
422    }
423    
424    public boolean getFromTimeHasBeenModified() {
425        return _value.getFromTimeHasBeenModified();
426    }
427    
428    public Long getThruTime() {
429        return _value.getThruTime();
430    }
431    
432    public void setThruTime(Long thruTime)
433            throws PersistenceNotNullException, PersistenceReadOnlyException {
434        checkReadWrite();
435        _value.setThruTime(thruTime);
436    }
437    
438    public boolean getThruTimeHasBeenModified() {
439        return _value.getThruTimeHasBeenModified();
440    }
441    
442}