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