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 * LeaveDetail.java 021 */ 022 023package com.echothree.model.data.employee.server.entity; 024 025import com.echothree.model.data.employee.common.pk.LeaveDetailPK; 026 027import com.echothree.model.data.employee.common.pk.LeavePK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.employee.common.pk.LeaveTypePK; 030import com.echothree.model.data.employee.common.pk.LeaveReasonPK; 031 032import com.echothree.model.data.employee.server.entity.Leave; 033import com.echothree.model.data.party.server.entity.Party; 034import com.echothree.model.data.employee.server.entity.LeaveType; 035import com.echothree.model.data.employee.server.entity.LeaveReason; 036 037import com.echothree.model.data.employee.server.factory.LeaveFactory; 038import com.echothree.model.data.party.server.factory.PartyFactory; 039import com.echothree.model.data.employee.server.factory.LeaveTypeFactory; 040import com.echothree.model.data.employee.server.factory.LeaveReasonFactory; 041 042import com.echothree.model.data.employee.common.pk.LeaveDetailPK; 043 044import com.echothree.model.data.employee.server.value.LeaveDetailValue; 045 046import com.echothree.model.data.employee.server.factory.LeaveDetailFactory; 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 LeaveDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private LeaveDetailPK _pk; 069 private LeaveDetailValue _value; 070 071 /** Creates a new instance of LeaveDetail */ 072 public LeaveDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of LeaveDetail */ 078 public LeaveDetail(LeaveDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public LeaveDetailFactory getBaseFactoryInstance() { 087 return LeaveDetailFactory.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 LeaveDetail that) { 111 LeaveDetailValue thatValue = that.getLeaveDetailValue(); 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 LeaveDetailValue getLeaveDetailValue() { 131 return _value; 132 } 133 134 public void setLeaveDetailValue(LeaveDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public LeaveDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public LeavePK getLeavePK() { 146 return _value.getLeavePK(); 147 } 148 149 public Leave getLeave(EntityPermission entityPermission) { 150 return LeaveFactory.getInstance().getEntityFromPK(entityPermission, getLeavePK()); 151 } 152 153 public Leave getLeave() { 154 return getLeave(EntityPermission.READ_ONLY); 155 } 156 157 public Leave getLeaveForUpdate() { 158 return getLeave(EntityPermission.READ_WRITE); 159 } 160 161 public void setLeavePK(LeavePK leavePK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setLeavePK(leavePK); 165 } 166 167 public void setLeave(Leave entity) { 168 setLeavePK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getLeavePKHasBeenModified() { 172 return _value.getLeavePKHasBeenModified(); 173 } 174 175 public String getLeaveName() { 176 return _value.getLeaveName(); 177 } 178 179 public void setLeaveName(String leaveName) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setLeaveName(leaveName); 183 } 184 185 public boolean getLeaveNameHasBeenModified() { 186 return _value.getLeaveNameHasBeenModified(); 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 LeaveTypePK getLeaveTypePK() { 250 return _value.getLeaveTypePK(); 251 } 252 253 public LeaveType getLeaveType(EntityPermission entityPermission) { 254 return LeaveTypeFactory.getInstance().getEntityFromPK(entityPermission, getLeaveTypePK()); 255 } 256 257 public LeaveType getLeaveType() { 258 return getLeaveType(EntityPermission.READ_ONLY); 259 } 260 261 public LeaveType getLeaveTypeForUpdate() { 262 return getLeaveType(EntityPermission.READ_WRITE); 263 } 264 265 public void setLeaveTypePK(LeaveTypePK leaveTypePK) 266 throws PersistenceNotNullException, PersistenceReadOnlyException { 267 checkReadWrite(); 268 _value.setLeaveTypePK(leaveTypePK); 269 } 270 271 public void setLeaveType(LeaveType entity) { 272 setLeaveTypePK(entity == null? null: entity.getPrimaryKey()); 273 } 274 275 public boolean getLeaveTypePKHasBeenModified() { 276 return _value.getLeaveTypePKHasBeenModified(); 277 } 278 279 public LeaveReasonPK getLeaveReasonPK() { 280 return _value.getLeaveReasonPK(); 281 } 282 283 public LeaveReason getLeaveReason(EntityPermission entityPermission) { 284 return LeaveReasonFactory.getInstance().getEntityFromPK(entityPermission, getLeaveReasonPK()); 285 } 286 287 public LeaveReason getLeaveReason() { 288 return getLeaveReason(EntityPermission.READ_ONLY); 289 } 290 291 public LeaveReason getLeaveReasonForUpdate() { 292 return getLeaveReason(EntityPermission.READ_WRITE); 293 } 294 295 public void setLeaveReasonPK(LeaveReasonPK leaveReasonPK) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setLeaveReasonPK(leaveReasonPK); 299 } 300 301 public void setLeaveReason(LeaveReason entity) { 302 setLeaveReasonPK(entity == null? null: entity.getPrimaryKey()); 303 } 304 305 public boolean getLeaveReasonPKHasBeenModified() { 306 return _value.getLeaveReasonPKHasBeenModified(); 307 } 308 309 public Long getStartTime() { 310 return _value.getStartTime(); 311 } 312 313 public void setStartTime(Long startTime) 314 throws PersistenceNotNullException, PersistenceReadOnlyException { 315 checkReadWrite(); 316 _value.setStartTime(startTime); 317 } 318 319 public boolean getStartTimeHasBeenModified() { 320 return _value.getStartTimeHasBeenModified(); 321 } 322 323 public Long getEndTime() { 324 return _value.getEndTime(); 325 } 326 327 public void setEndTime(Long endTime) 328 throws PersistenceNotNullException, PersistenceReadOnlyException { 329 checkReadWrite(); 330 _value.setEndTime(endTime); 331 } 332 333 public boolean getEndTimeHasBeenModified() { 334 return _value.getEndTimeHasBeenModified(); 335 } 336 337 public Long getTotalTime() { 338 return _value.getTotalTime(); 339 } 340 341 public void setTotalTime(Long totalTime) 342 throws PersistenceNotNullException, PersistenceReadOnlyException { 343 checkReadWrite(); 344 _value.setTotalTime(totalTime); 345 } 346 347 public boolean getTotalTimeHasBeenModified() { 348 return _value.getTotalTimeHasBeenModified(); 349 } 350 351 public Long getFromTime() { 352 return _value.getFromTime(); 353 } 354 355 public void setFromTime(Long fromTime) 356 throws PersistenceNotNullException, PersistenceReadOnlyException { 357 checkReadWrite(); 358 _value.setFromTime(fromTime); 359 } 360 361 public boolean getFromTimeHasBeenModified() { 362 return _value.getFromTimeHasBeenModified(); 363 } 364 365 public Long getThruTime() { 366 return _value.getThruTime(); 367 } 368 369 public void setThruTime(Long thruTime) 370 throws PersistenceNotNullException, PersistenceReadOnlyException { 371 checkReadWrite(); 372 _value.setThruTime(thruTime); 373 } 374 375 public boolean getThruTimeHasBeenModified() { 376 return _value.getThruTimeHasBeenModified(); 377 } 378 379}