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 * EmploymentDetail.java
021 */
022
023package com.echothree.model.data.employee.server.entity;
024
025import com.echothree.model.data.employee.common.pk.EmploymentDetailPK;
026
027import com.echothree.model.data.employee.common.pk.EmploymentPK;
028import com.echothree.model.data.party.common.pk.PartyPK;
029import com.echothree.model.data.employee.common.pk.TerminationTypePK;
030import com.echothree.model.data.employee.common.pk.TerminationReasonPK;
031
032import com.echothree.model.data.employee.server.entity.Employment;
033import com.echothree.model.data.party.server.entity.Party;
034import com.echothree.model.data.employee.server.entity.TerminationType;
035import com.echothree.model.data.employee.server.entity.TerminationReason;
036
037import com.echothree.model.data.employee.server.factory.EmploymentFactory;
038import com.echothree.model.data.party.server.factory.PartyFactory;
039import com.echothree.model.data.employee.server.factory.TerminationTypeFactory;
040import com.echothree.model.data.employee.server.factory.TerminationReasonFactory;
041
042import com.echothree.model.data.employee.common.pk.EmploymentDetailPK;
043
044import com.echothree.model.data.employee.server.value.EmploymentDetailValue;
045
046import com.echothree.model.data.employee.server.factory.EmploymentDetailFactory;
047
048import com.echothree.util.common.exception.PersistenceException;
049import com.echothree.util.common.exception.PersistenceDatabaseException;
050import com.echothree.util.common.exception.PersistenceNotNullException;
051import com.echothree.util.common.exception.PersistenceReadOnlyException;
052
053import com.echothree.util.common.persistence.BasePK;
054
055import com.echothree.util.common.persistence.type.ByteArray;
056
057import com.echothree.util.server.persistence.BaseEntity;
058import com.echothree.util.server.persistence.EntityPermission;
059import com.echothree.util.server.persistence.Session;
060import com.echothree.util.server.persistence.ThreadSession;
061
062import java.io.Serializable;
063
064public class EmploymentDetail
065        extends BaseEntity
066        implements Serializable {
067    
068    private EmploymentDetailPK _pk;
069    private EmploymentDetailValue _value;
070    
071    /** Creates a new instance of EmploymentDetail */
072    public EmploymentDetail()
073            throws PersistenceException {
074        super();
075    }
076    
077    /** Creates a new instance of EmploymentDetail */
078    public EmploymentDetail(EmploymentDetailValue value, EntityPermission entityPermission) {
079        super(entityPermission);
080        
081        _value = value;
082        _pk = value.getPrimaryKey();
083    }
084    
085    @Override
086    public EmploymentDetailFactory getBaseFactoryInstance() {
087        return EmploymentDetailFactory.getInstance();
088    }
089    
090    @Override
091    public boolean hasBeenModified() {
092        return _value.hasBeenModified();
093    }
094    
095    @Override
096    public int hashCode() {
097        return _pk.hashCode();
098    }
099    
100    @Override
101    public String toString() {
102        return _pk.toString();
103    }
104    
105    @Override
106    public boolean equals(Object other) {
107        if(this == other)
108            return true;
109        
110        if(other instanceof EmploymentDetail) {
111            EmploymentDetail that = (EmploymentDetail)other;
112            
113            EmploymentDetailValue thatValue = that.getEmploymentDetailValue();
114            return _value.equals(thatValue);
115        } else {
116            return false;
117        }
118    }
119    
120    @Override
121    public void store(Session session)
122            throws PersistenceDatabaseException {
123        getBaseFactoryInstance().store(session, this);
124    }
125    
126    @Override
127    public void remove(Session session)
128            throws PersistenceDatabaseException {
129        getBaseFactoryInstance().remove(session, this);
130    }
131    
132    @Override
133    public void remove()
134            throws PersistenceDatabaseException {
135        getBaseFactoryInstance().remove(ThreadSession.currentSession(), this);
136    }
137    
138    public EmploymentDetailValue getEmploymentDetailValue() {
139        return _value;
140    }
141    
142    public void setEmploymentDetailValue(EmploymentDetailValue value)
143            throws PersistenceReadOnlyException {
144        checkReadWrite();
145        _value = value;
146    }
147    
148    @Override
149    public EmploymentDetailPK getPrimaryKey() {
150        return _pk;
151    }
152    
153    public EmploymentPK getEmploymentPK() {
154        return _value.getEmploymentPK();
155    }
156    
157    public Employment getEmployment(Session session, EntityPermission entityPermission) {
158        return EmploymentFactory.getInstance().getEntityFromPK(session, entityPermission, getEmploymentPK());
159    }
160    
161    public Employment getEmployment(EntityPermission entityPermission) {
162        return getEmployment(ThreadSession.currentSession(), entityPermission);
163    }
164    
165    public Employment getEmployment(Session session) {
166        return getEmployment(session, EntityPermission.READ_ONLY);
167    }
168    
169    public Employment getEmployment() {
170        return getEmployment(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
171    }
172    
173    public Employment getEmploymentForUpdate(Session session) {
174        return getEmployment(session, EntityPermission.READ_WRITE);
175    }
176    
177    public Employment getEmploymentForUpdate() {
178        return getEmployment(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
179    }
180    
181    public void setEmploymentPK(EmploymentPK employmentPK)
182            throws PersistenceNotNullException, PersistenceReadOnlyException {
183        checkReadWrite();
184        _value.setEmploymentPK(employmentPK);
185    }
186    
187    public void setEmployment(Employment entity) {
188        setEmploymentPK(entity == null? null: entity.getPrimaryKey());
189    }
190    
191    public boolean getEmploymentPKHasBeenModified() {
192        return _value.getEmploymentPKHasBeenModified();
193    }
194    
195    public String getEmploymentName() {
196        return _value.getEmploymentName();
197    }
198    
199    public void setEmploymentName(String employmentName)
200            throws PersistenceNotNullException, PersistenceReadOnlyException {
201        checkReadWrite();
202        _value.setEmploymentName(employmentName);
203    }
204    
205    public boolean getEmploymentNameHasBeenModified() {
206        return _value.getEmploymentNameHasBeenModified();
207    }
208    
209    public PartyPK getPartyPK() {
210        return _value.getPartyPK();
211    }
212    
213    public Party getParty(Session session, EntityPermission entityPermission) {
214        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK());
215    }
216    
217    public Party getParty(EntityPermission entityPermission) {
218        return getParty(ThreadSession.currentSession(), entityPermission);
219    }
220    
221    public Party getParty(Session session) {
222        return getParty(session, EntityPermission.READ_ONLY);
223    }
224    
225    public Party getParty() {
226        return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
227    }
228    
229    public Party getPartyForUpdate(Session session) {
230        return getParty(session, EntityPermission.READ_WRITE);
231    }
232    
233    public Party getPartyForUpdate() {
234        return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
235    }
236    
237    public void setPartyPK(PartyPK partyPK)
238            throws PersistenceNotNullException, PersistenceReadOnlyException {
239        checkReadWrite();
240        _value.setPartyPK(partyPK);
241    }
242    
243    public void setParty(Party entity) {
244        setPartyPK(entity == null? null: entity.getPrimaryKey());
245    }
246    
247    public boolean getPartyPKHasBeenModified() {
248        return _value.getPartyPKHasBeenModified();
249    }
250    
251    public PartyPK getCompanyPartyPK() {
252        return _value.getCompanyPartyPK();
253    }
254    
255    public Party getCompanyParty(Session session, EntityPermission entityPermission) {
256        return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getCompanyPartyPK());
257    }
258    
259    public Party getCompanyParty(EntityPermission entityPermission) {
260        return getCompanyParty(ThreadSession.currentSession(), entityPermission);
261    }
262    
263    public Party getCompanyParty(Session session) {
264        return getCompanyParty(session, EntityPermission.READ_ONLY);
265    }
266    
267    public Party getCompanyParty() {
268        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
269    }
270    
271    public Party getCompanyPartyForUpdate(Session session) {
272        return getCompanyParty(session, EntityPermission.READ_WRITE);
273    }
274    
275    public Party getCompanyPartyForUpdate() {
276        return getCompanyParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
277    }
278    
279    public void setCompanyPartyPK(PartyPK companyPartyPK)
280            throws PersistenceNotNullException, PersistenceReadOnlyException {
281        checkReadWrite();
282        _value.setCompanyPartyPK(companyPartyPK);
283    }
284    
285    public void setCompanyParty(Party entity) {
286        setCompanyPartyPK(entity == null? null: entity.getPrimaryKey());
287    }
288    
289    public boolean getCompanyPartyPKHasBeenModified() {
290        return _value.getCompanyPartyPKHasBeenModified();
291    }
292    
293    public Long getStartTime() {
294        return _value.getStartTime();
295    }
296    
297    public void setStartTime(Long startTime)
298            throws PersistenceNotNullException, PersistenceReadOnlyException {
299        checkReadWrite();
300        _value.setStartTime(startTime);
301    }
302    
303    public boolean getStartTimeHasBeenModified() {
304        return _value.getStartTimeHasBeenModified();
305    }
306    
307    public Long getEndTime() {
308        return _value.getEndTime();
309    }
310    
311    public void setEndTime(Long endTime)
312            throws PersistenceNotNullException, PersistenceReadOnlyException {
313        checkReadWrite();
314        _value.setEndTime(endTime);
315    }
316    
317    public boolean getEndTimeHasBeenModified() {
318        return _value.getEndTimeHasBeenModified();
319    }
320    
321    public TerminationTypePK getTerminationTypePK() {
322        return _value.getTerminationTypePK();
323    }
324    
325    public TerminationType getTerminationType(Session session, EntityPermission entityPermission) {
326        TerminationTypePK pk = getTerminationTypePK();
327        TerminationType entity = pk == null? null: TerminationTypeFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
328        
329        return entity;
330    }
331    
332    public TerminationType getTerminationType(EntityPermission entityPermission) {
333        return getTerminationType(ThreadSession.currentSession(), entityPermission);
334    }
335    
336    public TerminationType getTerminationType(Session session) {
337        return getTerminationType(session, EntityPermission.READ_ONLY);
338    }
339    
340    public TerminationType getTerminationType() {
341        return getTerminationType(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
342    }
343    
344    public TerminationType getTerminationTypeForUpdate(Session session) {
345        return getTerminationType(session, EntityPermission.READ_WRITE);
346    }
347    
348    public TerminationType getTerminationTypeForUpdate() {
349        return getTerminationType(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
350    }
351    
352    public void setTerminationTypePK(TerminationTypePK terminationTypePK)
353            throws PersistenceNotNullException, PersistenceReadOnlyException {
354        checkReadWrite();
355        _value.setTerminationTypePK(terminationTypePK);
356    }
357    
358    public void setTerminationType(TerminationType entity) {
359        setTerminationTypePK(entity == null? null: entity.getPrimaryKey());
360    }
361    
362    public boolean getTerminationTypePKHasBeenModified() {
363        return _value.getTerminationTypePKHasBeenModified();
364    }
365    
366    public TerminationReasonPK getTerminationReasonPK() {
367        return _value.getTerminationReasonPK();
368    }
369    
370    public TerminationReason getTerminationReason(Session session, EntityPermission entityPermission) {
371        TerminationReasonPK pk = getTerminationReasonPK();
372        TerminationReason entity = pk == null? null: TerminationReasonFactory.getInstance().getEntityFromPK(session, entityPermission, pk);
373        
374        return entity;
375    }
376    
377    public TerminationReason getTerminationReason(EntityPermission entityPermission) {
378        return getTerminationReason(ThreadSession.currentSession(), entityPermission);
379    }
380    
381    public TerminationReason getTerminationReason(Session session) {
382        return getTerminationReason(session, EntityPermission.READ_ONLY);
383    }
384    
385    public TerminationReason getTerminationReason() {
386        return getTerminationReason(ThreadSession.currentSession(), EntityPermission.READ_ONLY);
387    }
388    
389    public TerminationReason getTerminationReasonForUpdate(Session session) {
390        return getTerminationReason(session, EntityPermission.READ_WRITE);
391    }
392    
393    public TerminationReason getTerminationReasonForUpdate() {
394        return getTerminationReason(ThreadSession.currentSession(), EntityPermission.READ_WRITE);
395    }
396    
397    public void setTerminationReasonPK(TerminationReasonPK terminationReasonPK)
398            throws PersistenceNotNullException, PersistenceReadOnlyException {
399        checkReadWrite();
400        _value.setTerminationReasonPK(terminationReasonPK);
401    }
402    
403    public void setTerminationReason(TerminationReason entity) {
404        setTerminationReasonPK(entity == null? null: entity.getPrimaryKey());
405    }
406    
407    public boolean getTerminationReasonPKHasBeenModified() {
408        return _value.getTerminationReasonPKHasBeenModified();
409    }
410    
411    public Long getFromTime() {
412        return _value.getFromTime();
413    }
414    
415    public void setFromTime(Long fromTime)
416            throws PersistenceNotNullException, PersistenceReadOnlyException {
417        checkReadWrite();
418        _value.setFromTime(fromTime);
419    }
420    
421    public boolean getFromTimeHasBeenModified() {
422        return _value.getFromTimeHasBeenModified();
423    }
424    
425    public Long getThruTime() {
426        return _value.getThruTime();
427    }
428    
429    public void setThruTime(Long thruTime)
430            throws PersistenceNotNullException, PersistenceReadOnlyException {
431        checkReadWrite();
432        _value.setThruTime(thruTime);
433    }
434    
435    public boolean getThruTimeHasBeenModified() {
436        return _value.getThruTimeHasBeenModified();
437    }
438    
439}