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 * 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 that) {
111            EmploymentDetailValue thatValue = that.getEmploymentDetailValue();
112            return _value.equals(thatValue);
113        } else {
114            return false;
115        }
116    }
117    
118    @Override
119    public void store()
120            throws PersistenceDatabaseException {
121        getBaseFactoryInstance().store(this);
122    }
123    
124    @Override
125    public void remove()
126            throws PersistenceDatabaseException {
127        getBaseFactoryInstance().remove(this);
128    }
129    
130    public EmploymentDetailValue getEmploymentDetailValue() {
131        return _value;
132    }
133    
134    public void setEmploymentDetailValue(EmploymentDetailValue value)
135            throws PersistenceReadOnlyException {
136        checkReadWrite();
137        _value = value;
138    }
139    
140    @Override
141    public EmploymentDetailPK getPrimaryKey() {
142        return _pk;
143    }
144    
145    public EmploymentPK getEmploymentPK() {
146        return _value.getEmploymentPK();
147    }
148    
149    public Employment getEmployment(EntityPermission entityPermission) {
150        return EmploymentFactory.getInstance().getEntityFromPK(entityPermission, getEmploymentPK());
151    }
152    
153    public Employment getEmployment() {
154        return getEmployment(EntityPermission.READ_ONLY);
155    }
156    
157    public Employment getEmploymentForUpdate() {
158        return getEmployment(EntityPermission.READ_WRITE);
159    }
160    
161    public void setEmploymentPK(EmploymentPK employmentPK)
162            throws PersistenceNotNullException, PersistenceReadOnlyException {
163        checkReadWrite();
164        _value.setEmploymentPK(employmentPK);
165    }
166    
167    public void setEmployment(Employment entity) {
168        setEmploymentPK(entity == null? null: entity.getPrimaryKey());
169    }
170    
171    public boolean getEmploymentPKHasBeenModified() {
172        return _value.getEmploymentPKHasBeenModified();
173    }
174    
175    public String getEmploymentName() {
176        return _value.getEmploymentName();
177    }
178    
179    public void setEmploymentName(String employmentName)
180            throws PersistenceNotNullException, PersistenceReadOnlyException {
181        checkReadWrite();
182        _value.setEmploymentName(employmentName);
183    }
184    
185    public boolean getEmploymentNameHasBeenModified() {
186        return _value.getEmploymentNameHasBeenModified();
187    }
188    
189    public PartyPK getPartyPK() {
190        return _value.getPartyPK();
191    }
192    
193    public Party getParty(EntityPermission entityPermission) {
194        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getPartyPK());
195    }
196    
197    public Party getParty() {
198        return getParty(EntityPermission.READ_ONLY);
199    }
200    
201    public Party getPartyForUpdate() {
202        return getParty(EntityPermission.READ_WRITE);
203    }
204    
205    public void setPartyPK(PartyPK partyPK)
206            throws PersistenceNotNullException, PersistenceReadOnlyException {
207        checkReadWrite();
208        _value.setPartyPK(partyPK);
209    }
210    
211    public void setParty(Party entity) {
212        setPartyPK(entity == null? null: entity.getPrimaryKey());
213    }
214    
215    public boolean getPartyPKHasBeenModified() {
216        return _value.getPartyPKHasBeenModified();
217    }
218    
219    public PartyPK getCompanyPartyPK() {
220        return _value.getCompanyPartyPK();
221    }
222    
223    public Party getCompanyParty(EntityPermission entityPermission) {
224        return PartyFactory.getInstance().getEntityFromPK(entityPermission, getCompanyPartyPK());
225    }
226    
227    public Party getCompanyParty() {
228        return getCompanyParty(EntityPermission.READ_ONLY);
229    }
230    
231    public Party getCompanyPartyForUpdate() {
232        return getCompanyParty(EntityPermission.READ_WRITE);
233    }
234    
235    public void setCompanyPartyPK(PartyPK companyPartyPK)
236            throws PersistenceNotNullException, PersistenceReadOnlyException {
237        checkReadWrite();
238        _value.setCompanyPartyPK(companyPartyPK);
239    }
240    
241    public void setCompanyParty(Party entity) {
242        setCompanyPartyPK(entity == null? null: entity.getPrimaryKey());
243    }
244    
245    public boolean getCompanyPartyPKHasBeenModified() {
246        return _value.getCompanyPartyPKHasBeenModified();
247    }
248    
249    public Long getStartTime() {
250        return _value.getStartTime();
251    }
252    
253    public void setStartTime(Long startTime)
254            throws PersistenceNotNullException, PersistenceReadOnlyException {
255        checkReadWrite();
256        _value.setStartTime(startTime);
257    }
258    
259    public boolean getStartTimeHasBeenModified() {
260        return _value.getStartTimeHasBeenModified();
261    }
262    
263    public Long getEndTime() {
264        return _value.getEndTime();
265    }
266    
267    public void setEndTime(Long endTime)
268            throws PersistenceNotNullException, PersistenceReadOnlyException {
269        checkReadWrite();
270        _value.setEndTime(endTime);
271    }
272    
273    public boolean getEndTimeHasBeenModified() {
274        return _value.getEndTimeHasBeenModified();
275    }
276    
277    public TerminationTypePK getTerminationTypePK() {
278        return _value.getTerminationTypePK();
279    }
280    
281    public TerminationType getTerminationType(EntityPermission entityPermission) {
282        TerminationTypePK pk = getTerminationTypePK();
283        TerminationType entity = pk == null? null: TerminationTypeFactory.getInstance().getEntityFromPK(entityPermission, pk);
284        
285        return entity;
286    }
287    
288    public TerminationType getTerminationType() {
289        return getTerminationType(EntityPermission.READ_ONLY);
290    }
291    
292    public TerminationType getTerminationTypeForUpdate() {
293        return getTerminationType(EntityPermission.READ_WRITE);
294    }
295    
296    public void setTerminationTypePK(TerminationTypePK terminationTypePK)
297            throws PersistenceNotNullException, PersistenceReadOnlyException {
298        checkReadWrite();
299        _value.setTerminationTypePK(terminationTypePK);
300    }
301    
302    public void setTerminationType(TerminationType entity) {
303        setTerminationTypePK(entity == null? null: entity.getPrimaryKey());
304    }
305    
306    public boolean getTerminationTypePKHasBeenModified() {
307        return _value.getTerminationTypePKHasBeenModified();
308    }
309    
310    public TerminationReasonPK getTerminationReasonPK() {
311        return _value.getTerminationReasonPK();
312    }
313    
314    public TerminationReason getTerminationReason(EntityPermission entityPermission) {
315        TerminationReasonPK pk = getTerminationReasonPK();
316        TerminationReason entity = pk == null? null: TerminationReasonFactory.getInstance().getEntityFromPK(entityPermission, pk);
317        
318        return entity;
319    }
320    
321    public TerminationReason getTerminationReason() {
322        return getTerminationReason(EntityPermission.READ_ONLY);
323    }
324    
325    public TerminationReason getTerminationReasonForUpdate() {
326        return getTerminationReason(EntityPermission.READ_WRITE);
327    }
328    
329    public void setTerminationReasonPK(TerminationReasonPK terminationReasonPK)
330            throws PersistenceNotNullException, PersistenceReadOnlyException {
331        checkReadWrite();
332        _value.setTerminationReasonPK(terminationReasonPK);
333    }
334    
335    public void setTerminationReason(TerminationReason entity) {
336        setTerminationReasonPK(entity == null? null: entity.getPrimaryKey());
337    }
338    
339    public boolean getTerminationReasonPKHasBeenModified() {
340        return _value.getTerminationReasonPKHasBeenModified();
341    }
342    
343    public Long getFromTime() {
344        return _value.getFromTime();
345    }
346    
347    public void setFromTime(Long fromTime)
348            throws PersistenceNotNullException, PersistenceReadOnlyException {
349        checkReadWrite();
350        _value.setFromTime(fromTime);
351    }
352    
353    public boolean getFromTimeHasBeenModified() {
354        return _value.getFromTimeHasBeenModified();
355    }
356    
357    public Long getThruTime() {
358        return _value.getThruTime();
359    }
360    
361    public void setThruTime(Long thruTime)
362            throws PersistenceNotNullException, PersistenceReadOnlyException {
363        checkReadWrite();
364        _value.setThruTime(thruTime);
365    }
366    
367    public boolean getThruTimeHasBeenModified() {
368        return _value.getThruTimeHasBeenModified();
369    }
370    
371}