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