001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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) { 123 UserVisit that = (UserVisit)other; 124 125 UserVisitValue thatValue = that.getUserVisitValue(); 126 return _value.equals(thatValue); 127 } else { 128 return false; 129 } 130 } 131 132 @Override 133 public void store(Session session) 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().store(session, this); 136 } 137 138 @Override 139 public void remove(Session session) 140 throws PersistenceDatabaseException { 141 getBaseFactoryInstance().remove(session, this); 142 } 143 144 @Override 145 public void remove() 146 throws PersistenceDatabaseException { 147 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 148 } 149 150 public UserVisitValue getUserVisitValue() { 151 return _value; 152 } 153 154 public void setUserVisitValue(UserVisitValue value) 155 throws PersistenceReadOnlyException { 156 checkReadWrite(); 157 _value = value; 158 } 159 160 @Override 161 public UserVisitPK getPrimaryKey() { 162 return _pk; 163 } 164 165 public UserVisitGroupPK getUserVisitGroupPK() { 166 return _value.getUserVisitGroupPK(); 167 } 168 169 public UserVisitGroup getUserVisitGroup(Session session, EntityPermission entityPermission) { 170 UserVisitGroupPK pk = getUserVisitGroupPK(); 171 UserVisitGroup entity = pk == null? null: UserVisitGroupFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 172 173 return entity; 174 } 175 176 public UserVisitGroup getUserVisitGroup(EntityPermission entityPermission) { 177 return getUserVisitGroup(ThreadSession.currentSession(), entityPermission); 178 } 179 180 public UserVisitGroup getUserVisitGroup(Session session) { 181 return getUserVisitGroup(session, EntityPermission.READ_ONLY); 182 } 183 184 public UserVisitGroup getUserVisitGroup() { 185 return getUserVisitGroup(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 186 } 187 188 public UserVisitGroup getUserVisitGroupForUpdate(Session session) { 189 return getUserVisitGroup(session, EntityPermission.READ_WRITE); 190 } 191 192 public UserVisitGroup getUserVisitGroupForUpdate() { 193 return getUserVisitGroup(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 194 } 195 196 public void setUserVisitGroupPK(UserVisitGroupPK userVisitGroupPK) 197 throws PersistenceNotNullException, PersistenceReadOnlyException { 198 checkReadWrite(); 199 _value.setUserVisitGroupPK(userVisitGroupPK); 200 } 201 202 public void setUserVisitGroup(UserVisitGroup entity) { 203 setUserVisitGroupPK(entity == null? null: entity.getPrimaryKey()); 204 } 205 206 public boolean getUserVisitGroupPKHasBeenModified() { 207 return _value.getUserVisitGroupPKHasBeenModified(); 208 } 209 210 public UserKeyPK getUserKeyPK() { 211 return _value.getUserKeyPK(); 212 } 213 214 public UserKey getUserKey(Session session, EntityPermission entityPermission) { 215 UserKeyPK pk = getUserKeyPK(); 216 UserKey entity = pk == null? null: UserKeyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 217 218 return entity; 219 } 220 221 public UserKey getUserKey(EntityPermission entityPermission) { 222 return getUserKey(ThreadSession.currentSession(), entityPermission); 223 } 224 225 public UserKey getUserKey(Session session) { 226 return getUserKey(session, EntityPermission.READ_ONLY); 227 } 228 229 public UserKey getUserKey() { 230 return getUserKey(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 231 } 232 233 public UserKey getUserKeyForUpdate(Session session) { 234 return getUserKey(session, EntityPermission.READ_WRITE); 235 } 236 237 public UserKey getUserKeyForUpdate() { 238 return getUserKey(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 239 } 240 241 public void setUserKeyPK(UserKeyPK userKeyPK) 242 throws PersistenceNotNullException, PersistenceReadOnlyException { 243 checkReadWrite(); 244 _value.setUserKeyPK(userKeyPK); 245 } 246 247 public void setUserKey(UserKey entity) { 248 setUserKeyPK(entity == null? null: entity.getPrimaryKey()); 249 } 250 251 public boolean getUserKeyPKHasBeenModified() { 252 return _value.getUserKeyPKHasBeenModified(); 253 } 254 255 public LanguagePK getPreferredLanguagePK() { 256 return _value.getPreferredLanguagePK(); 257 } 258 259 public Language getPreferredLanguage(Session session, EntityPermission entityPermission) { 260 LanguagePK pk = getPreferredLanguagePK(); 261 Language entity = pk == null? null: LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 262 263 return entity; 264 } 265 266 public Language getPreferredLanguage(EntityPermission entityPermission) { 267 return getPreferredLanguage(ThreadSession.currentSession(), entityPermission); 268 } 269 270 public Language getPreferredLanguage(Session session) { 271 return getPreferredLanguage(session, EntityPermission.READ_ONLY); 272 } 273 274 public Language getPreferredLanguage() { 275 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 276 } 277 278 public Language getPreferredLanguageForUpdate(Session session) { 279 return getPreferredLanguage(session, EntityPermission.READ_WRITE); 280 } 281 282 public Language getPreferredLanguageForUpdate() { 283 return getPreferredLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 284 } 285 286 public void setPreferredLanguagePK(LanguagePK preferredLanguagePK) 287 throws PersistenceNotNullException, PersistenceReadOnlyException { 288 checkReadWrite(); 289 _value.setPreferredLanguagePK(preferredLanguagePK); 290 } 291 292 public void setPreferredLanguage(Language entity) { 293 setPreferredLanguagePK(entity == null? null: entity.getPrimaryKey()); 294 } 295 296 public boolean getPreferredLanguagePKHasBeenModified() { 297 return _value.getPreferredLanguagePKHasBeenModified(); 298 } 299 300 public CurrencyPK getPreferredCurrencyPK() { 301 return _value.getPreferredCurrencyPK(); 302 } 303 304 public Currency getPreferredCurrency(Session session, EntityPermission entityPermission) { 305 CurrencyPK pk = getPreferredCurrencyPK(); 306 Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 307 308 return entity; 309 } 310 311 public Currency getPreferredCurrency(EntityPermission entityPermission) { 312 return getPreferredCurrency(ThreadSession.currentSession(), entityPermission); 313 } 314 315 public Currency getPreferredCurrency(Session session) { 316 return getPreferredCurrency(session, EntityPermission.READ_ONLY); 317 } 318 319 public Currency getPreferredCurrency() { 320 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 321 } 322 323 public Currency getPreferredCurrencyForUpdate(Session session) { 324 return getPreferredCurrency(session, EntityPermission.READ_WRITE); 325 } 326 327 public Currency getPreferredCurrencyForUpdate() { 328 return getPreferredCurrency(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 329 } 330 331 public void setPreferredCurrencyPK(CurrencyPK preferredCurrencyPK) 332 throws PersistenceNotNullException, PersistenceReadOnlyException { 333 checkReadWrite(); 334 _value.setPreferredCurrencyPK(preferredCurrencyPK); 335 } 336 337 public void setPreferredCurrency(Currency entity) { 338 setPreferredCurrencyPK(entity == null? null: entity.getPrimaryKey()); 339 } 340 341 public boolean getPreferredCurrencyPKHasBeenModified() { 342 return _value.getPreferredCurrencyPKHasBeenModified(); 343 } 344 345 public TimeZonePK getPreferredTimeZonePK() { 346 return _value.getPreferredTimeZonePK(); 347 } 348 349 public TimeZone getPreferredTimeZone(Session session, EntityPermission entityPermission) { 350 TimeZonePK pk = getPreferredTimeZonePK(); 351 TimeZone entity = pk == null? null: TimeZoneFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 352 353 return entity; 354 } 355 356 public TimeZone getPreferredTimeZone(EntityPermission entityPermission) { 357 return getPreferredTimeZone(ThreadSession.currentSession(), entityPermission); 358 } 359 360 public TimeZone getPreferredTimeZone(Session session) { 361 return getPreferredTimeZone(session, EntityPermission.READ_ONLY); 362 } 363 364 public TimeZone getPreferredTimeZone() { 365 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 366 } 367 368 public TimeZone getPreferredTimeZoneForUpdate(Session session) { 369 return getPreferredTimeZone(session, EntityPermission.READ_WRITE); 370 } 371 372 public TimeZone getPreferredTimeZoneForUpdate() { 373 return getPreferredTimeZone(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 374 } 375 376 public void setPreferredTimeZonePK(TimeZonePK preferredTimeZonePK) 377 throws PersistenceNotNullException, PersistenceReadOnlyException { 378 checkReadWrite(); 379 _value.setPreferredTimeZonePK(preferredTimeZonePK); 380 } 381 382 public void setPreferredTimeZone(TimeZone entity) { 383 setPreferredTimeZonePK(entity == null? null: entity.getPrimaryKey()); 384 } 385 386 public boolean getPreferredTimeZonePKHasBeenModified() { 387 return _value.getPreferredTimeZonePKHasBeenModified(); 388 } 389 390 public DateTimeFormatPK getPreferredDateTimeFormatPK() { 391 return _value.getPreferredDateTimeFormatPK(); 392 } 393 394 public DateTimeFormat getPreferredDateTimeFormat(Session session, EntityPermission entityPermission) { 395 DateTimeFormatPK pk = getPreferredDateTimeFormatPK(); 396 DateTimeFormat entity = pk == null? null: DateTimeFormatFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 397 398 return entity; 399 } 400 401 public DateTimeFormat getPreferredDateTimeFormat(EntityPermission entityPermission) { 402 return getPreferredDateTimeFormat(ThreadSession.currentSession(), entityPermission); 403 } 404 405 public DateTimeFormat getPreferredDateTimeFormat(Session session) { 406 return getPreferredDateTimeFormat(session, EntityPermission.READ_ONLY); 407 } 408 409 public DateTimeFormat getPreferredDateTimeFormat() { 410 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 411 } 412 413 public DateTimeFormat getPreferredDateTimeFormatForUpdate(Session session) { 414 return getPreferredDateTimeFormat(session, EntityPermission.READ_WRITE); 415 } 416 417 public DateTimeFormat getPreferredDateTimeFormatForUpdate() { 418 return getPreferredDateTimeFormat(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 419 } 420 421 public void setPreferredDateTimeFormatPK(DateTimeFormatPK preferredDateTimeFormatPK) 422 throws PersistenceNotNullException, PersistenceReadOnlyException { 423 checkReadWrite(); 424 _value.setPreferredDateTimeFormatPK(preferredDateTimeFormatPK); 425 } 426 427 public void setPreferredDateTimeFormat(DateTimeFormat entity) { 428 setPreferredDateTimeFormatPK(entity == null? null: entity.getPrimaryKey()); 429 } 430 431 public boolean getPreferredDateTimeFormatPKHasBeenModified() { 432 return _value.getPreferredDateTimeFormatPKHasBeenModified(); 433 } 434 435 public Long getLastCommandTime() { 436 return _value.getLastCommandTime(); 437 } 438 439 public void setLastCommandTime(Long lastCommandTime) 440 throws PersistenceNotNullException, PersistenceReadOnlyException { 441 checkReadWrite(); 442 _value.setLastCommandTime(lastCommandTime); 443 } 444 445 public boolean getLastCommandTimeHasBeenModified() { 446 return _value.getLastCommandTimeHasBeenModified(); 447 } 448 449 public OfferUsePK getOfferUsePK() { 450 return _value.getOfferUsePK(); 451 } 452 453 public OfferUse getOfferUse(Session session, EntityPermission entityPermission) { 454 OfferUsePK pk = getOfferUsePK(); 455 OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 456 457 return entity; 458 } 459 460 public OfferUse getOfferUse(EntityPermission entityPermission) { 461 return getOfferUse(ThreadSession.currentSession(), entityPermission); 462 } 463 464 public OfferUse getOfferUse(Session session) { 465 return getOfferUse(session, EntityPermission.READ_ONLY); 466 } 467 468 public OfferUse getOfferUse() { 469 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 470 } 471 472 public OfferUse getOfferUseForUpdate(Session session) { 473 return getOfferUse(session, EntityPermission.READ_WRITE); 474 } 475 476 public OfferUse getOfferUseForUpdate() { 477 return getOfferUse(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 478 } 479 480 public void setOfferUsePK(OfferUsePK offerUsePK) 481 throws PersistenceNotNullException, PersistenceReadOnlyException { 482 checkReadWrite(); 483 _value.setOfferUsePK(offerUsePK); 484 } 485 486 public void setOfferUse(OfferUse entity) { 487 setOfferUsePK(entity == null? null: entity.getPrimaryKey()); 488 } 489 490 public boolean getOfferUsePKHasBeenModified() { 491 return _value.getOfferUsePKHasBeenModified(); 492 } 493 494 public AssociateReferralPK getAssociateReferralPK() { 495 return _value.getAssociateReferralPK(); 496 } 497 498 public AssociateReferral getAssociateReferral(Session session, EntityPermission entityPermission) { 499 AssociateReferralPK pk = getAssociateReferralPK(); 500 AssociateReferral entity = pk == null? null: AssociateReferralFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 501 502 return entity; 503 } 504 505 public AssociateReferral getAssociateReferral(EntityPermission entityPermission) { 506 return getAssociateReferral(ThreadSession.currentSession(), entityPermission); 507 } 508 509 public AssociateReferral getAssociateReferral(Session session) { 510 return getAssociateReferral(session, EntityPermission.READ_ONLY); 511 } 512 513 public AssociateReferral getAssociateReferral() { 514 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 515 } 516 517 public AssociateReferral getAssociateReferralForUpdate(Session session) { 518 return getAssociateReferral(session, EntityPermission.READ_WRITE); 519 } 520 521 public AssociateReferral getAssociateReferralForUpdate() { 522 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 523 } 524 525 public void setAssociateReferralPK(AssociateReferralPK associateReferralPK) 526 throws PersistenceNotNullException, PersistenceReadOnlyException { 527 checkReadWrite(); 528 _value.setAssociateReferralPK(associateReferralPK); 529 } 530 531 public void setAssociateReferral(AssociateReferral entity) { 532 setAssociateReferralPK(entity == null? null: entity.getPrimaryKey()); 533 } 534 535 public boolean getAssociateReferralPKHasBeenModified() { 536 return _value.getAssociateReferralPKHasBeenModified(); 537 } 538 539 public Long getRetainUntilTime() { 540 return _value.getRetainUntilTime(); 541 } 542 543 public void setRetainUntilTime(Long retainUntilTime) 544 throws PersistenceNotNullException, PersistenceReadOnlyException { 545 checkReadWrite(); 546 _value.setRetainUntilTime(retainUntilTime); 547 } 548 549 public boolean getRetainUntilTimeHasBeenModified() { 550 return _value.getRetainUntilTimeHasBeenModified(); 551 } 552 553 public Long getFromTime() { 554 return _value.getFromTime(); 555 } 556 557 public void setFromTime(Long fromTime) 558 throws PersistenceNotNullException, PersistenceReadOnlyException { 559 checkReadWrite(); 560 _value.setFromTime(fromTime); 561 } 562 563 public boolean getFromTimeHasBeenModified() { 564 return _value.getFromTimeHasBeenModified(); 565 } 566 567 public Long getThruTime() { 568 return _value.getThruTime(); 569 } 570 571 public void setThruTime(Long thruTime) 572 throws PersistenceNotNullException, PersistenceReadOnlyException { 573 checkReadWrite(); 574 _value.setThruTime(thruTime); 575 } 576 577 public boolean getThruTimeHasBeenModified() { 578 return _value.getThruTimeHasBeenModified(); 579 } 580 581}