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