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 * GlAccountDetailValue.java 021 */ 022 023package com.echothree.model.data.accounting.server.value; 024 025import com.echothree.model.data.accounting.common.pk.GlAccountDetailPK; 026 027import com.echothree.model.data.accounting.server.factory.GlAccountDetailFactory; 028 029import com.echothree.model.data.accounting.common.pk.GlAccountPK; 030import com.echothree.model.data.accounting.common.pk.GlAccountTypePK; 031import com.echothree.model.data.accounting.common.pk.GlAccountClassPK; 032import com.echothree.model.data.accounting.common.pk.GlAccountCategoryPK; 033import com.echothree.model.data.accounting.common.pk.GlResourceTypePK; 034import com.echothree.model.data.accounting.common.pk.CurrencyPK; 035 036import com.echothree.util.common.exception.PersistenceCloneException; 037import com.echothree.util.common.exception.PersistenceNotNullException; 038 039import com.echothree.util.server.persistence.BaseValue; 040 041import java.io.Serializable; 042 043import javax.annotation.Nonnull; 044import javax.annotation.Nullable; 045 046public class GlAccountDetailValue 047 extends BaseValue<GlAccountDetailPK> 048 implements Cloneable, Serializable { 049 050 private GlAccountPK glAccountPK; 051 private boolean glAccountPKHasBeenModified = false; 052 private String glAccountName; 053 private boolean glAccountNameHasBeenModified = false; 054 private GlAccountPK parentGlAccountPK; 055 private boolean parentGlAccountPKHasBeenModified = false; 056 private GlAccountTypePK glAccountTypePK; 057 private boolean glAccountTypePKHasBeenModified = false; 058 private GlAccountClassPK glAccountClassPK; 059 private boolean glAccountClassPKHasBeenModified = false; 060 private GlAccountCategoryPK glAccountCategoryPK; 061 private boolean glAccountCategoryPKHasBeenModified = false; 062 private GlResourceTypePK glResourceTypePK; 063 private boolean glResourceTypePKHasBeenModified = false; 064 private CurrencyPK currencyPK; 065 private boolean currencyPKHasBeenModified = false; 066 private Boolean isDefault; 067 private boolean isDefaultHasBeenModified = false; 068 private Long fromTime; 069 private boolean fromTimeHasBeenModified = false; 070 private Long thruTime; 071 private boolean thruTimeHasBeenModified = false; 072 073 private transient Integer _hashCode = null; 074 private transient String _stringValue = null; 075 076 private void constructFields(GlAccountPK glAccountPK, String glAccountName, GlAccountPK parentGlAccountPK, GlAccountTypePK glAccountTypePK, GlAccountClassPK glAccountClassPK, GlAccountCategoryPK glAccountCategoryPK, GlResourceTypePK glResourceTypePK, CurrencyPK currencyPK, Boolean isDefault, Long fromTime, Long thruTime) 077 throws PersistenceNotNullException { 078 checkForNull(glAccountPK); 079 this.glAccountPK = glAccountPK; 080 checkForNull(glAccountName); 081 this.glAccountName = glAccountName; 082 this.parentGlAccountPK = parentGlAccountPK; 083 checkForNull(glAccountTypePK); 084 this.glAccountTypePK = glAccountTypePK; 085 checkForNull(glAccountClassPK); 086 this.glAccountClassPK = glAccountClassPK; 087 this.glAccountCategoryPK = glAccountCategoryPK; 088 checkForNull(glResourceTypePK); 089 this.glResourceTypePK = glResourceTypePK; 090 checkForNull(currencyPK); 091 this.currencyPK = currencyPK; 092 this.isDefault = isDefault; 093 checkForNull(fromTime); 094 this.fromTime = fromTime; 095 checkForNull(thruTime); 096 this.thruTime = thruTime; 097 } 098 099 /** Creates a new instance of GlAccountDetailValue */ 100 public GlAccountDetailValue(GlAccountDetailPK glAccountDetailPK, GlAccountPK glAccountPK, String glAccountName, GlAccountPK parentGlAccountPK, GlAccountTypePK glAccountTypePK, GlAccountClassPK glAccountClassPK, GlAccountCategoryPK glAccountCategoryPK, GlResourceTypePK glResourceTypePK, CurrencyPK currencyPK, Boolean isDefault, Long fromTime, Long thruTime) 101 throws PersistenceNotNullException { 102 super(glAccountDetailPK); 103 constructFields(glAccountPK, glAccountName, parentGlAccountPK, glAccountTypePK, glAccountClassPK, glAccountCategoryPK, glResourceTypePK, currencyPK, isDefault, fromTime, thruTime); 104 } 105 106 /** Creates a new instance of GlAccountDetailValue */ 107 public GlAccountDetailValue(GlAccountPK glAccountPK, String glAccountName, GlAccountPK parentGlAccountPK, GlAccountTypePK glAccountTypePK, GlAccountClassPK glAccountClassPK, GlAccountCategoryPK glAccountCategoryPK, GlResourceTypePK glResourceTypePK, CurrencyPK currencyPK, Boolean isDefault, Long fromTime, Long thruTime) 108 throws PersistenceNotNullException { 109 super(); 110 constructFields(glAccountPK, glAccountName, parentGlAccountPK, glAccountTypePK, glAccountClassPK, glAccountCategoryPK, glResourceTypePK, currencyPK, isDefault, fromTime, thruTime); 111 } 112 113 @Override 114 @Nonnull 115 public GlAccountDetailFactory getBaseFactoryInstance() { 116 return GlAccountDetailFactory.getInstance(); 117 } 118 119 @Override 120 @Nonnull 121 public GlAccountDetailValue clone() { 122 Object result; 123 124 try { 125 result = super.clone(); 126 } catch (CloneNotSupportedException cnse) { 127 // This shouldn't happen, fail when it does. 128 throw new PersistenceCloneException(cnse); 129 } 130 131 return (GlAccountDetailValue)result; 132 } 133 134 @Override 135 @Nonnull 136 public GlAccountDetailPK getPrimaryKey() { 137 if(_primaryKey == null) { 138 _primaryKey = new GlAccountDetailPK(entityId); 139 } 140 141 return _primaryKey; 142 } 143 144 private void clearHashAndString() { 145 _hashCode = null; 146 _stringValue = null; 147 } 148 149 @Override 150 public int hashCode() { 151 if(_hashCode == null) { 152 int hashCode = 17; 153 154 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 155 156 hashCode = 37 * hashCode + ((glAccountPK != null) ? glAccountPK.hashCode() : 0); 157 hashCode = 37 * hashCode + ((glAccountName != null) ? glAccountName.hashCode() : 0); 158 hashCode = 37 * hashCode + ((parentGlAccountPK != null) ? parentGlAccountPK.hashCode() : 0); 159 hashCode = 37 * hashCode + ((glAccountTypePK != null) ? glAccountTypePK.hashCode() : 0); 160 hashCode = 37 * hashCode + ((glAccountClassPK != null) ? glAccountClassPK.hashCode() : 0); 161 hashCode = 37 * hashCode + ((glAccountCategoryPK != null) ? glAccountCategoryPK.hashCode() : 0); 162 hashCode = 37 * hashCode + ((glResourceTypePK != null) ? glResourceTypePK.hashCode() : 0); 163 hashCode = 37 * hashCode + ((currencyPK != null) ? currencyPK.hashCode() : 0); 164 hashCode = 37 * hashCode + ((isDefault != null) ? isDefault.hashCode() : 0); 165 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 166 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 167 168 _hashCode = hashCode; 169 } 170 171 return _hashCode; 172 } 173 174 @Override 175 @Nonnull 176 public String toString() { 177 if(_stringValue == null) { 178 _stringValue = "{" + 179 "entityId=" + getEntityId() + 180 ", glAccountPK=" + getGlAccountPK() + 181 ", glAccountName=" + getGlAccountName() + 182 ", parentGlAccountPK=" + getParentGlAccountPK() + 183 ", glAccountTypePK=" + getGlAccountTypePK() + 184 ", glAccountClassPK=" + getGlAccountClassPK() + 185 ", glAccountCategoryPK=" + getGlAccountCategoryPK() + 186 ", glResourceTypePK=" + getGlResourceTypePK() + 187 ", currencyPK=" + getCurrencyPK() + 188 ", isDefault=" + getIsDefault() + 189 ", fromTime=" + getFromTime() + 190 ", thruTime=" + getThruTime() + 191 "}"; 192 } 193 return _stringValue; 194 } 195 196 @Override 197 public boolean equals(Object other) { 198 if(this == other) 199 return true; 200 201 if(!hasIdentity()) 202 return false; 203 204 if(other instanceof GlAccountDetailValue that) { 205 if(!that.hasIdentity()) 206 return false; 207 208 Long thisEntityId = getEntityId(); 209 Long thatEntityId = that.getEntityId(); 210 211 boolean objectsEqual = thisEntityId.equals(thatEntityId); 212 if(objectsEqual) 213 objectsEqual = isIdentical(that); 214 215 return objectsEqual; 216 } else { 217 return false; 218 } 219 } 220 221 public boolean isIdentical(Object other) { 222 if(other instanceof GlAccountDetailValue that) { 223 boolean objectsEqual = true; 224 225 226 if(objectsEqual) { 227 GlAccountPK thisGlAccountPK = getGlAccountPK(); 228 GlAccountPK thatGlAccountPK = that.getGlAccountPK(); 229 230 if(thisGlAccountPK == null) { 231 objectsEqual = objectsEqual && (thatGlAccountPK == null); 232 } else { 233 objectsEqual = objectsEqual && thisGlAccountPK.equals(thatGlAccountPK); 234 } 235 } 236 237 if(objectsEqual) { 238 String thisGlAccountName = getGlAccountName(); 239 String thatGlAccountName = that.getGlAccountName(); 240 241 if(thisGlAccountName == null) { 242 objectsEqual = objectsEqual && (thatGlAccountName == null); 243 } else { 244 objectsEqual = objectsEqual && thisGlAccountName.equals(thatGlAccountName); 245 } 246 } 247 248 if(objectsEqual) { 249 GlAccountPK thisParentGlAccountPK = getParentGlAccountPK(); 250 GlAccountPK thatParentGlAccountPK = that.getParentGlAccountPK(); 251 252 if(thisParentGlAccountPK == null) { 253 objectsEqual = objectsEqual && (thatParentGlAccountPK == null); 254 } else { 255 objectsEqual = objectsEqual && thisParentGlAccountPK.equals(thatParentGlAccountPK); 256 } 257 } 258 259 if(objectsEqual) { 260 GlAccountTypePK thisGlAccountTypePK = getGlAccountTypePK(); 261 GlAccountTypePK thatGlAccountTypePK = that.getGlAccountTypePK(); 262 263 if(thisGlAccountTypePK == null) { 264 objectsEqual = objectsEqual && (thatGlAccountTypePK == null); 265 } else { 266 objectsEqual = objectsEqual && thisGlAccountTypePK.equals(thatGlAccountTypePK); 267 } 268 } 269 270 if(objectsEqual) { 271 GlAccountClassPK thisGlAccountClassPK = getGlAccountClassPK(); 272 GlAccountClassPK thatGlAccountClassPK = that.getGlAccountClassPK(); 273 274 if(thisGlAccountClassPK == null) { 275 objectsEqual = objectsEqual && (thatGlAccountClassPK == null); 276 } else { 277 objectsEqual = objectsEqual && thisGlAccountClassPK.equals(thatGlAccountClassPK); 278 } 279 } 280 281 if(objectsEqual) { 282 GlAccountCategoryPK thisGlAccountCategoryPK = getGlAccountCategoryPK(); 283 GlAccountCategoryPK thatGlAccountCategoryPK = that.getGlAccountCategoryPK(); 284 285 if(thisGlAccountCategoryPK == null) { 286 objectsEqual = objectsEqual && (thatGlAccountCategoryPK == null); 287 } else { 288 objectsEqual = objectsEqual && thisGlAccountCategoryPK.equals(thatGlAccountCategoryPK); 289 } 290 } 291 292 if(objectsEqual) { 293 GlResourceTypePK thisGlResourceTypePK = getGlResourceTypePK(); 294 GlResourceTypePK thatGlResourceTypePK = that.getGlResourceTypePK(); 295 296 if(thisGlResourceTypePK == null) { 297 objectsEqual = objectsEqual && (thatGlResourceTypePK == null); 298 } else { 299 objectsEqual = objectsEqual && thisGlResourceTypePK.equals(thatGlResourceTypePK); 300 } 301 } 302 303 if(objectsEqual) { 304 CurrencyPK thisCurrencyPK = getCurrencyPK(); 305 CurrencyPK thatCurrencyPK = that.getCurrencyPK(); 306 307 if(thisCurrencyPK == null) { 308 objectsEqual = objectsEqual && (thatCurrencyPK == null); 309 } else { 310 objectsEqual = objectsEqual && thisCurrencyPK.equals(thatCurrencyPK); 311 } 312 } 313 314 if(objectsEqual) { 315 Boolean thisIsDefault = getIsDefault(); 316 Boolean thatIsDefault = that.getIsDefault(); 317 318 if(thisIsDefault == null) { 319 objectsEqual = objectsEqual && (thatIsDefault == null); 320 } else { 321 objectsEqual = objectsEqual && thisIsDefault.equals(thatIsDefault); 322 } 323 } 324 325 if(objectsEqual) { 326 Long thisFromTime = getFromTime(); 327 Long thatFromTime = that.getFromTime(); 328 329 if(thisFromTime == null) { 330 objectsEqual = objectsEqual && (thatFromTime == null); 331 } else { 332 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 333 } 334 } 335 336 if(objectsEqual) { 337 Long thisThruTime = getThruTime(); 338 Long thatThruTime = that.getThruTime(); 339 340 if(thisThruTime == null) { 341 objectsEqual = objectsEqual && (thatThruTime == null); 342 } else { 343 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 344 } 345 } 346 347 return objectsEqual; 348 } else { 349 return false; 350 } 351 } 352 353 @Override 354 public boolean hasBeenModified() { 355 return glAccountPKHasBeenModified || glAccountNameHasBeenModified || parentGlAccountPKHasBeenModified || glAccountTypePKHasBeenModified || glAccountClassPKHasBeenModified || glAccountCategoryPKHasBeenModified || glResourceTypePKHasBeenModified || currencyPKHasBeenModified || isDefaultHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 356 } 357 358 @Override 359 public void clearHasBeenModified() { 360 glAccountPKHasBeenModified = false; 361 glAccountNameHasBeenModified = false; 362 parentGlAccountPKHasBeenModified = false; 363 glAccountTypePKHasBeenModified = false; 364 glAccountClassPKHasBeenModified = false; 365 glAccountCategoryPKHasBeenModified = false; 366 glResourceTypePKHasBeenModified = false; 367 currencyPKHasBeenModified = false; 368 isDefaultHasBeenModified = false; 369 fromTimeHasBeenModified = false; 370 thruTimeHasBeenModified = false; 371 } 372 373 @Nonnull 374 public GlAccountPK getGlAccountPK() { 375 return glAccountPK; 376 } 377 378 public void setGlAccountPK(@Nonnull GlAccountPK glAccountPK) 379 throws PersistenceNotNullException { 380 checkForNull(glAccountPK); 381 382 boolean update = true; 383 384 if(this.glAccountPK != null) { 385 if(this.glAccountPK.equals(glAccountPK)) { 386 update = false; 387 } 388 } else if(glAccountPK == null) { 389 update = false; 390 } 391 392 if(update) { 393 this.glAccountPK = glAccountPK; 394 glAccountPKHasBeenModified = true; 395 clearHashAndString(); 396 } 397 } 398 399 public boolean getGlAccountPKHasBeenModified() { 400 return glAccountPKHasBeenModified; 401 } 402 403 @Nonnull 404 public String getGlAccountName() { 405 return glAccountName; 406 } 407 408 public void setGlAccountName(@Nonnull String glAccountName) 409 throws PersistenceNotNullException { 410 checkForNull(glAccountName); 411 412 boolean update = true; 413 414 if(this.glAccountName != null) { 415 if(this.glAccountName.equals(glAccountName)) { 416 update = false; 417 } 418 } else if(glAccountName == null) { 419 update = false; 420 } 421 422 if(update) { 423 this.glAccountName = glAccountName; 424 glAccountNameHasBeenModified = true; 425 clearHashAndString(); 426 } 427 } 428 429 public boolean getGlAccountNameHasBeenModified() { 430 return glAccountNameHasBeenModified; 431 } 432 433 @Nullable 434 public GlAccountPK getParentGlAccountPK() { 435 return parentGlAccountPK; 436 } 437 438 public void setParentGlAccountPK(@Nullable GlAccountPK parentGlAccountPK) { 439 boolean update = true; 440 441 if(this.parentGlAccountPK != null) { 442 if(this.parentGlAccountPK.equals(parentGlAccountPK)) { 443 update = false; 444 } 445 } else if(parentGlAccountPK == null) { 446 update = false; 447 } 448 449 if(update) { 450 this.parentGlAccountPK = parentGlAccountPK; 451 parentGlAccountPKHasBeenModified = true; 452 clearHashAndString(); 453 } 454 } 455 456 public boolean getParentGlAccountPKHasBeenModified() { 457 return parentGlAccountPKHasBeenModified; 458 } 459 460 @Nonnull 461 public GlAccountTypePK getGlAccountTypePK() { 462 return glAccountTypePK; 463 } 464 465 public void setGlAccountTypePK(@Nonnull GlAccountTypePK glAccountTypePK) 466 throws PersistenceNotNullException { 467 checkForNull(glAccountTypePK); 468 469 boolean update = true; 470 471 if(this.glAccountTypePK != null) { 472 if(this.glAccountTypePK.equals(glAccountTypePK)) { 473 update = false; 474 } 475 } else if(glAccountTypePK == null) { 476 update = false; 477 } 478 479 if(update) { 480 this.glAccountTypePK = glAccountTypePK; 481 glAccountTypePKHasBeenModified = true; 482 clearHashAndString(); 483 } 484 } 485 486 public boolean getGlAccountTypePKHasBeenModified() { 487 return glAccountTypePKHasBeenModified; 488 } 489 490 @Nonnull 491 public GlAccountClassPK getGlAccountClassPK() { 492 return glAccountClassPK; 493 } 494 495 public void setGlAccountClassPK(@Nonnull GlAccountClassPK glAccountClassPK) 496 throws PersistenceNotNullException { 497 checkForNull(glAccountClassPK); 498 499 boolean update = true; 500 501 if(this.glAccountClassPK != null) { 502 if(this.glAccountClassPK.equals(glAccountClassPK)) { 503 update = false; 504 } 505 } else if(glAccountClassPK == null) { 506 update = false; 507 } 508 509 if(update) { 510 this.glAccountClassPK = glAccountClassPK; 511 glAccountClassPKHasBeenModified = true; 512 clearHashAndString(); 513 } 514 } 515 516 public boolean getGlAccountClassPKHasBeenModified() { 517 return glAccountClassPKHasBeenModified; 518 } 519 520 @Nullable 521 public GlAccountCategoryPK getGlAccountCategoryPK() { 522 return glAccountCategoryPK; 523 } 524 525 public void setGlAccountCategoryPK(@Nullable GlAccountCategoryPK glAccountCategoryPK) { 526 boolean update = true; 527 528 if(this.glAccountCategoryPK != null) { 529 if(this.glAccountCategoryPK.equals(glAccountCategoryPK)) { 530 update = false; 531 } 532 } else if(glAccountCategoryPK == null) { 533 update = false; 534 } 535 536 if(update) { 537 this.glAccountCategoryPK = glAccountCategoryPK; 538 glAccountCategoryPKHasBeenModified = true; 539 clearHashAndString(); 540 } 541 } 542 543 public boolean getGlAccountCategoryPKHasBeenModified() { 544 return glAccountCategoryPKHasBeenModified; 545 } 546 547 @Nonnull 548 public GlResourceTypePK getGlResourceTypePK() { 549 return glResourceTypePK; 550 } 551 552 public void setGlResourceTypePK(@Nonnull GlResourceTypePK glResourceTypePK) 553 throws PersistenceNotNullException { 554 checkForNull(glResourceTypePK); 555 556 boolean update = true; 557 558 if(this.glResourceTypePK != null) { 559 if(this.glResourceTypePK.equals(glResourceTypePK)) { 560 update = false; 561 } 562 } else if(glResourceTypePK == null) { 563 update = false; 564 } 565 566 if(update) { 567 this.glResourceTypePK = glResourceTypePK; 568 glResourceTypePKHasBeenModified = true; 569 clearHashAndString(); 570 } 571 } 572 573 public boolean getGlResourceTypePKHasBeenModified() { 574 return glResourceTypePKHasBeenModified; 575 } 576 577 @Nonnull 578 public CurrencyPK getCurrencyPK() { 579 return currencyPK; 580 } 581 582 public void setCurrencyPK(@Nonnull CurrencyPK currencyPK) 583 throws PersistenceNotNullException { 584 checkForNull(currencyPK); 585 586 boolean update = true; 587 588 if(this.currencyPK != null) { 589 if(this.currencyPK.equals(currencyPK)) { 590 update = false; 591 } 592 } else if(currencyPK == null) { 593 update = false; 594 } 595 596 if(update) { 597 this.currencyPK = currencyPK; 598 currencyPKHasBeenModified = true; 599 clearHashAndString(); 600 } 601 } 602 603 public boolean getCurrencyPKHasBeenModified() { 604 return currencyPKHasBeenModified; 605 } 606 607 @Nullable 608 public Boolean getIsDefault() { 609 return isDefault; 610 } 611 612 public void setIsDefault(@Nullable Boolean isDefault) { 613 boolean update = true; 614 615 if(this.isDefault != null) { 616 if(this.isDefault.equals(isDefault)) { 617 update = false; 618 } 619 } else if(isDefault == null) { 620 update = false; 621 } 622 623 if(update) { 624 this.isDefault = isDefault; 625 isDefaultHasBeenModified = true; 626 clearHashAndString(); 627 } 628 } 629 630 public boolean getIsDefaultHasBeenModified() { 631 return isDefaultHasBeenModified; 632 } 633 634 @Nonnull 635 public Long getFromTime() { 636 return fromTime; 637 } 638 639 public void setFromTime(@Nonnull Long fromTime) 640 throws PersistenceNotNullException { 641 checkForNull(fromTime); 642 643 boolean update = true; 644 645 if(this.fromTime != null) { 646 if(this.fromTime.equals(fromTime)) { 647 update = false; 648 } 649 } else if(fromTime == null) { 650 update = false; 651 } 652 653 if(update) { 654 this.fromTime = fromTime; 655 fromTimeHasBeenModified = true; 656 clearHashAndString(); 657 } 658 } 659 660 public boolean getFromTimeHasBeenModified() { 661 return fromTimeHasBeenModified; 662 } 663 664 @Nonnull 665 public Long getThruTime() { 666 return thruTime; 667 } 668 669 public void setThruTime(@Nonnull Long thruTime) 670 throws PersistenceNotNullException { 671 checkForNull(thruTime); 672 673 boolean update = true; 674 675 if(this.thruTime != null) { 676 if(this.thruTime.equals(thruTime)) { 677 update = false; 678 } 679 } else if(thruTime == null) { 680 update = false; 681 } 682 683 if(update) { 684 this.thruTime = thruTime; 685 thruTimeHasBeenModified = true; 686 clearHashAndString(); 687 } 688 } 689 690 public boolean getThruTimeHasBeenModified() { 691 return thruTimeHasBeenModified; 692 } 693 694}