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 * UserVisit.java 021 */ 022 023package com.echothree.model.data.user.server.entity; 024 025import com.echothree.model.data.user.common.pk.UserVisitPK; 026 027import com.echothree.model.data.user.common.pk.UserVisitGroupPK; 028import com.echothree.model.data.user.common.pk.UserKeyPK; 029import com.echothree.model.data.party.common.pk.LanguagePK; 030import com.echothree.model.data.accounting.common.pk.CurrencyPK; 031import com.echothree.model.data.party.common.pk.TimeZonePK; 032import com.echothree.model.data.party.common.pk.DateTimeFormatPK; 033import com.echothree.model.data.offer.common.pk.OfferUsePK; 034import com.echothree.model.data.associate.common.pk.AssociateReferralPK; 035 036import com.echothree.model.data.user.server.entity.UserVisitGroup; 037import com.echothree.model.data.user.server.entity.UserKey; 038import com.echothree.model.data.party.server.entity.Language; 039import com.echothree.model.data.accounting.server.entity.Currency; 040import com.echothree.model.data.party.server.entity.TimeZone; 041import com.echothree.model.data.party.server.entity.DateTimeFormat; 042import com.echothree.model.data.offer.server.entity.OfferUse; 043import com.echothree.model.data.associate.server.entity.AssociateReferral; 044 045import com.echothree.model.data.user.server.factory.UserVisitGroupFactory; 046import com.echothree.model.data.user.server.factory.UserKeyFactory; 047import com.echothree.model.data.party.server.factory.LanguageFactory; 048import com.echothree.model.data.accounting.server.factory.CurrencyFactory; 049import com.echothree.model.data.party.server.factory.TimeZoneFactory; 050import com.echothree.model.data.party.server.factory.DateTimeFormatFactory; 051import com.echothree.model.data.offer.server.factory.OfferUseFactory; 052import com.echothree.model.data.associate.server.factory.AssociateReferralFactory; 053 054import com.echothree.model.data.user.common.pk.UserVisitPK; 055 056import com.echothree.model.data.user.server.value.UserVisitValue; 057 058import com.echothree.model.data.user.server.factory.UserVisitFactory; 059 060import com.echothree.util.common.exception.PersistenceException; 061import com.echothree.util.common.exception.PersistenceDatabaseException; 062import com.echothree.util.common.exception.PersistenceNotNullException; 063import com.echothree.util.common.exception.PersistenceReadOnlyException; 064 065import com.echothree.util.common.persistence.BasePK; 066 067import com.echothree.util.common.persistence.type.ByteArray; 068 069import com.echothree.util.server.persistence.BaseEntity; 070import com.echothree.util.server.persistence.EntityPermission; 071import com.echothree.util.server.persistence.Session; 072import com.echothree.util.server.persistence.ThreadSession; 073 074import java.io.Serializable; 075 076public class UserVisit 077 extends BaseEntity 078 implements Serializable { 079 080 private UserVisitPK _pk; 081 private UserVisitValue _value; 082 083 /** Creates a new instance of UserVisit */ 084 public UserVisit() 085 throws PersistenceException { 086 super(); 087 } 088 089 /** Creates a new instance of UserVisit */ 090 public UserVisit(UserVisitValue value, EntityPermission entityPermission) { 091 super(entityPermission); 092 093 _value = value; 094 _pk = value.getPrimaryKey(); 095 } 096 097 @Override 098 public UserVisitFactory getBaseFactoryInstance() { 099 return UserVisitFactory.getInstance(); 100 } 101 102 @Override 103 public boolean hasBeenModified() { 104 return _value.hasBeenModified(); 105 } 106 107 @Override 108 public int hashCode() { 109 return _pk.hashCode(); 110 } 111 112 @Override 113 public String toString() { 114 return _pk.toString(); 115 } 116 117 @Override 118 public boolean equals(Object other) { 119 if(this == other) 120 return true; 121 122 if(other instanceof UserVisit that) { 123 UserVisitValue thatValue = that.getUserVisitValue(); 124 return _value.equals(thatValue); 125 } else { 126 return false; 127 } 128 } 129 130 @Override 131 public void store(Session session) 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().store(session, this); 134 } 135 136 @Override 137 public void remove(Session session) 138 throws PersistenceDatabaseException { 139 getBaseFactoryInstance().remove(session, this); 140 } 141 142 @Override 143 public void remove() 144 throws PersistenceDatabaseException { 145 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 146 } 147 148 public UserVisitValue getUserVisitValue() { 149 return _value; 150 } 151 152 public void setUserVisitValue(UserVisitValue value) 153 throws PersistenceReadOnlyException { 154 checkReadWrite(); 155 _value = value; 156 } 157 158 @Override 159 public UserVisitPK getPrimaryKey() { 160 return _pk; 161 } 162 163 public UserVisitGroupPK getUserVisitGroupPK() { 164 return _value.getUserVisitGroupPK(); 165 } 166 167 public UserVisitGroup getUserVisitGroup(Session session, EntityPermission entityPermission) { 168 UserVisitGroupPK pk = getUserVisitGroupPK(); 169 UserVisitGroup entity = pk == null? null: UserVisitGroupFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 170 171 return entity; 172 } 173 174 public UserVisitGroup getUserVisitGroup(EntityPermission entityPermission) { 175 return getUserVisitGroup(ThreadSession.currentSession(), entityPermission); 176 } 177 178 public UserVisitGroup getUserVisitGroup(Session session) { 179 return getUserVisitGroup(session, EntityPermission.READ_ONLY); 180 } 181 182 public UserVisitGroup getUserVisitGroup() { 183 return getUserVisitGroup(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 184 } 185 186 public UserVisitGroup getUserVisitGroupForUpdate(Session session) { 187 return getUserVisitGroup(session, EntityPermission.READ_WRITE); 188 } 189 190 public UserVisitGroup getUserVisitGroupForUpdate() { 191 return getUserVisitGroup(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 192 } 193 194 public void setUserVisitGroupPK(UserVisitGroupPK userVisitGroupPK) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setUserVisitGroupPK(userVisitGroupPK); 198 } 199 200 public void setUserVisitGroup(UserVisitGroup entity) { 201 setUserVisitGroupPK(entity == null? null: entity.getPrimaryKey()); 202 } 203 204 public boolean getUserVisitGroupPKHasBeenModified() { 205 return _value.getUserVisitGroupPKHasBeenModified(); 206 } 207 208 public UserKeyPK getUserKeyPK() { 209 return _value.getUserKeyPK(); 210 } 211 212 public UserKey getUserKey(Session session, EntityPermission entityPermission) { 213 UserKeyPK pk = getUserKeyPK(); 214 UserKey entity = pk == null? null: UserKeyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 215 216 return entity; 217 } 218 219 public UserKey getUserKey(EntityPermission entityPermission) { 220 return getUserKey(ThreadSession.currentSession(), entityPermission); 221 } 222 223 public UserKey getUserKey(Session session) { 224 return getUserKey(session, EntityPermission.READ_ONLY); 225 } 226 227 public UserKey getUserKey() { 228 return getUserKey(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 229 } 230 231 public UserKey getUserKeyForUpdate(Session session) { 232 return getUserKey(session, EntityPermission.READ_WRITE); 233 } 234 235 public UserKey getUserKeyForUpdate() { 236 return getUserKey(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 237 } 238 239 public void setUserKeyPK(UserKeyPK userKeyPK) 240 throws PersistenceNotNullException, PersistenceReadOnlyException { 241 checkReadWrite(); 242 _value.setUserKeyPK(userKeyPK); 243 } 244 245 public void setUserKey(UserKey entity) { 246 setUserKeyPK(entity == null? null: entity.getPrimaryKey()); 247 } 248 249 public boolean getUserKeyPKHasBeenModified() { 250 return _value.getUserKeyPKHasBeenModified(); 251 } 252 253 public LanguagePK getPreferredLanguagePK() { 254 return _value.getPreferredLanguagePK(); 255 } 256 257 public Language getPreferredLanguage(Session session, EntityPermission entityPermission) { 258 LanguagePK pk = getPreferredLanguagePK(); 259 Language entity = pk == null? null: LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 260 261 return entity; 262 } 263 264 public Language getPreferredLanguage(EntityPermission entityPermission) { 265 return getPreferredLanguage(ThreadSession.currentSession(), entityPermission); 266 } 267 268 public Language getPreferredLanguage(Session session) { 269 return getPreferredLanguage(session, EntityPermission.READ_ONLY); 270 } 271 272 public Language getPreferredLanguage() { 273 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 274 } 275 276 public Language getPreferredLanguageForUpdate(Session session) { 277 return getPreferredLanguage(session, EntityPermission.READ_WRITE); 278 } 279 280 public Language getPreferredLanguageForUpdate() { 281 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 282 } 283 284 public void setPreferredLanguagePK(LanguagePK preferredLanguagePK) 285 throws PersistenceNotNullException, PersistenceReadOnlyException { 286 checkReadWrite(); 287 _value.setPreferredLanguagePK(preferredLanguagePK); 288 } 289 290 public void setPreferredLanguage(Language entity) { 291 setPreferredLanguagePK(entity == null? null: entity.getPrimaryKey()); 292 } 293 294 public boolean getPreferredLanguagePKHasBeenModified() { 295 return _value.getPreferredLanguagePKHasBeenModified(); 296 } 297 298 public CurrencyPK getPreferredCurrencyPK() { 299 return _value.getPreferredCurrencyPK(); 300 } 301 302 public Currency getPreferredCurrency(Session session, EntityPermission entityPermission) { 303 CurrencyPK pk = getPreferredCurrencyPK(); 304 Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 305 306 return entity; 307 } 308 309 public Currency getPreferredCurrency(EntityPermission entityPermission) { 310 return getPreferredCurrency(ThreadSession.currentSession(), entityPermission); 311 } 312 313 public Currency getPreferredCurrency(Session session) { 314 return getPreferredCurrency(session, EntityPermission.READ_ONLY); 315 } 316 317 public Currency getPreferredCurrency() { 318 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 319 } 320 321 public Currency getPreferredCurrencyForUpdate(Session session) { 322 return getPreferredCurrency(session, EntityPermission.READ_WRITE); 323 } 324 325 public Currency getPreferredCurrencyForUpdate() { 326 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 327 } 328 329 public void setPreferredCurrencyPK(CurrencyPK preferredCurrencyPK) 330 throws PersistenceNotNullException, PersistenceReadOnlyException { 331 checkReadWrite(); 332 _value.setPreferredCurrencyPK(preferredCurrencyPK); 333 } 334 335 public void setPreferredCurrency(Currency entity) { 336 setPreferredCurrencyPK(entity == null? null: entity.getPrimaryKey()); 337 } 338 339 public boolean getPreferredCurrencyPKHasBeenModified() { 340 return _value.getPreferredCurrencyPKHasBeenModified(); 341 } 342 343 public TimeZonePK getPreferredTimeZonePK() { 344 return _value.getPreferredTimeZonePK(); 345 } 346 347 public TimeZone getPreferredTimeZone(Session session, EntityPermission entityPermission) { 348 TimeZonePK pk = getPreferredTimeZonePK(); 349 TimeZone entity = pk == null? null: TimeZoneFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 350 351 return entity; 352 } 353 354 public TimeZone getPreferredTimeZone(EntityPermission entityPermission) { 355 return getPreferredTimeZone(ThreadSession.currentSession(), entityPermission); 356 } 357 358 public TimeZone getPreferredTimeZone(Session session) { 359 return getPreferredTimeZone(session, EntityPermission.READ_ONLY); 360 } 361 362 public TimeZone getPreferredTimeZone() { 363 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 364 } 365 366 public TimeZone getPreferredTimeZoneForUpdate(Session session) { 367 return getPreferredTimeZone(session, EntityPermission.READ_WRITE); 368 } 369 370 public TimeZone getPreferredTimeZoneForUpdate() { 371 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 372 } 373 374 public void setPreferredTimeZonePK(TimeZonePK preferredTimeZonePK) 375 throws PersistenceNotNullException, PersistenceReadOnlyException { 376 checkReadWrite(); 377 _value.setPreferredTimeZonePK(preferredTimeZonePK); 378 } 379 380 public void setPreferredTimeZone(TimeZone entity) { 381 setPreferredTimeZonePK(entity == null? null: entity.getPrimaryKey()); 382 } 383 384 public boolean getPreferredTimeZonePKHasBeenModified() { 385 return _value.getPreferredTimeZonePKHasBeenModified(); 386 } 387 388 public DateTimeFormatPK getPreferredDateTimeFormatPK() { 389 return _value.getPreferredDateTimeFormatPK(); 390 } 391 392 public DateTimeFormat getPreferredDateTimeFormat(Session session, EntityPermission entityPermission) { 393 DateTimeFormatPK pk = getPreferredDateTimeFormatPK(); 394 DateTimeFormat entity = pk == null? null: DateTimeFormatFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 395 396 return entity; 397 } 398 399 public DateTimeFormat getPreferredDateTimeFormat(EntityPermission entityPermission) { 400 return getPreferredDateTimeFormat(ThreadSession.currentSession(), entityPermission); 401 } 402 403 public DateTimeFormat getPreferredDateTimeFormat(Session session) { 404 return getPreferredDateTimeFormat(session, EntityPermission.READ_ONLY); 405 } 406 407 public DateTimeFormat getPreferredDateTimeFormat() { 408 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 409 } 410 411 public DateTimeFormat getPreferredDateTimeFormatForUpdate(Session session) { 412 return getPreferredDateTimeFormat(session, EntityPermission.READ_WRITE); 413 } 414 415 public DateTimeFormat getPreferredDateTimeFormatForUpdate() { 416 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 417 } 418 419 public void setPreferredDateTimeFormatPK(DateTimeFormatPK preferredDateTimeFormatPK) 420 throws PersistenceNotNullException, PersistenceReadOnlyException { 421 checkReadWrite(); 422 _value.setPreferredDateTimeFormatPK(preferredDateTimeFormatPK); 423 } 424 425 public void setPreferredDateTimeFormat(DateTimeFormat entity) { 426 setPreferredDateTimeFormatPK(entity == null? null: entity.getPrimaryKey()); 427 } 428 429 public boolean getPreferredDateTimeFormatPKHasBeenModified() { 430 return _value.getPreferredDateTimeFormatPKHasBeenModified(); 431 } 432 433 public Long getLastCommandTime() { 434 return _value.getLastCommandTime(); 435 } 436 437 public void setLastCommandTime(Long lastCommandTime) 438 throws PersistenceNotNullException, PersistenceReadOnlyException { 439 checkReadWrite(); 440 _value.setLastCommandTime(lastCommandTime); 441 } 442 443 public boolean getLastCommandTimeHasBeenModified() { 444 return _value.getLastCommandTimeHasBeenModified(); 445 } 446 447 public OfferUsePK getOfferUsePK() { 448 return _value.getOfferUsePK(); 449 } 450 451 public OfferUse getOfferUse(Session session, EntityPermission entityPermission) { 452 OfferUsePK pk = getOfferUsePK(); 453 OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 454 455 return entity; 456 } 457 458 public OfferUse getOfferUse(EntityPermission entityPermission) { 459 return getOfferUse(ThreadSession.currentSession(), entityPermission); 460 } 461 462 public OfferUse getOfferUse(Session session) { 463 return getOfferUse(session, EntityPermission.READ_ONLY); 464 } 465 466 public OfferUse getOfferUse() { 467 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 468 } 469 470 public OfferUse getOfferUseForUpdate(Session session) { 471 return getOfferUse(session, EntityPermission.READ_WRITE); 472 } 473 474 public OfferUse getOfferUseForUpdate() { 475 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 476 } 477 478 public void setOfferUsePK(OfferUsePK offerUsePK) 479 throws PersistenceNotNullException, PersistenceReadOnlyException { 480 checkReadWrite(); 481 _value.setOfferUsePK(offerUsePK); 482 } 483 484 public void setOfferUse(OfferUse entity) { 485 setOfferUsePK(entity == null? null: entity.getPrimaryKey()); 486 } 487 488 public boolean getOfferUsePKHasBeenModified() { 489 return _value.getOfferUsePKHasBeenModified(); 490 } 491 492 public AssociateReferralPK getAssociateReferralPK() { 493 return _value.getAssociateReferralPK(); 494 } 495 496 public AssociateReferral getAssociateReferral(Session session, EntityPermission entityPermission) { 497 AssociateReferralPK pk = getAssociateReferralPK(); 498 AssociateReferral entity = pk == null? null: AssociateReferralFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 499 500 return entity; 501 } 502 503 public AssociateReferral getAssociateReferral(EntityPermission entityPermission) { 504 return getAssociateReferral(ThreadSession.currentSession(), entityPermission); 505 } 506 507 public AssociateReferral getAssociateReferral(Session session) { 508 return getAssociateReferral(session, EntityPermission.READ_ONLY); 509 } 510 511 public AssociateReferral getAssociateReferral() { 512 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 513 } 514 515 public AssociateReferral getAssociateReferralForUpdate(Session session) { 516 return getAssociateReferral(session, EntityPermission.READ_WRITE); 517 } 518 519 public AssociateReferral getAssociateReferralForUpdate() { 520 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 521 } 522 523 public void setAssociateReferralPK(AssociateReferralPK associateReferralPK) 524 throws PersistenceNotNullException, PersistenceReadOnlyException { 525 checkReadWrite(); 526 _value.setAssociateReferralPK(associateReferralPK); 527 } 528 529 public void setAssociateReferral(AssociateReferral entity) { 530 setAssociateReferralPK(entity == null? null: entity.getPrimaryKey()); 531 } 532 533 public boolean getAssociateReferralPKHasBeenModified() { 534 return _value.getAssociateReferralPKHasBeenModified(); 535 } 536 537 public Long getRetainUntilTime() { 538 return _value.getRetainUntilTime(); 539 } 540 541 public void setRetainUntilTime(Long retainUntilTime) 542 throws PersistenceNotNullException, PersistenceReadOnlyException { 543 checkReadWrite(); 544 _value.setRetainUntilTime(retainUntilTime); 545 } 546 547 public boolean getRetainUntilTimeHasBeenModified() { 548 return _value.getRetainUntilTimeHasBeenModified(); 549 } 550 551 public Long getFromTime() { 552 return _value.getFromTime(); 553 } 554 555 public void setFromTime(Long fromTime) 556 throws PersistenceNotNullException, PersistenceReadOnlyException { 557 checkReadWrite(); 558 _value.setFromTime(fromTime); 559 } 560 561 public boolean getFromTimeHasBeenModified() { 562 return _value.getFromTimeHasBeenModified(); 563 } 564 565 public Long getThruTime() { 566 return _value.getThruTime(); 567 } 568 569 public void setThruTime(Long thruTime) 570 throws PersistenceNotNullException, PersistenceReadOnlyException { 571 checkReadWrite(); 572 _value.setThruTime(thruTime); 573 } 574 575 public boolean getThruTimeHasBeenModified() { 576 return _value.getThruTimeHasBeenModified(); 577 } 578 579}