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 * 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 067import javax.annotation.Nonnull; 068import javax.annotation.Nullable; 069 070public class WorkRequirementScopeDetail 071 extends BaseEntity 072 implements Serializable { 073 074 private WorkRequirementScopeDetailPK _pk; 075 private WorkRequirementScopeDetailValue _value; 076 077 /** Creates a new instance of WorkRequirementScopeDetail */ 078 public WorkRequirementScopeDetail() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of WorkRequirementScopeDetail */ 084 public WorkRequirementScopeDetail(WorkRequirementScopeDetailValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 @Nonnull 093 public WorkRequirementScopeDetailFactory getBaseFactoryInstance() { 094 return WorkRequirementScopeDetailFactory.getInstance(); 095 } 096 097 @Override 098 public boolean hasBeenModified() { 099 return _value.hasBeenModified(); 100 } 101 102 @Override 103 public int hashCode() { 104 return _pk.hashCode(); 105 } 106 107 @Override 108 @Nonnull 109 public String toString() { 110 return _pk.toString(); 111 } 112 113 @Override 114 public boolean equals(Object other) { 115 if(this == other) 116 return true; 117 118 if(other instanceof WorkRequirementScopeDetail that) { 119 WorkRequirementScopeDetailValue thatValue = that.getWorkRequirementScopeDetailValue(); 120 return _value.equals(thatValue); 121 } else { 122 return false; 123 } 124 } 125 126 @Override 127 public void store() 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().store(this); 130 } 131 132 @Override 133 public void remove() 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(this); 136 } 137 138 @Nonnull 139 public WorkRequirementScopeDetailValue getWorkRequirementScopeDetailValue() { 140 return _value; 141 } 142 143 public void setWorkRequirementScopeDetailValue(@Nonnull WorkRequirementScopeDetailValue value) 144 throws PersistenceReadOnlyException { 145 checkReadWrite(); 146 _value = value; 147 } 148 149 @Override 150 @Nonnull 151 public WorkRequirementScopeDetailPK getPrimaryKey() { 152 return _pk; 153 } 154 155 @Nonnull 156 public WorkRequirementScopePK getWorkRequirementScopePK() { 157 return _value.getWorkRequirementScopePK(); 158 } 159 160 @Nonnull 161 public WorkRequirementScope getWorkRequirementScope(EntityPermission entityPermission) { 162 return WorkRequirementScopeFactory.getInstance().getEntityFromPK(entityPermission, getWorkRequirementScopePK()); 163 } 164 165 @Nonnull 166 public WorkRequirementScope getWorkRequirementScope() { 167 return getWorkRequirementScope(EntityPermission.READ_ONLY); 168 } 169 170 @Nonnull 171 public WorkRequirementScope getWorkRequirementScopeForUpdate() { 172 return getWorkRequirementScope(EntityPermission.READ_WRITE); 173 } 174 175 public void setWorkRequirementScopePK(@Nonnull WorkRequirementScopePK workRequirementScopePK) 176 throws PersistenceNotNullException, PersistenceReadOnlyException { 177 checkReadWrite(); 178 _value.setWorkRequirementScopePK(workRequirementScopePK); 179 } 180 181 public void setWorkRequirementScope(@Nonnull WorkRequirementScope entity) { 182 setWorkRequirementScopePK(entity == null ? null : entity.getPrimaryKey()); 183 } 184 185 public boolean getWorkRequirementScopePKHasBeenModified() { 186 return _value.getWorkRequirementScopePKHasBeenModified(); 187 } 188 189 @Nonnull 190 public WorkEffortScopePK getWorkEffortScopePK() { 191 return _value.getWorkEffortScopePK(); 192 } 193 194 @Nonnull 195 public WorkEffortScope getWorkEffortScope(EntityPermission entityPermission) { 196 return WorkEffortScopeFactory.getInstance().getEntityFromPK(entityPermission, getWorkEffortScopePK()); 197 } 198 199 @Nonnull 200 public WorkEffortScope getWorkEffortScope() { 201 return getWorkEffortScope(EntityPermission.READ_ONLY); 202 } 203 204 @Nonnull 205 public WorkEffortScope getWorkEffortScopeForUpdate() { 206 return getWorkEffortScope(EntityPermission.READ_WRITE); 207 } 208 209 public void setWorkEffortScopePK(@Nonnull WorkEffortScopePK workEffortScopePK) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setWorkEffortScopePK(workEffortScopePK); 213 } 214 215 public void setWorkEffortScope(@Nonnull WorkEffortScope entity) { 216 setWorkEffortScopePK(entity == null ? null : entity.getPrimaryKey()); 217 } 218 219 public boolean getWorkEffortScopePKHasBeenModified() { 220 return _value.getWorkEffortScopePKHasBeenModified(); 221 } 222 223 @Nonnull 224 public WorkRequirementTypePK getWorkRequirementTypePK() { 225 return _value.getWorkRequirementTypePK(); 226 } 227 228 @Nonnull 229 public WorkRequirementType getWorkRequirementType(EntityPermission entityPermission) { 230 return WorkRequirementTypeFactory.getInstance().getEntityFromPK(entityPermission, getWorkRequirementTypePK()); 231 } 232 233 @Nonnull 234 public WorkRequirementType getWorkRequirementType() { 235 return getWorkRequirementType(EntityPermission.READ_ONLY); 236 } 237 238 @Nonnull 239 public WorkRequirementType getWorkRequirementTypeForUpdate() { 240 return getWorkRequirementType(EntityPermission.READ_WRITE); 241 } 242 243 public void setWorkRequirementTypePK(@Nonnull WorkRequirementTypePK workRequirementTypePK) 244 throws PersistenceNotNullException, PersistenceReadOnlyException { 245 checkReadWrite(); 246 _value.setWorkRequirementTypePK(workRequirementTypePK); 247 } 248 249 public void setWorkRequirementType(@Nonnull WorkRequirementType entity) { 250 setWorkRequirementTypePK(entity == null ? null : entity.getPrimaryKey()); 251 } 252 253 public boolean getWorkRequirementTypePKHasBeenModified() { 254 return _value.getWorkRequirementTypePKHasBeenModified(); 255 } 256 257 @Nullable 258 public SequencePK getWorkRequirementSequencePK() { 259 return _value.getWorkRequirementSequencePK(); 260 } 261 262 @Nullable 263 public Sequence getWorkRequirementSequence(EntityPermission entityPermission) { 264 SequencePK pk = getWorkRequirementSequencePK(); 265 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 266 267 return entity; 268 } 269 270 @Nullable 271 public Sequence getWorkRequirementSequence() { 272 return getWorkRequirementSequence(EntityPermission.READ_ONLY); 273 } 274 275 @Nullable 276 public Sequence getWorkRequirementSequenceForUpdate() { 277 return getWorkRequirementSequence(EntityPermission.READ_WRITE); 278 } 279 280 public void setWorkRequirementSequencePK(@Nullable SequencePK workRequirementSequencePK) 281 throws PersistenceNotNullException, PersistenceReadOnlyException { 282 checkReadWrite(); 283 _value.setWorkRequirementSequencePK(workRequirementSequencePK); 284 } 285 286 public void setWorkRequirementSequence(@Nullable Sequence entity) { 287 setWorkRequirementSequencePK(entity == null ? null : entity.getPrimaryKey()); 288 } 289 290 public boolean getWorkRequirementSequencePKHasBeenModified() { 291 return _value.getWorkRequirementSequencePKHasBeenModified(); 292 } 293 294 @Nullable 295 public SequencePK getWorkTimeSequencePK() { 296 return _value.getWorkTimeSequencePK(); 297 } 298 299 @Nullable 300 public Sequence getWorkTimeSequence(EntityPermission entityPermission) { 301 SequencePK pk = getWorkTimeSequencePK(); 302 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 303 304 return entity; 305 } 306 307 @Nullable 308 public Sequence getWorkTimeSequence() { 309 return getWorkTimeSequence(EntityPermission.READ_ONLY); 310 } 311 312 @Nullable 313 public Sequence getWorkTimeSequenceForUpdate() { 314 return getWorkTimeSequence(EntityPermission.READ_WRITE); 315 } 316 317 public void setWorkTimeSequencePK(@Nullable SequencePK workTimeSequencePK) 318 throws PersistenceNotNullException, PersistenceReadOnlyException { 319 checkReadWrite(); 320 _value.setWorkTimeSequencePK(workTimeSequencePK); 321 } 322 323 public void setWorkTimeSequence(@Nullable Sequence entity) { 324 setWorkTimeSequencePK(entity == null ? null : entity.getPrimaryKey()); 325 } 326 327 public boolean getWorkTimeSequencePKHasBeenModified() { 328 return _value.getWorkTimeSequencePKHasBeenModified(); 329 } 330 331 @Nullable 332 public SelectorPK getWorkAssignmentSelectorPK() { 333 return _value.getWorkAssignmentSelectorPK(); 334 } 335 336 @Nullable 337 public Selector getWorkAssignmentSelector(EntityPermission entityPermission) { 338 SelectorPK pk = getWorkAssignmentSelectorPK(); 339 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 340 341 return entity; 342 } 343 344 @Nullable 345 public Selector getWorkAssignmentSelector() { 346 return getWorkAssignmentSelector(EntityPermission.READ_ONLY); 347 } 348 349 @Nullable 350 public Selector getWorkAssignmentSelectorForUpdate() { 351 return getWorkAssignmentSelector(EntityPermission.READ_WRITE); 352 } 353 354 public void setWorkAssignmentSelectorPK(@Nullable SelectorPK workAssignmentSelectorPK) 355 throws PersistenceNotNullException, PersistenceReadOnlyException { 356 checkReadWrite(); 357 _value.setWorkAssignmentSelectorPK(workAssignmentSelectorPK); 358 } 359 360 public void setWorkAssignmentSelector(@Nullable Selector entity) { 361 setWorkAssignmentSelectorPK(entity == null ? null : entity.getPrimaryKey()); 362 } 363 364 public boolean getWorkAssignmentSelectorPKHasBeenModified() { 365 return _value.getWorkAssignmentSelectorPKHasBeenModified(); 366 } 367 368 @Nullable 369 public Long getEstimatedTimeAllowed() { 370 return _value.getEstimatedTimeAllowed(); 371 } 372 373 public void setEstimatedTimeAllowed(@Nullable Long estimatedTimeAllowed) 374 throws PersistenceNotNullException, PersistenceReadOnlyException { 375 checkReadWrite(); 376 _value.setEstimatedTimeAllowed(estimatedTimeAllowed); 377 } 378 379 public boolean getEstimatedTimeAllowedHasBeenModified() { 380 return _value.getEstimatedTimeAllowedHasBeenModified(); 381 } 382 383 @Nullable 384 public Long getMaximumTimeAllowed() { 385 return _value.getMaximumTimeAllowed(); 386 } 387 388 public void setMaximumTimeAllowed(@Nullable Long maximumTimeAllowed) 389 throws PersistenceNotNullException, PersistenceReadOnlyException { 390 checkReadWrite(); 391 _value.setMaximumTimeAllowed(maximumTimeAllowed); 392 } 393 394 public boolean getMaximumTimeAllowedHasBeenModified() { 395 return _value.getMaximumTimeAllowedHasBeenModified(); 396 } 397 398 @Nonnull 399 public Long getFromTime() { 400 return _value.getFromTime(); 401 } 402 403 public void setFromTime(@Nonnull Long fromTime) 404 throws PersistenceNotNullException, PersistenceReadOnlyException { 405 checkReadWrite(); 406 _value.setFromTime(fromTime); 407 } 408 409 public boolean getFromTimeHasBeenModified() { 410 return _value.getFromTimeHasBeenModified(); 411 } 412 413 @Nonnull 414 public Long getThruTime() { 415 return _value.getThruTime(); 416 } 417 418 public void setThruTime(@Nonnull Long thruTime) 419 throws PersistenceNotNullException, PersistenceReadOnlyException { 420 checkReadWrite(); 421 _value.setThruTime(thruTime); 422 } 423 424 public boolean getThruTimeHasBeenModified() { 425 return _value.getThruTimeHasBeenModified(); 426 } 427 428}