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 * 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()
114            throws PersistenceDatabaseException {
115        getBaseFactoryInstance().store(this);
116    }
117    
118    @Override
119    public void remove()
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().remove(this);
122    }
123    
124    public TrainingClassDetailValue getTrainingClassDetailValue() {
125        return _value;
126    }
127    
128    public void setTrainingClassDetailValue(TrainingClassDetailValue value)
129            throws PersistenceReadOnlyException {
130        checkReadWrite();
131        _value = value;
132    }
133    
134    @Override
135    public TrainingClassDetailPK getPrimaryKey() {
136        return _pk;
137    }
138    
139    public TrainingClassPK getTrainingClassPK() {
140        return _value.getTrainingClassPK();
141    }
142    
143    public TrainingClass getTrainingClass(EntityPermission entityPermission) {
144        return TrainingClassFactory.getInstance().getEntityFromPK(entityPermission, getTrainingClassPK());
145    }
146    
147    public TrainingClass getTrainingClass() {
148        return getTrainingClass(EntityPermission.READ_ONLY);
149    }
150    
151    public TrainingClass getTrainingClassForUpdate() {
152        return getTrainingClass(EntityPermission.READ_WRITE);
153    }
154    
155    public void setTrainingClassPK(TrainingClassPK trainingClassPK)
156            throws PersistenceNotNullException, PersistenceReadOnlyException {
157        checkReadWrite();
158        _value.setTrainingClassPK(trainingClassPK);
159    }
160    
161    public void setTrainingClass(TrainingClass entity) {
162        setTrainingClassPK(entity == null? null: entity.getPrimaryKey());
163    }
164    
165    public boolean getTrainingClassPKHasBeenModified() {
166        return _value.getTrainingClassPKHasBeenModified();
167    }
168    
169    public String getTrainingClassName() {
170        return _value.getTrainingClassName();
171    }
172    
173    public void setTrainingClassName(String trainingClassName)
174            throws PersistenceNotNullException, PersistenceReadOnlyException {
175        checkReadWrite();
176        _value.setTrainingClassName(trainingClassName);
177    }
178    
179    public boolean getTrainingClassNameHasBeenModified() {
180        return _value.getTrainingClassNameHasBeenModified();
181    }
182    
183    public Long getEstimatedReadingTime() {
184        return _value.getEstimatedReadingTime();
185    }
186    
187    public void setEstimatedReadingTime(Long estimatedReadingTime)
188            throws PersistenceNotNullException, PersistenceReadOnlyException {
189        checkReadWrite();
190        _value.setEstimatedReadingTime(estimatedReadingTime);
191    }
192    
193    public boolean getEstimatedReadingTimeHasBeenModified() {
194        return _value.getEstimatedReadingTimeHasBeenModified();
195    }
196    
197    public Long getReadingTimeAllowed() {
198        return _value.getReadingTimeAllowed();
199    }
200    
201    public void setReadingTimeAllowed(Long readingTimeAllowed)
202            throws PersistenceNotNullException, PersistenceReadOnlyException {
203        checkReadWrite();
204        _value.setReadingTimeAllowed(readingTimeAllowed);
205    }
206    
207    public boolean getReadingTimeAllowedHasBeenModified() {
208        return _value.getReadingTimeAllowedHasBeenModified();
209    }
210    
211    public Long getEstimatedTestingTime() {
212        return _value.getEstimatedTestingTime();
213    }
214    
215    public void setEstimatedTestingTime(Long estimatedTestingTime)
216            throws PersistenceNotNullException, PersistenceReadOnlyException {
217        checkReadWrite();
218        _value.setEstimatedTestingTime(estimatedTestingTime);
219    }
220    
221    public boolean getEstimatedTestingTimeHasBeenModified() {
222        return _value.getEstimatedTestingTimeHasBeenModified();
223    }
224    
225    public Long getTestingTimeAllowed() {
226        return _value.getTestingTimeAllowed();
227    }
228    
229    public void setTestingTimeAllowed(Long testingTimeAllowed)
230            throws PersistenceNotNullException, PersistenceReadOnlyException {
231        checkReadWrite();
232        _value.setTestingTimeAllowed(testingTimeAllowed);
233    }
234    
235    public boolean getTestingTimeAllowedHasBeenModified() {
236        return _value.getTestingTimeAllowedHasBeenModified();
237    }
238    
239    public Long getRequiredCompletionTime() {
240        return _value.getRequiredCompletionTime();
241    }
242    
243    public void setRequiredCompletionTime(Long requiredCompletionTime)
244            throws PersistenceNotNullException, PersistenceReadOnlyException {
245        checkReadWrite();
246        _value.setRequiredCompletionTime(requiredCompletionTime);
247    }
248    
249    public boolean getRequiredCompletionTimeHasBeenModified() {
250        return _value.getRequiredCompletionTimeHasBeenModified();
251    }
252    
253    public WorkEffortScopePK getWorkEffortScopePK() {
254        return _value.getWorkEffortScopePK();
255    }
256    
257    public WorkEffortScope getWorkEffortScope(EntityPermission entityPermission) {
258        WorkEffortScopePK pk = getWorkEffortScopePK();
259        WorkEffortScope entity = pk == null? null: WorkEffortScopeFactory.getInstance().getEntityFromPK(entityPermission, pk);
260        
261        return entity;
262    }
263    
264    public WorkEffortScope getWorkEffortScope() {
265        return getWorkEffortScope(EntityPermission.READ_ONLY);
266    }
267    
268    public WorkEffortScope getWorkEffortScopeForUpdate() {
269        return getWorkEffortScope(EntityPermission.READ_WRITE);
270    }
271    
272    public void setWorkEffortScopePK(WorkEffortScopePK workEffortScopePK)
273            throws PersistenceNotNullException, PersistenceReadOnlyException {
274        checkReadWrite();
275        _value.setWorkEffortScopePK(workEffortScopePK);
276    }
277    
278    public void setWorkEffortScope(WorkEffortScope entity) {
279        setWorkEffortScopePK(entity == null? null: entity.getPrimaryKey());
280    }
281    
282    public boolean getWorkEffortScopePKHasBeenModified() {
283        return _value.getWorkEffortScopePKHasBeenModified();
284    }
285    
286    public Integer getDefaultPercentageToPass() {
287        return _value.getDefaultPercentageToPass();
288    }
289    
290    public void setDefaultPercentageToPass(Integer defaultPercentageToPass)
291            throws PersistenceNotNullException, PersistenceReadOnlyException {
292        checkReadWrite();
293        _value.setDefaultPercentageToPass(defaultPercentageToPass);
294    }
295    
296    public boolean getDefaultPercentageToPassHasBeenModified() {
297        return _value.getDefaultPercentageToPassHasBeenModified();
298    }
299    
300    public Integer getOverallQuestionCount() {
301        return _value.getOverallQuestionCount();
302    }
303    
304    public void setOverallQuestionCount(Integer overallQuestionCount)
305            throws PersistenceNotNullException, PersistenceReadOnlyException {
306        checkReadWrite();
307        _value.setOverallQuestionCount(overallQuestionCount);
308    }
309    
310    public boolean getOverallQuestionCountHasBeenModified() {
311        return _value.getOverallQuestionCountHasBeenModified();
312    }
313    
314    public Long getTestingValidityTime() {
315        return _value.getTestingValidityTime();
316    }
317    
318    public void setTestingValidityTime(Long testingValidityTime)
319            throws PersistenceNotNullException, PersistenceReadOnlyException {
320        checkReadWrite();
321        _value.setTestingValidityTime(testingValidityTime);
322    }
323    
324    public boolean getTestingValidityTimeHasBeenModified() {
325        return _value.getTestingValidityTimeHasBeenModified();
326    }
327    
328    public Long getExpiredRetentionTime() {
329        return _value.getExpiredRetentionTime();
330    }
331    
332    public void setExpiredRetentionTime(Long expiredRetentionTime)
333            throws PersistenceNotNullException, PersistenceReadOnlyException {
334        checkReadWrite();
335        _value.setExpiredRetentionTime(expiredRetentionTime);
336    }
337    
338    public boolean getExpiredRetentionTimeHasBeenModified() {
339        return _value.getExpiredRetentionTimeHasBeenModified();
340    }
341    
342    public Boolean getAlwaysReassignOnExpiration() {
343        return _value.getAlwaysReassignOnExpiration();
344    }
345    
346    public void setAlwaysReassignOnExpiration(Boolean alwaysReassignOnExpiration)
347            throws PersistenceNotNullException, PersistenceReadOnlyException {
348        checkReadWrite();
349        _value.setAlwaysReassignOnExpiration(alwaysReassignOnExpiration);
350    }
351    
352    public boolean getAlwaysReassignOnExpirationHasBeenModified() {
353        return _value.getAlwaysReassignOnExpirationHasBeenModified();
354    }
355    
356    public Boolean getIsDefault() {
357        return _value.getIsDefault();
358    }
359    
360    public void setIsDefault(Boolean isDefault)
361            throws PersistenceNotNullException, PersistenceReadOnlyException {
362        checkReadWrite();
363        _value.setIsDefault(isDefault);
364    }
365    
366    public boolean getIsDefaultHasBeenModified() {
367        return _value.getIsDefaultHasBeenModified();
368    }
369    
370    public Integer getSortOrder() {
371        return _value.getSortOrder();
372    }
373    
374    public void setSortOrder(Integer sortOrder)
375            throws PersistenceNotNullException, PersistenceReadOnlyException {
376        checkReadWrite();
377        _value.setSortOrder(sortOrder);
378    }
379    
380    public boolean getSortOrderHasBeenModified() {
381        return _value.getSortOrderHasBeenModified();
382    }
383    
384    public Long getFromTime() {
385        return _value.getFromTime();
386    }
387    
388    public void setFromTime(Long fromTime)
389            throws PersistenceNotNullException, PersistenceReadOnlyException {
390        checkReadWrite();
391        _value.setFromTime(fromTime);
392    }
393    
394    public boolean getFromTimeHasBeenModified() {
395        return _value.getFromTimeHasBeenModified();
396    }
397    
398    public Long getThruTime() {
399        return _value.getThruTime();
400    }
401    
402    public void setThruTime(Long thruTime)
403            throws PersistenceNotNullException, PersistenceReadOnlyException {
404        checkReadWrite();
405        _value.setThruTime(thruTime);
406    }
407    
408    public boolean getThruTimeHasBeenModified() {
409        return _value.getThruTimeHasBeenModified();
410    }
411    
412}