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 * TrainingClassDetail.java 021 */ 022 023package com.echothree.model.data.training.server.entity; 024 025import com.echothree.model.data.training.common.pk.TrainingClassDetailPK; 026 027import com.echothree.model.data.training.common.pk.TrainingClassPK; 028import com.echothree.model.data.workeffort.common.pk.WorkEffortScopePK; 029 030import com.echothree.model.data.training.server.entity.TrainingClass; 031import com.echothree.model.data.workeffort.server.entity.WorkEffortScope; 032 033import com.echothree.model.data.training.server.factory.TrainingClassFactory; 034import com.echothree.model.data.workeffort.server.factory.WorkEffortScopeFactory; 035 036import com.echothree.model.data.training.common.pk.TrainingClassDetailPK; 037 038import com.echothree.model.data.training.server.value.TrainingClassDetailValue; 039 040import com.echothree.model.data.training.server.factory.TrainingClassDetailFactory; 041 042import com.echothree.util.common.exception.PersistenceException; 043import com.echothree.util.common.exception.PersistenceDatabaseException; 044import com.echothree.util.common.exception.PersistenceNotNullException; 045import com.echothree.util.common.exception.PersistenceReadOnlyException; 046 047import com.echothree.util.common.persistence.BasePK; 048 049import com.echothree.util.common.persistence.type.ByteArray; 050 051import com.echothree.util.server.persistence.BaseEntity; 052import com.echothree.util.server.persistence.EntityPermission; 053import com.echothree.util.server.persistence.Session; 054import com.echothree.util.server.persistence.ThreadSession; 055 056import java.io.Serializable; 057 058import javax.annotation.Nonnull; 059import javax.annotation.Nullable; 060 061public class TrainingClassDetail 062 extends BaseEntity 063 implements Serializable { 064 065 private TrainingClassDetailPK _pk; 066 private TrainingClassDetailValue _value; 067 068 /** Creates a new instance of TrainingClassDetail */ 069 public TrainingClassDetail() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of TrainingClassDetail */ 075 public TrainingClassDetail(TrainingClassDetailValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 @Nonnull 084 public TrainingClassDetailFactory getBaseFactoryInstance() { 085 return TrainingClassDetailFactory.getInstance(); 086 } 087 088 @Override 089 public boolean hasBeenModified() { 090 return _value.hasBeenModified(); 091 } 092 093 @Override 094 public int hashCode() { 095 return _pk.hashCode(); 096 } 097 098 @Override 099 @Nonnull 100 public String toString() { 101 return _pk.toString(); 102 } 103 104 @Override 105 public boolean equals(Object other) { 106 if(this == other) 107 return true; 108 109 if(other instanceof TrainingClassDetail that) { 110 TrainingClassDetailValue thatValue = that.getTrainingClassDetailValue(); 111 return _value.equals(thatValue); 112 } else { 113 return false; 114 } 115 } 116 117 @Override 118 public void store() 119 throws PersistenceDatabaseException { 120 getBaseFactoryInstance().store(this); 121 } 122 123 @Override 124 public void remove() 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().remove(this); 127 } 128 129 @Nonnull 130 public TrainingClassDetailValue getTrainingClassDetailValue() { 131 return _value; 132 } 133 134 public void setTrainingClassDetailValue(@Nonnull TrainingClassDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 @Nonnull 142 public TrainingClassDetailPK getPrimaryKey() { 143 return _pk; 144 } 145 146 @Nonnull 147 public TrainingClassPK getTrainingClassPK() { 148 return _value.getTrainingClassPK(); 149 } 150 151 @Nonnull 152 public TrainingClass getTrainingClass(EntityPermission entityPermission) { 153 return TrainingClassFactory.getInstance().getEntityFromPK(entityPermission, getTrainingClassPK()); 154 } 155 156 @Nonnull 157 public TrainingClass getTrainingClass() { 158 return getTrainingClass(EntityPermission.READ_ONLY); 159 } 160 161 @Nonnull 162 public TrainingClass getTrainingClassForUpdate() { 163 return getTrainingClass(EntityPermission.READ_WRITE); 164 } 165 166 public void setTrainingClassPK(@Nonnull TrainingClassPK trainingClassPK) 167 throws PersistenceNotNullException, PersistenceReadOnlyException { 168 checkReadWrite(); 169 _value.setTrainingClassPK(trainingClassPK); 170 } 171 172 public void setTrainingClass(@Nonnull TrainingClass entity) { 173 setTrainingClassPK(entity == null ? null : entity.getPrimaryKey()); 174 } 175 176 public boolean getTrainingClassPKHasBeenModified() { 177 return _value.getTrainingClassPKHasBeenModified(); 178 } 179 180 @Nonnull 181 public String getTrainingClassName() { 182 return _value.getTrainingClassName(); 183 } 184 185 public void setTrainingClassName(@Nonnull String trainingClassName) 186 throws PersistenceNotNullException, PersistenceReadOnlyException { 187 checkReadWrite(); 188 _value.setTrainingClassName(trainingClassName); 189 } 190 191 public boolean getTrainingClassNameHasBeenModified() { 192 return _value.getTrainingClassNameHasBeenModified(); 193 } 194 195 @Nullable 196 public Long getEstimatedReadingTime() { 197 return _value.getEstimatedReadingTime(); 198 } 199 200 public void setEstimatedReadingTime(@Nullable Long estimatedReadingTime) 201 throws PersistenceNotNullException, PersistenceReadOnlyException { 202 checkReadWrite(); 203 _value.setEstimatedReadingTime(estimatedReadingTime); 204 } 205 206 public boolean getEstimatedReadingTimeHasBeenModified() { 207 return _value.getEstimatedReadingTimeHasBeenModified(); 208 } 209 210 @Nullable 211 public Long getReadingTimeAllowed() { 212 return _value.getReadingTimeAllowed(); 213 } 214 215 public void setReadingTimeAllowed(@Nullable Long readingTimeAllowed) 216 throws PersistenceNotNullException, PersistenceReadOnlyException { 217 checkReadWrite(); 218 _value.setReadingTimeAllowed(readingTimeAllowed); 219 } 220 221 public boolean getReadingTimeAllowedHasBeenModified() { 222 return _value.getReadingTimeAllowedHasBeenModified(); 223 } 224 225 @Nullable 226 public Long getEstimatedTestingTime() { 227 return _value.getEstimatedTestingTime(); 228 } 229 230 public void setEstimatedTestingTime(@Nullable Long estimatedTestingTime) 231 throws PersistenceNotNullException, PersistenceReadOnlyException { 232 checkReadWrite(); 233 _value.setEstimatedTestingTime(estimatedTestingTime); 234 } 235 236 public boolean getEstimatedTestingTimeHasBeenModified() { 237 return _value.getEstimatedTestingTimeHasBeenModified(); 238 } 239 240 @Nullable 241 public Long getTestingTimeAllowed() { 242 return _value.getTestingTimeAllowed(); 243 } 244 245 public void setTestingTimeAllowed(@Nullable Long testingTimeAllowed) 246 throws PersistenceNotNullException, PersistenceReadOnlyException { 247 checkReadWrite(); 248 _value.setTestingTimeAllowed(testingTimeAllowed); 249 } 250 251 public boolean getTestingTimeAllowedHasBeenModified() { 252 return _value.getTestingTimeAllowedHasBeenModified(); 253 } 254 255 @Nullable 256 public Long getRequiredCompletionTime() { 257 return _value.getRequiredCompletionTime(); 258 } 259 260 public void setRequiredCompletionTime(@Nullable Long requiredCompletionTime) 261 throws PersistenceNotNullException, PersistenceReadOnlyException { 262 checkReadWrite(); 263 _value.setRequiredCompletionTime(requiredCompletionTime); 264 } 265 266 public boolean getRequiredCompletionTimeHasBeenModified() { 267 return _value.getRequiredCompletionTimeHasBeenModified(); 268 } 269 270 @Nullable 271 public WorkEffortScopePK getWorkEffortScopePK() { 272 return _value.getWorkEffortScopePK(); 273 } 274 275 @Nullable 276 public WorkEffortScope getWorkEffortScope(EntityPermission entityPermission) { 277 WorkEffortScopePK pk = getWorkEffortScopePK(); 278 WorkEffortScope entity = pk == null? null: WorkEffortScopeFactory.getInstance().getEntityFromPK(entityPermission, pk); 279 280 return entity; 281 } 282 283 @Nullable 284 public WorkEffortScope getWorkEffortScope() { 285 return getWorkEffortScope(EntityPermission.READ_ONLY); 286 } 287 288 @Nullable 289 public WorkEffortScope getWorkEffortScopeForUpdate() { 290 return getWorkEffortScope(EntityPermission.READ_WRITE); 291 } 292 293 public void setWorkEffortScopePK(@Nullable WorkEffortScopePK workEffortScopePK) 294 throws PersistenceNotNullException, PersistenceReadOnlyException { 295 checkReadWrite(); 296 _value.setWorkEffortScopePK(workEffortScopePK); 297 } 298 299 public void setWorkEffortScope(@Nullable WorkEffortScope entity) { 300 setWorkEffortScopePK(entity == null ? null : entity.getPrimaryKey()); 301 } 302 303 public boolean getWorkEffortScopePKHasBeenModified() { 304 return _value.getWorkEffortScopePKHasBeenModified(); 305 } 306 307 @Nullable 308 public Integer getDefaultPercentageToPass() { 309 return _value.getDefaultPercentageToPass(); 310 } 311 312 public void setDefaultPercentageToPass(@Nullable Integer defaultPercentageToPass) 313 throws PersistenceNotNullException, PersistenceReadOnlyException { 314 checkReadWrite(); 315 _value.setDefaultPercentageToPass(defaultPercentageToPass); 316 } 317 318 public boolean getDefaultPercentageToPassHasBeenModified() { 319 return _value.getDefaultPercentageToPassHasBeenModified(); 320 } 321 322 @Nullable 323 public Integer getOverallQuestionCount() { 324 return _value.getOverallQuestionCount(); 325 } 326 327 public void setOverallQuestionCount(@Nullable Integer overallQuestionCount) 328 throws PersistenceNotNullException, PersistenceReadOnlyException { 329 checkReadWrite(); 330 _value.setOverallQuestionCount(overallQuestionCount); 331 } 332 333 public boolean getOverallQuestionCountHasBeenModified() { 334 return _value.getOverallQuestionCountHasBeenModified(); 335 } 336 337 @Nullable 338 public Long getTestingValidityTime() { 339 return _value.getTestingValidityTime(); 340 } 341 342 public void setTestingValidityTime(@Nullable Long testingValidityTime) 343 throws PersistenceNotNullException, PersistenceReadOnlyException { 344 checkReadWrite(); 345 _value.setTestingValidityTime(testingValidityTime); 346 } 347 348 public boolean getTestingValidityTimeHasBeenModified() { 349 return _value.getTestingValidityTimeHasBeenModified(); 350 } 351 352 @Nullable 353 public Long getExpiredRetentionTime() { 354 return _value.getExpiredRetentionTime(); 355 } 356 357 public void setExpiredRetentionTime(@Nullable Long expiredRetentionTime) 358 throws PersistenceNotNullException, PersistenceReadOnlyException { 359 checkReadWrite(); 360 _value.setExpiredRetentionTime(expiredRetentionTime); 361 } 362 363 public boolean getExpiredRetentionTimeHasBeenModified() { 364 return _value.getExpiredRetentionTimeHasBeenModified(); 365 } 366 367 @Nonnull 368 public Boolean getAlwaysReassignOnExpiration() { 369 return _value.getAlwaysReassignOnExpiration(); 370 } 371 372 public void setAlwaysReassignOnExpiration(@Nonnull Boolean alwaysReassignOnExpiration) 373 throws PersistenceNotNullException, PersistenceReadOnlyException { 374 checkReadWrite(); 375 _value.setAlwaysReassignOnExpiration(alwaysReassignOnExpiration); 376 } 377 378 public boolean getAlwaysReassignOnExpirationHasBeenModified() { 379 return _value.getAlwaysReassignOnExpirationHasBeenModified(); 380 } 381 382 @Nonnull 383 public Boolean getIsDefault() { 384 return _value.getIsDefault(); 385 } 386 387 public void setIsDefault(@Nonnull Boolean isDefault) 388 throws PersistenceNotNullException, PersistenceReadOnlyException { 389 checkReadWrite(); 390 _value.setIsDefault(isDefault); 391 } 392 393 public boolean getIsDefaultHasBeenModified() { 394 return _value.getIsDefaultHasBeenModified(); 395 } 396 397 @Nonnull 398 public Integer getSortOrder() { 399 return _value.getSortOrder(); 400 } 401 402 public void setSortOrder(@Nonnull Integer sortOrder) 403 throws PersistenceNotNullException, PersistenceReadOnlyException { 404 checkReadWrite(); 405 _value.setSortOrder(sortOrder); 406 } 407 408 public boolean getSortOrderHasBeenModified() { 409 return _value.getSortOrderHasBeenModified(); 410 } 411 412 @Nonnull 413 public Long getFromTime() { 414 return _value.getFromTime(); 415 } 416 417 public void setFromTime(@Nonnull Long fromTime) 418 throws PersistenceNotNullException, PersistenceReadOnlyException { 419 checkReadWrite(); 420 _value.setFromTime(fromTime); 421 } 422 423 public boolean getFromTimeHasBeenModified() { 424 return _value.getFromTimeHasBeenModified(); 425 } 426 427 @Nonnull 428 public Long getThruTime() { 429 return _value.getThruTime(); 430 } 431 432 public void setThruTime(@Nonnull Long thruTime) 433 throws PersistenceNotNullException, PersistenceReadOnlyException { 434 checkReadWrite(); 435 _value.setThruTime(thruTime); 436 } 437 438 public boolean getThruTimeHasBeenModified() { 439 return _value.getThruTimeHasBeenModified(); 440 } 441 442}