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 * UserVisitCampaign.java 021 */ 022 023package com.echothree.model.data.campaign.server.entity; 024 025import com.echothree.model.data.campaign.common.pk.UserVisitCampaignPK; 026 027import com.echothree.model.data.user.common.pk.UserVisitPK; 028import com.echothree.model.data.campaign.common.pk.CampaignPK; 029import com.echothree.model.data.campaign.common.pk.CampaignSourcePK; 030import com.echothree.model.data.campaign.common.pk.CampaignMediumPK; 031import com.echothree.model.data.campaign.common.pk.CampaignTermPK; 032import com.echothree.model.data.campaign.common.pk.CampaignContentPK; 033 034import com.echothree.model.data.user.server.entity.UserVisit; 035import com.echothree.model.data.campaign.server.entity.Campaign; 036import com.echothree.model.data.campaign.server.entity.CampaignSource; 037import com.echothree.model.data.campaign.server.entity.CampaignMedium; 038import com.echothree.model.data.campaign.server.entity.CampaignTerm; 039import com.echothree.model.data.campaign.server.entity.CampaignContent; 040 041import com.echothree.model.data.user.server.factory.UserVisitFactory; 042import com.echothree.model.data.campaign.server.factory.CampaignFactory; 043import com.echothree.model.data.campaign.server.factory.CampaignSourceFactory; 044import com.echothree.model.data.campaign.server.factory.CampaignMediumFactory; 045import com.echothree.model.data.campaign.server.factory.CampaignTermFactory; 046import com.echothree.model.data.campaign.server.factory.CampaignContentFactory; 047 048import com.echothree.model.data.campaign.common.pk.UserVisitCampaignPK; 049 050import com.echothree.model.data.campaign.server.value.UserVisitCampaignValue; 051 052import com.echothree.model.data.campaign.server.factory.UserVisitCampaignFactory; 053 054import com.echothree.util.common.exception.PersistenceException; 055import com.echothree.util.common.exception.PersistenceDatabaseException; 056import com.echothree.util.common.exception.PersistenceNotNullException; 057import com.echothree.util.common.exception.PersistenceReadOnlyException; 058 059import com.echothree.util.common.persistence.BasePK; 060 061import com.echothree.util.common.persistence.type.ByteArray; 062 063import com.echothree.util.server.persistence.BaseEntity; 064import com.echothree.util.server.persistence.EntityPermission; 065import com.echothree.util.server.persistence.Session; 066import com.echothree.util.server.persistence.ThreadSession; 067 068import java.io.Serializable; 069 070public class UserVisitCampaign 071 extends BaseEntity 072 implements Serializable { 073 074 private UserVisitCampaignPK _pk; 075 private UserVisitCampaignValue _value; 076 077 /** Creates a new instance of UserVisitCampaign */ 078 public UserVisitCampaign() 079 throws PersistenceException { 080 super(); 081 } 082 083 /** Creates a new instance of UserVisitCampaign */ 084 public UserVisitCampaign(UserVisitCampaignValue value, EntityPermission entityPermission) { 085 super(entityPermission); 086 087 _value = value; 088 _pk = value.getPrimaryKey(); 089 } 090 091 @Override 092 public UserVisitCampaignFactory getBaseFactoryInstance() { 093 return UserVisitCampaignFactory.getInstance(); 094 } 095 096 @Override 097 public boolean hasBeenModified() { 098 return _value.hasBeenModified(); 099 } 100 101 @Override 102 public int hashCode() { 103 return _pk.hashCode(); 104 } 105 106 @Override 107 public String toString() { 108 return _pk.toString(); 109 } 110 111 @Override 112 public boolean equals(Object other) { 113 if(this == other) 114 return true; 115 116 if(other instanceof UserVisitCampaign that) { 117 UserVisitCampaignValue thatValue = that.getUserVisitCampaignValue(); 118 return _value.equals(thatValue); 119 } else { 120 return false; 121 } 122 } 123 124 @Override 125 public void store() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().store(this); 128 } 129 130 @Override 131 public void remove() 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().remove(this); 134 } 135 136 public UserVisitCampaignValue getUserVisitCampaignValue() { 137 return _value; 138 } 139 140 public void setUserVisitCampaignValue(UserVisitCampaignValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public UserVisitCampaignPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public UserVisitPK getUserVisitPK() { 152 return _value.getUserVisitPK(); 153 } 154 155 public UserVisit getUserVisit(EntityPermission entityPermission) { 156 return UserVisitFactory.getInstance().getEntityFromPK(entityPermission, getUserVisitPK()); 157 } 158 159 public UserVisit getUserVisit() { 160 return getUserVisit(EntityPermission.READ_ONLY); 161 } 162 163 public UserVisit getUserVisitForUpdate() { 164 return getUserVisit(EntityPermission.READ_WRITE); 165 } 166 167 public void setUserVisitPK(UserVisitPK userVisitPK) 168 throws PersistenceNotNullException, PersistenceReadOnlyException { 169 checkReadWrite(); 170 _value.setUserVisitPK(userVisitPK); 171 } 172 173 public void setUserVisit(UserVisit entity) { 174 setUserVisitPK(entity == null? null: entity.getPrimaryKey()); 175 } 176 177 public boolean getUserVisitPKHasBeenModified() { 178 return _value.getUserVisitPKHasBeenModified(); 179 } 180 181 public Integer getUserVisitCampaignSequence() { 182 return _value.getUserVisitCampaignSequence(); 183 } 184 185 public void setUserVisitCampaignSequence(Integer userVisitCampaignSequence) 186 throws PersistenceNotNullException, PersistenceReadOnlyException { 187 checkReadWrite(); 188 _value.setUserVisitCampaignSequence(userVisitCampaignSequence); 189 } 190 191 public boolean getUserVisitCampaignSequenceHasBeenModified() { 192 return _value.getUserVisitCampaignSequenceHasBeenModified(); 193 } 194 195 public Long getTime() { 196 return _value.getTime(); 197 } 198 199 public void setTime(Long time) 200 throws PersistenceNotNullException, PersistenceReadOnlyException { 201 checkReadWrite(); 202 _value.setTime(time); 203 } 204 205 public boolean getTimeHasBeenModified() { 206 return _value.getTimeHasBeenModified(); 207 } 208 209 public CampaignPK getCampaignPK() { 210 return _value.getCampaignPK(); 211 } 212 213 public Campaign getCampaign(EntityPermission entityPermission) { 214 CampaignPK pk = getCampaignPK(); 215 Campaign entity = pk == null? null: CampaignFactory.getInstance().getEntityFromPK(entityPermission, pk); 216 217 return entity; 218 } 219 220 public Campaign getCampaign() { 221 return getCampaign(EntityPermission.READ_ONLY); 222 } 223 224 public Campaign getCampaignForUpdate() { 225 return getCampaign(EntityPermission.READ_WRITE); 226 } 227 228 public void setCampaignPK(CampaignPK campaignPK) 229 throws PersistenceNotNullException, PersistenceReadOnlyException { 230 checkReadWrite(); 231 _value.setCampaignPK(campaignPK); 232 } 233 234 public void setCampaign(Campaign entity) { 235 setCampaignPK(entity == null? null: entity.getPrimaryKey()); 236 } 237 238 public boolean getCampaignPKHasBeenModified() { 239 return _value.getCampaignPKHasBeenModified(); 240 } 241 242 public CampaignSourcePK getCampaignSourcePK() { 243 return _value.getCampaignSourcePK(); 244 } 245 246 public CampaignSource getCampaignSource(EntityPermission entityPermission) { 247 CampaignSourcePK pk = getCampaignSourcePK(); 248 CampaignSource entity = pk == null? null: CampaignSourceFactory.getInstance().getEntityFromPK(entityPermission, pk); 249 250 return entity; 251 } 252 253 public CampaignSource getCampaignSource() { 254 return getCampaignSource(EntityPermission.READ_ONLY); 255 } 256 257 public CampaignSource getCampaignSourceForUpdate() { 258 return getCampaignSource(EntityPermission.READ_WRITE); 259 } 260 261 public void setCampaignSourcePK(CampaignSourcePK campaignSourcePK) 262 throws PersistenceNotNullException, PersistenceReadOnlyException { 263 checkReadWrite(); 264 _value.setCampaignSourcePK(campaignSourcePK); 265 } 266 267 public void setCampaignSource(CampaignSource entity) { 268 setCampaignSourcePK(entity == null? null: entity.getPrimaryKey()); 269 } 270 271 public boolean getCampaignSourcePKHasBeenModified() { 272 return _value.getCampaignSourcePKHasBeenModified(); 273 } 274 275 public CampaignMediumPK getCampaignMediumPK() { 276 return _value.getCampaignMediumPK(); 277 } 278 279 public CampaignMedium getCampaignMedium(EntityPermission entityPermission) { 280 CampaignMediumPK pk = getCampaignMediumPK(); 281 CampaignMedium entity = pk == null? null: CampaignMediumFactory.getInstance().getEntityFromPK(entityPermission, pk); 282 283 return entity; 284 } 285 286 public CampaignMedium getCampaignMedium() { 287 return getCampaignMedium(EntityPermission.READ_ONLY); 288 } 289 290 public CampaignMedium getCampaignMediumForUpdate() { 291 return getCampaignMedium(EntityPermission.READ_WRITE); 292 } 293 294 public void setCampaignMediumPK(CampaignMediumPK campaignMediumPK) 295 throws PersistenceNotNullException, PersistenceReadOnlyException { 296 checkReadWrite(); 297 _value.setCampaignMediumPK(campaignMediumPK); 298 } 299 300 public void setCampaignMedium(CampaignMedium entity) { 301 setCampaignMediumPK(entity == null? null: entity.getPrimaryKey()); 302 } 303 304 public boolean getCampaignMediumPKHasBeenModified() { 305 return _value.getCampaignMediumPKHasBeenModified(); 306 } 307 308 public CampaignTermPK getCampaignTermPK() { 309 return _value.getCampaignTermPK(); 310 } 311 312 public CampaignTerm getCampaignTerm(EntityPermission entityPermission) { 313 CampaignTermPK pk = getCampaignTermPK(); 314 CampaignTerm entity = pk == null? null: CampaignTermFactory.getInstance().getEntityFromPK(entityPermission, pk); 315 316 return entity; 317 } 318 319 public CampaignTerm getCampaignTerm() { 320 return getCampaignTerm(EntityPermission.READ_ONLY); 321 } 322 323 public CampaignTerm getCampaignTermForUpdate() { 324 return getCampaignTerm(EntityPermission.READ_WRITE); 325 } 326 327 public void setCampaignTermPK(CampaignTermPK campaignTermPK) 328 throws PersistenceNotNullException, PersistenceReadOnlyException { 329 checkReadWrite(); 330 _value.setCampaignTermPK(campaignTermPK); 331 } 332 333 public void setCampaignTerm(CampaignTerm entity) { 334 setCampaignTermPK(entity == null? null: entity.getPrimaryKey()); 335 } 336 337 public boolean getCampaignTermPKHasBeenModified() { 338 return _value.getCampaignTermPKHasBeenModified(); 339 } 340 341 public CampaignContentPK getCampaignContentPK() { 342 return _value.getCampaignContentPK(); 343 } 344 345 public CampaignContent getCampaignContent(EntityPermission entityPermission) { 346 CampaignContentPK pk = getCampaignContentPK(); 347 CampaignContent entity = pk == null? null: CampaignContentFactory.getInstance().getEntityFromPK(entityPermission, pk); 348 349 return entity; 350 } 351 352 public CampaignContent getCampaignContent() { 353 return getCampaignContent(EntityPermission.READ_ONLY); 354 } 355 356 public CampaignContent getCampaignContentForUpdate() { 357 return getCampaignContent(EntityPermission.READ_WRITE); 358 } 359 360 public void setCampaignContentPK(CampaignContentPK campaignContentPK) 361 throws PersistenceNotNullException, PersistenceReadOnlyException { 362 checkReadWrite(); 363 _value.setCampaignContentPK(campaignContentPK); 364 } 365 366 public void setCampaignContent(CampaignContent entity) { 367 setCampaignContentPK(entity == null? null: entity.getPrimaryKey()); 368 } 369 370 public boolean getCampaignContentPKHasBeenModified() { 371 return _value.getCampaignContentPKHasBeenModified(); 372 } 373 374 public Long getFromTime() { 375 return _value.getFromTime(); 376 } 377 378 public void setFromTime(Long fromTime) 379 throws PersistenceNotNullException, PersistenceReadOnlyException { 380 checkReadWrite(); 381 _value.setFromTime(fromTime); 382 } 383 384 public boolean getFromTimeHasBeenModified() { 385 return _value.getFromTimeHasBeenModified(); 386 } 387 388 public Long getThruTime() { 389 return _value.getThruTime(); 390 } 391 392 public void setThruTime(Long thruTime) 393 throws PersistenceNotNullException, PersistenceReadOnlyException { 394 checkReadWrite(); 395 _value.setThruTime(thruTime); 396 } 397 398 public boolean getThruTimeHasBeenModified() { 399 return _value.getThruTimeHasBeenModified(); 400 } 401 402}