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 * UserVisitCampaignValue.java 021 */ 022 023package com.echothree.model.data.campaign.server.value; 024 025import com.echothree.model.data.campaign.common.pk.UserVisitCampaignPK; 026 027import com.echothree.model.data.campaign.server.factory.UserVisitCampaignFactory; 028 029import com.echothree.model.data.user.common.pk.UserVisitPK; 030import com.echothree.model.data.campaign.common.pk.CampaignPK; 031import com.echothree.model.data.campaign.common.pk.CampaignSourcePK; 032import com.echothree.model.data.campaign.common.pk.CampaignMediumPK; 033import com.echothree.model.data.campaign.common.pk.CampaignTermPK; 034import com.echothree.model.data.campaign.common.pk.CampaignContentPK; 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 043public class UserVisitCampaignValue 044 extends BaseValue<UserVisitCampaignPK> 045 implements Cloneable, Serializable { 046 047 private UserVisitPK userVisitPK; 048 private boolean userVisitPKHasBeenModified = false; 049 private Integer userVisitCampaignSequence; 050 private boolean userVisitCampaignSequenceHasBeenModified = false; 051 private Long time; 052 private boolean timeHasBeenModified = false; 053 private CampaignPK campaignPK; 054 private boolean campaignPKHasBeenModified = false; 055 private CampaignSourcePK campaignSourcePK; 056 private boolean campaignSourcePKHasBeenModified = false; 057 private CampaignMediumPK campaignMediumPK; 058 private boolean campaignMediumPKHasBeenModified = false; 059 private CampaignTermPK campaignTermPK; 060 private boolean campaignTermPKHasBeenModified = false; 061 private CampaignContentPK campaignContentPK; 062 private boolean campaignContentPKHasBeenModified = false; 063 private Long fromTime; 064 private boolean fromTimeHasBeenModified = false; 065 private Long thruTime; 066 private boolean thruTimeHasBeenModified = false; 067 068 private transient Integer _hashCode = null; 069 private transient String _stringValue = null; 070 071 private void constructFields(UserVisitPK userVisitPK, Integer userVisitCampaignSequence, Long time, CampaignPK campaignPK, CampaignSourcePK campaignSourcePK, CampaignMediumPK campaignMediumPK, CampaignTermPK campaignTermPK, CampaignContentPK campaignContentPK, Long fromTime, Long thruTime) 072 throws PersistenceNotNullException { 073 checkForNull(userVisitPK); 074 this.userVisitPK = userVisitPK; 075 checkForNull(userVisitCampaignSequence); 076 this.userVisitCampaignSequence = userVisitCampaignSequence; 077 checkForNull(time); 078 this.time = time; 079 this.campaignPK = campaignPK; 080 this.campaignSourcePK = campaignSourcePK; 081 this.campaignMediumPK = campaignMediumPK; 082 this.campaignTermPK = campaignTermPK; 083 this.campaignContentPK = campaignContentPK; 084 checkForNull(fromTime); 085 this.fromTime = fromTime; 086 checkForNull(thruTime); 087 this.thruTime = thruTime; 088 } 089 090 /** Creates a new instance of UserVisitCampaignValue */ 091 public UserVisitCampaignValue(UserVisitCampaignPK userVisitCampaignPK, UserVisitPK userVisitPK, Integer userVisitCampaignSequence, Long time, CampaignPK campaignPK, CampaignSourcePK campaignSourcePK, CampaignMediumPK campaignMediumPK, CampaignTermPK campaignTermPK, CampaignContentPK campaignContentPK, Long fromTime, Long thruTime) 092 throws PersistenceNotNullException { 093 super(userVisitCampaignPK); 094 constructFields(userVisitPK, userVisitCampaignSequence, time, campaignPK, campaignSourcePK, campaignMediumPK, campaignTermPK, campaignContentPK, fromTime, thruTime); 095 } 096 097 /** Creates a new instance of UserVisitCampaignValue */ 098 public UserVisitCampaignValue(UserVisitPK userVisitPK, Integer userVisitCampaignSequence, Long time, CampaignPK campaignPK, CampaignSourcePK campaignSourcePK, CampaignMediumPK campaignMediumPK, CampaignTermPK campaignTermPK, CampaignContentPK campaignContentPK, Long fromTime, Long thruTime) 099 throws PersistenceNotNullException { 100 super(); 101 constructFields(userVisitPK, userVisitCampaignSequence, time, campaignPK, campaignSourcePK, campaignMediumPK, campaignTermPK, campaignContentPK, fromTime, thruTime); 102 } 103 104 @Override 105 public UserVisitCampaignFactory getBaseFactoryInstance() { 106 return UserVisitCampaignFactory.getInstance(); 107 } 108 109 @Override 110 public UserVisitCampaignValue clone() { 111 Object result; 112 113 try { 114 result = super.clone(); 115 } catch (CloneNotSupportedException cnse) { 116 // This shouldn't happen, fail when it does. 117 throw new PersistenceCloneException(cnse); 118 } 119 120 return (UserVisitCampaignValue)result; 121 } 122 123 @Override 124 public UserVisitCampaignPK getPrimaryKey() { 125 if(_primaryKey == null) { 126 _primaryKey = new UserVisitCampaignPK(entityId); 127 } 128 129 return _primaryKey; 130 } 131 132 private void clearHashAndString() { 133 _hashCode = null; 134 _stringValue = null; 135 } 136 137 @Override 138 public int hashCode() { 139 if(_hashCode == null) { 140 int hashCode = 17; 141 142 hashCode = 37 * hashCode + ((entityId != null) ? entityId.hashCode() : 0); 143 144 hashCode = 37 * hashCode + ((userVisitPK != null) ? userVisitPK.hashCode() : 0); 145 hashCode = 37 * hashCode + ((userVisitCampaignSequence != null) ? userVisitCampaignSequence.hashCode() : 0); 146 hashCode = 37 * hashCode + ((time != null) ? time.hashCode() : 0); 147 hashCode = 37 * hashCode + ((campaignPK != null) ? campaignPK.hashCode() : 0); 148 hashCode = 37 * hashCode + ((campaignSourcePK != null) ? campaignSourcePK.hashCode() : 0); 149 hashCode = 37 * hashCode + ((campaignMediumPK != null) ? campaignMediumPK.hashCode() : 0); 150 hashCode = 37 * hashCode + ((campaignTermPK != null) ? campaignTermPK.hashCode() : 0); 151 hashCode = 37 * hashCode + ((campaignContentPK != null) ? campaignContentPK.hashCode() : 0); 152 hashCode = 37 * hashCode + ((fromTime != null) ? fromTime.hashCode() : 0); 153 hashCode = 37 * hashCode + ((thruTime != null) ? thruTime.hashCode() : 0); 154 155 _hashCode = hashCode; 156 } 157 158 return _hashCode; 159 } 160 161 @Override 162 public String toString() { 163 if(_stringValue == null) { 164 _stringValue = "{" + 165 "entityId=" + getEntityId() + 166 ", userVisitPK=" + getUserVisitPK() + 167 ", userVisitCampaignSequence=" + getUserVisitCampaignSequence() + 168 ", time=" + getTime() + 169 ", campaignPK=" + getCampaignPK() + 170 ", campaignSourcePK=" + getCampaignSourcePK() + 171 ", campaignMediumPK=" + getCampaignMediumPK() + 172 ", campaignTermPK=" + getCampaignTermPK() + 173 ", campaignContentPK=" + getCampaignContentPK() + 174 ", fromTime=" + getFromTime() + 175 ", thruTime=" + getThruTime() + 176 "}"; 177 } 178 return _stringValue; 179 } 180 181 @Override 182 public boolean equals(Object other) { 183 if(this == other) 184 return true; 185 186 if(!hasIdentity()) 187 return false; 188 189 if(other instanceof UserVisitCampaignValue that) { 190 if(!that.hasIdentity()) 191 return false; 192 193 Long thisEntityId = getEntityId(); 194 Long thatEntityId = that.getEntityId(); 195 196 boolean objectsEqual = thisEntityId.equals(thatEntityId); 197 if(objectsEqual) 198 objectsEqual = isIdentical(that); 199 200 return objectsEqual; 201 } else { 202 return false; 203 } 204 } 205 206 public boolean isIdentical(Object other) { 207 if(other instanceof UserVisitCampaignValue that) { 208 boolean objectsEqual = true; 209 210 211 if(objectsEqual) { 212 UserVisitPK thisUserVisitPK = getUserVisitPK(); 213 UserVisitPK thatUserVisitPK = that.getUserVisitPK(); 214 215 if(thisUserVisitPK == null) { 216 objectsEqual = objectsEqual && (thatUserVisitPK == null); 217 } else { 218 objectsEqual = objectsEqual && thisUserVisitPK.equals(thatUserVisitPK); 219 } 220 } 221 222 if(objectsEqual) { 223 Integer thisUserVisitCampaignSequence = getUserVisitCampaignSequence(); 224 Integer thatUserVisitCampaignSequence = that.getUserVisitCampaignSequence(); 225 226 if(thisUserVisitCampaignSequence == null) { 227 objectsEqual = objectsEqual && (thatUserVisitCampaignSequence == null); 228 } else { 229 objectsEqual = objectsEqual && thisUserVisitCampaignSequence.equals(thatUserVisitCampaignSequence); 230 } 231 } 232 233 if(objectsEqual) { 234 Long thisTime = getTime(); 235 Long thatTime = that.getTime(); 236 237 if(thisTime == null) { 238 objectsEqual = objectsEqual && (thatTime == null); 239 } else { 240 objectsEqual = objectsEqual && thisTime.equals(thatTime); 241 } 242 } 243 244 if(objectsEqual) { 245 CampaignPK thisCampaignPK = getCampaignPK(); 246 CampaignPK thatCampaignPK = that.getCampaignPK(); 247 248 if(thisCampaignPK == null) { 249 objectsEqual = objectsEqual && (thatCampaignPK == null); 250 } else { 251 objectsEqual = objectsEqual && thisCampaignPK.equals(thatCampaignPK); 252 } 253 } 254 255 if(objectsEqual) { 256 CampaignSourcePK thisCampaignSourcePK = getCampaignSourcePK(); 257 CampaignSourcePK thatCampaignSourcePK = that.getCampaignSourcePK(); 258 259 if(thisCampaignSourcePK == null) { 260 objectsEqual = objectsEqual && (thatCampaignSourcePK == null); 261 } else { 262 objectsEqual = objectsEqual && thisCampaignSourcePK.equals(thatCampaignSourcePK); 263 } 264 } 265 266 if(objectsEqual) { 267 CampaignMediumPK thisCampaignMediumPK = getCampaignMediumPK(); 268 CampaignMediumPK thatCampaignMediumPK = that.getCampaignMediumPK(); 269 270 if(thisCampaignMediumPK == null) { 271 objectsEqual = objectsEqual && (thatCampaignMediumPK == null); 272 } else { 273 objectsEqual = objectsEqual && thisCampaignMediumPK.equals(thatCampaignMediumPK); 274 } 275 } 276 277 if(objectsEqual) { 278 CampaignTermPK thisCampaignTermPK = getCampaignTermPK(); 279 CampaignTermPK thatCampaignTermPK = that.getCampaignTermPK(); 280 281 if(thisCampaignTermPK == null) { 282 objectsEqual = objectsEqual && (thatCampaignTermPK == null); 283 } else { 284 objectsEqual = objectsEqual && thisCampaignTermPK.equals(thatCampaignTermPK); 285 } 286 } 287 288 if(objectsEqual) { 289 CampaignContentPK thisCampaignContentPK = getCampaignContentPK(); 290 CampaignContentPK thatCampaignContentPK = that.getCampaignContentPK(); 291 292 if(thisCampaignContentPK == null) { 293 objectsEqual = objectsEqual && (thatCampaignContentPK == null); 294 } else { 295 objectsEqual = objectsEqual && thisCampaignContentPK.equals(thatCampaignContentPK); 296 } 297 } 298 299 if(objectsEqual) { 300 Long thisFromTime = getFromTime(); 301 Long thatFromTime = that.getFromTime(); 302 303 if(thisFromTime == null) { 304 objectsEqual = objectsEqual && (thatFromTime == null); 305 } else { 306 objectsEqual = objectsEqual && thisFromTime.equals(thatFromTime); 307 } 308 } 309 310 if(objectsEqual) { 311 Long thisThruTime = getThruTime(); 312 Long thatThruTime = that.getThruTime(); 313 314 if(thisThruTime == null) { 315 objectsEqual = objectsEqual && (thatThruTime == null); 316 } else { 317 objectsEqual = objectsEqual && thisThruTime.equals(thatThruTime); 318 } 319 } 320 321 return objectsEqual; 322 } else { 323 return false; 324 } 325 } 326 327 @Override 328 public boolean hasBeenModified() { 329 return userVisitPKHasBeenModified || userVisitCampaignSequenceHasBeenModified || timeHasBeenModified || campaignPKHasBeenModified || campaignSourcePKHasBeenModified || campaignMediumPKHasBeenModified || campaignTermPKHasBeenModified || campaignContentPKHasBeenModified || fromTimeHasBeenModified || thruTimeHasBeenModified; 330 } 331 332 @Override 333 public void clearHasBeenModified() { 334 userVisitPKHasBeenModified = false; 335 userVisitCampaignSequenceHasBeenModified = false; 336 timeHasBeenModified = false; 337 campaignPKHasBeenModified = false; 338 campaignSourcePKHasBeenModified = false; 339 campaignMediumPKHasBeenModified = false; 340 campaignTermPKHasBeenModified = false; 341 campaignContentPKHasBeenModified = false; 342 fromTimeHasBeenModified = false; 343 thruTimeHasBeenModified = false; 344 } 345 346 public UserVisitPK getUserVisitPK() { 347 return userVisitPK; 348 } 349 350 public void setUserVisitPK(UserVisitPK userVisitPK) 351 throws PersistenceNotNullException { 352 checkForNull(userVisitPK); 353 354 boolean update = true; 355 356 if(this.userVisitPK != null) { 357 if(this.userVisitPK.equals(userVisitPK)) { 358 update = false; 359 } 360 } else if(userVisitPK == null) { 361 update = false; 362 } 363 364 if(update) { 365 this.userVisitPK = userVisitPK; 366 userVisitPKHasBeenModified = true; 367 clearHashAndString(); 368 } 369 } 370 371 public boolean getUserVisitPKHasBeenModified() { 372 return userVisitPKHasBeenModified; 373 } 374 375 public Integer getUserVisitCampaignSequence() { 376 return userVisitCampaignSequence; 377 } 378 379 public void setUserVisitCampaignSequence(Integer userVisitCampaignSequence) 380 throws PersistenceNotNullException { 381 checkForNull(userVisitCampaignSequence); 382 383 boolean update = true; 384 385 if(this.userVisitCampaignSequence != null) { 386 if(this.userVisitCampaignSequence.equals(userVisitCampaignSequence)) { 387 update = false; 388 } 389 } else if(userVisitCampaignSequence == null) { 390 update = false; 391 } 392 393 if(update) { 394 this.userVisitCampaignSequence = userVisitCampaignSequence; 395 userVisitCampaignSequenceHasBeenModified = true; 396 clearHashAndString(); 397 } 398 } 399 400 public boolean getUserVisitCampaignSequenceHasBeenModified() { 401 return userVisitCampaignSequenceHasBeenModified; 402 } 403 404 public Long getTime() { 405 return time; 406 } 407 408 public void setTime(Long time) 409 throws PersistenceNotNullException { 410 checkForNull(time); 411 412 boolean update = true; 413 414 if(this.time != null) { 415 if(this.time.equals(time)) { 416 update = false; 417 } 418 } else if(time == null) { 419 update = false; 420 } 421 422 if(update) { 423 this.time = time; 424 timeHasBeenModified = true; 425 clearHashAndString(); 426 } 427 } 428 429 public boolean getTimeHasBeenModified() { 430 return timeHasBeenModified; 431 } 432 433 public CampaignPK getCampaignPK() { 434 return campaignPK; 435 } 436 437 public void setCampaignPK(CampaignPK campaignPK) { 438 boolean update = true; 439 440 if(this.campaignPK != null) { 441 if(this.campaignPK.equals(campaignPK)) { 442 update = false; 443 } 444 } else if(campaignPK == null) { 445 update = false; 446 } 447 448 if(update) { 449 this.campaignPK = campaignPK; 450 campaignPKHasBeenModified = true; 451 clearHashAndString(); 452 } 453 } 454 455 public boolean getCampaignPKHasBeenModified() { 456 return campaignPKHasBeenModified; 457 } 458 459 public CampaignSourcePK getCampaignSourcePK() { 460 return campaignSourcePK; 461 } 462 463 public void setCampaignSourcePK(CampaignSourcePK campaignSourcePK) { 464 boolean update = true; 465 466 if(this.campaignSourcePK != null) { 467 if(this.campaignSourcePK.equals(campaignSourcePK)) { 468 update = false; 469 } 470 } else if(campaignSourcePK == null) { 471 update = false; 472 } 473 474 if(update) { 475 this.campaignSourcePK = campaignSourcePK; 476 campaignSourcePKHasBeenModified = true; 477 clearHashAndString(); 478 } 479 } 480 481 public boolean getCampaignSourcePKHasBeenModified() { 482 return campaignSourcePKHasBeenModified; 483 } 484 485 public CampaignMediumPK getCampaignMediumPK() { 486 return campaignMediumPK; 487 } 488 489 public void setCampaignMediumPK(CampaignMediumPK campaignMediumPK) { 490 boolean update = true; 491 492 if(this.campaignMediumPK != null) { 493 if(this.campaignMediumPK.equals(campaignMediumPK)) { 494 update = false; 495 } 496 } else if(campaignMediumPK == null) { 497 update = false; 498 } 499 500 if(update) { 501 this.campaignMediumPK = campaignMediumPK; 502 campaignMediumPKHasBeenModified = true; 503 clearHashAndString(); 504 } 505 } 506 507 public boolean getCampaignMediumPKHasBeenModified() { 508 return campaignMediumPKHasBeenModified; 509 } 510 511 public CampaignTermPK getCampaignTermPK() { 512 return campaignTermPK; 513 } 514 515 public void setCampaignTermPK(CampaignTermPK campaignTermPK) { 516 boolean update = true; 517 518 if(this.campaignTermPK != null) { 519 if(this.campaignTermPK.equals(campaignTermPK)) { 520 update = false; 521 } 522 } else if(campaignTermPK == null) { 523 update = false; 524 } 525 526 if(update) { 527 this.campaignTermPK = campaignTermPK; 528 campaignTermPKHasBeenModified = true; 529 clearHashAndString(); 530 } 531 } 532 533 public boolean getCampaignTermPKHasBeenModified() { 534 return campaignTermPKHasBeenModified; 535 } 536 537 public CampaignContentPK getCampaignContentPK() { 538 return campaignContentPK; 539 } 540 541 public void setCampaignContentPK(CampaignContentPK campaignContentPK) { 542 boolean update = true; 543 544 if(this.campaignContentPK != null) { 545 if(this.campaignContentPK.equals(campaignContentPK)) { 546 update = false; 547 } 548 } else if(campaignContentPK == null) { 549 update = false; 550 } 551 552 if(update) { 553 this.campaignContentPK = campaignContentPK; 554 campaignContentPKHasBeenModified = true; 555 clearHashAndString(); 556 } 557 } 558 559 public boolean getCampaignContentPKHasBeenModified() { 560 return campaignContentPKHasBeenModified; 561 } 562 563 public Long getFromTime() { 564 return fromTime; 565 } 566 567 public void setFromTime(Long fromTime) 568 throws PersistenceNotNullException { 569 checkForNull(fromTime); 570 571 boolean update = true; 572 573 if(this.fromTime != null) { 574 if(this.fromTime.equals(fromTime)) { 575 update = false; 576 } 577 } else if(fromTime == null) { 578 update = false; 579 } 580 581 if(update) { 582 this.fromTime = fromTime; 583 fromTimeHasBeenModified = true; 584 clearHashAndString(); 585 } 586 } 587 588 public boolean getFromTimeHasBeenModified() { 589 return fromTimeHasBeenModified; 590 } 591 592 public Long getThruTime() { 593 return thruTime; 594 } 595 596 public void setThruTime(Long thruTime) 597 throws PersistenceNotNullException { 598 checkForNull(thruTime); 599 600 boolean update = true; 601 602 if(this.thruTime != null) { 603 if(this.thruTime.equals(thruTime)) { 604 update = false; 605 } 606 } else if(thruTime == null) { 607 update = false; 608 } 609 610 if(update) { 611 this.thruTime = thruTime; 612 thruTimeHasBeenModified = true; 613 clearHashAndString(); 614 } 615 } 616 617 public boolean getThruTimeHasBeenModified() { 618 return thruTimeHasBeenModified; 619 } 620 621}