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 * WorkRequirementScopeDetail.java
021 */
022
023package com.echothree.model.data.workrequirement.server.entity;
024
025import com.echothree.model.data.workrequirement.common.pk.WorkRequirementScopeDetailPK;
026
027import com.echothree.model.data.workrequirement.common.pk.WorkRequirementScopePK;
028import com.echothree.model.data.workeffort.common.pk.WorkEffortScopePK;
029import com.echothree.model.data.workrequirement.common.pk.WorkRequirementTypePK;
030import com.echothree.model.data.sequence.common.pk.SequencePK;
031import com.echothree.model.data.selector.common.pk.SelectorPK;
032
033import com.echothree.model.data.workrequirement.server.entity.WorkRequirementScope;
034import com.echothree.model.data.workeffort.server.entity.WorkEffortScope;
035import com.echothree.model.data.workrequirement.server.entity.WorkRequirementType;
036import com.echothree.model.data.sequence.server.entity.Sequence;
037import com.echothree.model.data.selector.server.entity.Selector;
038
039import com.echothree.model.data.workrequirement.server.factory.WorkRequirementScopeFactory;
040import com.echothree.model.data.workeffort.server.factory.WorkEffortScopeFactory;
041import com.echothree.model.data.workrequirement.server.factory.WorkRequirementTypeFactory;
042import com.echothree.model.data.sequence.server.factory.SequenceFactory;
043import com.echothree.model.data.selector.server.factory.SelectorFactory;
044
045import com.echothree.model.data.workrequirement.common.pk.WorkRequirementScopeDetailPK;
046
047import com.echothree.model.data.workrequirement.server.value.WorkRequirementScopeDetailValue;
048
049import com.echothree.model.data.workrequirement.server.factory.WorkRequirementScopeDetailFactory;
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 WorkRequirementScopeDetail
068        extends BaseEntity
069        implements Serializable {
070    
071    private WorkRequirementScopeDetailPK _pk;
072    private WorkRequirementScopeDetailValue _value;
073    
074    /** Creates a new instance of WorkRequirementScopeDetail */
075    public WorkRequirementScopeDetail()
076            throws PersistenceException {
077        super();
078    }
079    
080    /** Creates a new instance of WorkRequirementScopeDetail */
081    public WorkRequirementScopeDetail(WorkRequirementScopeDetailValue value, EntityPermission entityPermission) {
082        super(entityPermission);
083        
084        _value = value;
085        _pk = value.getPrimaryKey();
086    }
087    
088    @Override
089    public WorkRequirementScopeDetailFactory getBaseFactoryInstance() {
090        return WorkRequirementScopeDetailFactory.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 WorkRequirementScopeDetail that) {
114            WorkRequirementScopeDetailValue thatValue = that.getWorkRequirementScopeDetailValue();
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 WorkRequirementScopeDetailValue getWorkRequirementScopeDetailValue() {
140        return _value;
141    }
142    
143    public void setWorkRequirementScopeDetailValue(WorkRequirementScopeDetailValue value)
144            throws PersistenceReadOnlyException {
145        checkReadWrite();
146        _value = value;
147    }
148    
149    @Override
150    public WorkRequirementScopeDetailPK getPrimaryKey() {
151        return _pk;
152    }
153    
154    public WorkRequirementScopePK getWorkRequirementScopePK() {
155        return _value.getWorkRequirementScopePK();
156    }
157    
158    public WorkRequirementScope getWorkRequirementScope(Session session, EntityPermission entityPermission) {
159        return WorkRequirementScopeFactory.getInstance().getEntityFromPK(session, entityPermission, getWorkRequirementScopePK());
160    }
161    
162    public WorkRequirementScope getWorkRequirementScope(EntityPermission entityPermission) {
163        return getWorkRequirementScope(ThreadSession.currentSession(), entityPermission);
164    }
165    
166    public WorkRequirementScope getWorkRequirementScope(Session session) {
167        return getWorkRequirementScope(session, EntityPermission.READ_ONLY);
168    }
169    
170    public WorkRequirementScope getWorkRequirementScope() {
171        return getWorkRequirementScope(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
172    }
173    
174    public WorkRequirementScope getWorkRequirementScopeForUpdate(Session session) {
175        return getWorkRequirementScope(session, EntityPermission.READ_WRITE);
176    }
177    
178    public WorkRequirementScope getWorkRequirementScopeForUpdate() {
179        return getWorkRequirementScope(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
180    }
181    
182    public void setWorkRequirementScopePK(WorkRequirementScopePK workRequirementScopePK)
183            throws PersistenceNotNullException, PersistenceReadOnlyException {
184        checkReadWrite();
185        _value.setWorkRequirementScopePK(workRequirementScopePK);
186    }
187    
188    public void setWorkRequirementScope(WorkRequirementScope entity) {
189        setWorkRequirementScopePK(entity == null? null: entity.getPrimaryKey());
190    }
191    
192    public boolean getWorkRequirementScopePKHasBeenModified() {
193        return _value.getWorkRequirementScopePKHasBeenModified();
194    }
195    
196    public WorkEffortScopePK getWorkEffortScopePK() {
197        return _value.getWorkEffortScopePK();
198    }
199    
200    public WorkEffortScope getWorkEffortScope(Session session, EntityPermission entityPermission) {
201        return WorkEffortScopeFactory.getInstance().getEntityFromPK(session, entityPermission, getWorkEffortScopePK());
202    }
203    
204    public WorkEffortScope getWorkEffortScope(EntityPermission entityPermission) {
205        return getWorkEffortScope(ThreadSession.currentSession(), entityPermission);
206    }
207    
208    public WorkEffortScope getWorkEffortScope(Session session) {
209        return getWorkEffortScope(session, EntityPermission.READ_ONLY);
210    }
211    
212    public WorkEffortScope getWorkEffortScope() {
213        return getWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
214    }
215    
216    public WorkEffortScope getWorkEffortScopeForUpdate(Session session) {
217        return getWorkEffortScope(session, EntityPermission.READ_WRITE);
218    }
219    
220    public WorkEffortScope getWorkEffortScopeForUpdate() {
221        return getWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
222    }
223    
224    public void setWorkEffortScopePK(WorkEffortScopePK workEffortScopePK)
225            throws PersistenceNotNullException, PersistenceReadOnlyException {
226        checkReadWrite();
227        _value.setWorkEffortScopePK(workEffortScopePK);
228    }
229    
230    public void setWorkEffortScope(WorkEffortScope entity) {
231        setWorkEffortScopePK(entity == null? null: entity.getPrimaryKey());
232    }
233    
234    public boolean getWorkEffortScopePKHasBeenModified() {
235        return _value.getWorkEffortScopePKHasBeenModified();
236    }
237    
238    public WorkRequirementTypePK getWorkRequirementTypePK() {
239        return _value.getWorkRequirementTypePK();
240    }
241    
242    public WorkRequirementType getWorkRequirementType(Session session, EntityPermission entityPermission) {
243        return WorkRequirementTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getWorkRequirementTypePK());
244    }
245    
246    public WorkRequirementType getWorkRequirementType(EntityPermission entityPermission) {
247        return getWorkRequirementType(ThreadSession.currentSession(), entityPermission);
248    }
249    
250    public WorkRequirementType getWorkRequirementType(Session session) {
251        return getWorkRequirementType(session, EntityPermission.READ_ONLY);
252    }
253    
254    public WorkRequirementType getWorkRequirementType() {
255        return getWorkRequirementType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
256    }
257    
258    public WorkRequirementType getWorkRequirementTypeForUpdate(Session session) {
259        return getWorkRequirementType(session, EntityPermission.READ_WRITE);
260    }
261    
262    public WorkRequirementType getWorkRequirementTypeForUpdate() {
263        return getWorkRequirementType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
264    }
265    
266    public void setWorkRequirementTypePK(WorkRequirementTypePK workRequirementTypePK)
267            throws PersistenceNotNullException, PersistenceReadOnlyException {
268        checkReadWrite();
269        _value.setWorkRequirementTypePK(workRequirementTypePK);
270    }
271    
272    public void setWorkRequirementType(WorkRequirementType entity) {
273        setWorkRequirementTypePK(entity == null? null: entity.getPrimaryKey());
274    }
275    
276    public boolean getWorkRequirementTypePKHasBeenModified() {
277        return _value.getWorkRequirementTypePKHasBeenModified();
278    }
279    
280    public SequencePK getWorkRequirementSequencePK() {
281        return _value.getWorkRequirementSequencePK();
282    }
283    
284    public Sequence getWorkRequirementSequence(Session session, EntityPermission entityPermission) {
285        SequencePK pk = getWorkRequirementSequencePK();
286        Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
287        
288        return entity;
289    }
290    
291    public Sequence getWorkRequirementSequence(EntityPermission entityPermission) {
292        return getWorkRequirementSequence(ThreadSession.currentSession(), entityPermission);
293    }
294    
295    public Sequence getWorkRequirementSequence(Session session) {
296        return getWorkRequirementSequence(session, EntityPermission.READ_ONLY);
297    }
298    
299    public Sequence getWorkRequirementSequence() {
300        return getWorkRequirementSequence(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
301    }
302    
303    public Sequence getWorkRequirementSequenceForUpdate(Session session) {
304        return getWorkRequirementSequence(session, EntityPermission.READ_WRITE);
305    }
306    
307    public Sequence getWorkRequirementSequenceForUpdate() {
308        return getWorkRequirementSequence(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
309    }
310    
311    public void setWorkRequirementSequencePK(SequencePK workRequirementSequencePK)
312            throws PersistenceNotNullException, PersistenceReadOnlyException {
313        checkReadWrite();
314        _value.setWorkRequirementSequencePK(workRequirementSequencePK);
315    }
316    
317    public void setWorkRequirementSequence(Sequence entity) {
318        setWorkRequirementSequencePK(entity == null? null: entity.getPrimaryKey());
319    }
320    
321    public boolean getWorkRequirementSequencePKHasBeenModified() {
322        return _value.getWorkRequirementSequencePKHasBeenModified();
323    }
324    
325    public SequencePK getWorkTimeSequencePK() {
326        return _value.getWorkTimeSequencePK();
327    }
328    
329    public Sequence getWorkTimeSequence(Session session, EntityPermission entityPermission) {
330        SequencePK pk = getWorkTimeSequencePK();
331        Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
332        
333        return entity;
334    }
335    
336    public Sequence getWorkTimeSequence(EntityPermission entityPermission) {
337        return getWorkTimeSequence(ThreadSession.currentSession(), entityPermission);
338    }
339    
340    public Sequence getWorkTimeSequence(Session session) {
341        return getWorkTimeSequence(session, EntityPermission.READ_ONLY);
342    }
343    
344    public Sequence getWorkTimeSequence() {
345        return getWorkTimeSequence(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
346    }
347    
348    public Sequence getWorkTimeSequenceForUpdate(Session session) {
349        return getWorkTimeSequence(session, EntityPermission.READ_WRITE);
350    }
351    
352    public Sequence getWorkTimeSequenceForUpdate() {
353        return getWorkTimeSequence(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
354    }
355    
356    public void setWorkTimeSequencePK(SequencePK workTimeSequencePK)
357            throws PersistenceNotNullException, PersistenceReadOnlyException {
358        checkReadWrite();
359        _value.setWorkTimeSequencePK(workTimeSequencePK);
360    }
361    
362    public void setWorkTimeSequence(Sequence entity) {
363        setWorkTimeSequencePK(entity == null? null: entity.getPrimaryKey());
364    }
365    
366    public boolean getWorkTimeSequencePKHasBeenModified() {
367        return _value.getWorkTimeSequencePKHasBeenModified();
368    }
369    
370    public SelectorPK getWorkAssignmentSelectorPK() {
371        return _value.getWorkAssignmentSelectorPK();
372    }
373    
374    public Selector getWorkAssignmentSelector(Session session, EntityPermission entityPermission) {
375        SelectorPK pk = getWorkAssignmentSelectorPK();
376        Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
377        
378        return entity;
379    }
380    
381    public Selector getWorkAssignmentSelector(EntityPermission entityPermission) {
382        return getWorkAssignmentSelector(ThreadSession.currentSession(), entityPermission);
383    }
384    
385    public Selector getWorkAssignmentSelector(Session session) {
386        return getWorkAssignmentSelector(session, EntityPermission.READ_ONLY);
387    }
388    
389    public Selector getWorkAssignmentSelector() {
390        return getWorkAssignmentSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
391    }
392    
393    public Selector getWorkAssignmentSelectorForUpdate(Session session) {
394        return getWorkAssignmentSelector(session, EntityPermission.READ_WRITE);
395    }
396    
397    public Selector getWorkAssignmentSelectorForUpdate() {
398        return getWorkAssignmentSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
399    }
400    
401    public void setWorkAssignmentSelectorPK(SelectorPK workAssignmentSelectorPK)
402            throws PersistenceNotNullException, PersistenceReadOnlyException {
403        checkReadWrite();
404        _value.setWorkAssignmentSelectorPK(workAssignmentSelectorPK);
405    }
406    
407    public void setWorkAssignmentSelector(Selector entity) {
408        setWorkAssignmentSelectorPK(entity == null? null: entity.getPrimaryKey());
409    }
410    
411    public boolean getWorkAssignmentSelectorPKHasBeenModified() {
412        return _value.getWorkAssignmentSelectorPKHasBeenModified();
413    }
414    
415    public Long getEstimatedTimeAllowed() {
416        return _value.getEstimatedTimeAllowed();
417    }
418    
419    public void setEstimatedTimeAllowed(Long estimatedTimeAllowed)
420            throws PersistenceNotNullException, PersistenceReadOnlyException {
421        checkReadWrite();
422        _value.setEstimatedTimeAllowed(estimatedTimeAllowed);
423    }
424    
425    public boolean getEstimatedTimeAllowedHasBeenModified() {
426        return _value.getEstimatedTimeAllowedHasBeenModified();
427    }
428    
429    public Long getMaximumTimeAllowed() {
430        return _value.getMaximumTimeAllowed();
431    }
432    
433    public void setMaximumTimeAllowed(Long maximumTimeAllowed)
434            throws PersistenceNotNullException, PersistenceReadOnlyException {
435        checkReadWrite();
436        _value.setMaximumTimeAllowed(maximumTimeAllowed);
437    }
438    
439    public boolean getMaximumTimeAllowedHasBeenModified() {
440        return _value.getMaximumTimeAllowedHasBeenModified();
441    }
442    
443    public Long getFromTime() {
444        return _value.getFromTime();
445    }
446    
447    public void setFromTime(Long fromTime)
448            throws PersistenceNotNullException, PersistenceReadOnlyException {
449        checkReadWrite();
450        _value.setFromTime(fromTime);
451    }
452    
453    public boolean getFromTimeHasBeenModified() {
454        return _value.getFromTimeHasBeenModified();
455    }
456    
457    public Long getThruTime() {
458        return _value.getThruTime();
459    }
460    
461    public void setThruTime(Long thruTime)
462            throws PersistenceNotNullException, PersistenceReadOnlyException {
463        checkReadWrite();
464        _value.setThruTime(thruTime);
465    }
466    
467    public boolean getThruTimeHasBeenModified() {
468        return _value.getThruTimeHasBeenModified();
469    }
470    
471}