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 * 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()
132            throws PersistenceDatabaseException {
133        getBaseFactoryInstance().store(this);
134    }
135    
136    @Override
137    public void remove()
138            throws PersistenceDatabaseException {
139        getBaseFactoryInstance().remove(this);
140    }
141    
142    public UserVisitValue getUserVisitValue() {
143        return _value;
144    }
145    
146    public void setUserVisitValue(UserVisitValue value)
147            throws PersistenceReadOnlyException {
148        checkReadWrite();
149        _value = value;
150    }
151    
152    @Override
153    public UserVisitPK getPrimaryKey() {
154        return _pk;
155    }
156    
157    public UserVisitGroupPK getUserVisitGroupPK() {
158        return _value.getUserVisitGroupPK();
159    }
160    
161    public UserVisitGroup getUserVisitGroup(EntityPermission entityPermission) {
162        UserVisitGroupPK pk = getUserVisitGroupPK();
163        UserVisitGroup entity = pk == null? null: UserVisitGroupFactory.getInstance().getEntityFromPK(entityPermission, pk);
164        
165        return entity;
166    }
167    
168    public UserVisitGroup getUserVisitGroup() {
169        return getUserVisitGroup(EntityPermission.READ_ONLY);
170    }
171    
172    public UserVisitGroup getUserVisitGroupForUpdate() {
173        return getUserVisitGroup(EntityPermission.READ_WRITE);
174    }
175    
176    public void setUserVisitGroupPK(UserVisitGroupPK userVisitGroupPK)
177            throws PersistenceNotNullException, PersistenceReadOnlyException {
178        checkReadWrite();
179        _value.setUserVisitGroupPK(userVisitGroupPK);
180    }
181    
182    public void setUserVisitGroup(UserVisitGroup entity) {
183        setUserVisitGroupPK(entity == null? null: entity.getPrimaryKey());
184    }
185    
186    public boolean getUserVisitGroupPKHasBeenModified() {
187        return _value.getUserVisitGroupPKHasBeenModified();
188    }
189    
190    public UserKeyPK getUserKeyPK() {
191        return _value.getUserKeyPK();
192    }
193    
194    public UserKey getUserKey(EntityPermission entityPermission) {
195        UserKeyPK pk = getUserKeyPK();
196        UserKey entity = pk == null? null: UserKeyFactory.getInstance().getEntityFromPK(entityPermission, pk);
197        
198        return entity;
199    }
200    
201    public UserKey getUserKey() {
202        return getUserKey(EntityPermission.READ_ONLY);
203    }
204    
205    public UserKey getUserKeyForUpdate() {
206        return getUserKey(EntityPermission.READ_WRITE);
207    }
208    
209    public void setUserKeyPK(UserKeyPK userKeyPK)
210            throws PersistenceNotNullException, PersistenceReadOnlyException {
211        checkReadWrite();
212        _value.setUserKeyPK(userKeyPK);
213    }
214    
215    public void setUserKey(UserKey entity) {
216        setUserKeyPK(entity == null? null: entity.getPrimaryKey());
217    }
218    
219    public boolean getUserKeyPKHasBeenModified() {
220        return _value.getUserKeyPKHasBeenModified();
221    }
222    
223    public LanguagePK getPreferredLanguagePK() {
224        return _value.getPreferredLanguagePK();
225    }
226    
227    public Language getPreferredLanguage(EntityPermission entityPermission) {
228        LanguagePK pk = getPreferredLanguagePK();
229        Language entity = pk == null? null: LanguageFactory.getInstance().getEntityFromPK(entityPermission, pk);
230        
231        return entity;
232    }
233    
234    public Language getPreferredLanguage() {
235        return getPreferredLanguage(EntityPermission.READ_ONLY);
236    }
237    
238    public Language getPreferredLanguageForUpdate() {
239        return getPreferredLanguage(EntityPermission.READ_WRITE);
240    }
241    
242    public void setPreferredLanguagePK(LanguagePK preferredLanguagePK)
243            throws PersistenceNotNullException, PersistenceReadOnlyException {
244        checkReadWrite();
245        _value.setPreferredLanguagePK(preferredLanguagePK);
246    }
247    
248    public void setPreferredLanguage(Language entity) {
249        setPreferredLanguagePK(entity == null? null: entity.getPrimaryKey());
250    }
251    
252    public boolean getPreferredLanguagePKHasBeenModified() {
253        return _value.getPreferredLanguagePKHasBeenModified();
254    }
255    
256    public CurrencyPK getPreferredCurrencyPK() {
257        return _value.getPreferredCurrencyPK();
258    }
259    
260    public Currency getPreferredCurrency(EntityPermission entityPermission) {
261        CurrencyPK pk = getPreferredCurrencyPK();
262        Currency entity = pk == null? null: CurrencyFactory.getInstance().getEntityFromPK(entityPermission, pk);
263        
264        return entity;
265    }
266    
267    public Currency getPreferredCurrency() {
268        return getPreferredCurrency(EntityPermission.READ_ONLY);
269    }
270    
271    public Currency getPreferredCurrencyForUpdate() {
272        return getPreferredCurrency(EntityPermission.READ_WRITE);
273    }
274    
275    public void setPreferredCurrencyPK(CurrencyPK preferredCurrencyPK)
276            throws PersistenceNotNullException, PersistenceReadOnlyException {
277        checkReadWrite();
278        _value.setPreferredCurrencyPK(preferredCurrencyPK);
279    }
280    
281    public void setPreferredCurrency(Currency entity) {
282        setPreferredCurrencyPK(entity == null? null: entity.getPrimaryKey());
283    }
284    
285    public boolean getPreferredCurrencyPKHasBeenModified() {
286        return _value.getPreferredCurrencyPKHasBeenModified();
287    }
288    
289    public TimeZonePK getPreferredTimeZonePK() {
290        return _value.getPreferredTimeZonePK();
291    }
292    
293    public TimeZone getPreferredTimeZone(EntityPermission entityPermission) {
294        TimeZonePK pk = getPreferredTimeZonePK();
295        TimeZone entity = pk == null? null: TimeZoneFactory.getInstance().getEntityFromPK(entityPermission, pk);
296        
297        return entity;
298    }
299    
300    public TimeZone getPreferredTimeZone() {
301        return getPreferredTimeZone(EntityPermission.READ_ONLY);
302    }
303    
304    public TimeZone getPreferredTimeZoneForUpdate() {
305        return getPreferredTimeZone(EntityPermission.READ_WRITE);
306    }
307    
308    public void setPreferredTimeZonePK(TimeZonePK preferredTimeZonePK)
309            throws PersistenceNotNullException, PersistenceReadOnlyException {
310        checkReadWrite();
311        _value.setPreferredTimeZonePK(preferredTimeZonePK);
312    }
313    
314    public void setPreferredTimeZone(TimeZone entity) {
315        setPreferredTimeZonePK(entity == null? null: entity.getPrimaryKey());
316    }
317    
318    public boolean getPreferredTimeZonePKHasBeenModified() {
319        return _value.getPreferredTimeZonePKHasBeenModified();
320    }
321    
322    public DateTimeFormatPK getPreferredDateTimeFormatPK() {
323        return _value.getPreferredDateTimeFormatPK();
324    }
325    
326    public DateTimeFormat getPreferredDateTimeFormat(EntityPermission entityPermission) {
327        DateTimeFormatPK pk = getPreferredDateTimeFormatPK();
328        DateTimeFormat entity = pk == null? null: DateTimeFormatFactory.getInstance().getEntityFromPK(entityPermission, pk);
329        
330        return entity;
331    }
332    
333    public DateTimeFormat getPreferredDateTimeFormat() {
334        return getPreferredDateTimeFormat(EntityPermission.READ_ONLY);
335    }
336    
337    public DateTimeFormat getPreferredDateTimeFormatForUpdate() {
338        return getPreferredDateTimeFormat(EntityPermission.READ_WRITE);
339    }
340    
341    public void setPreferredDateTimeFormatPK(DateTimeFormatPK preferredDateTimeFormatPK)
342            throws PersistenceNotNullException, PersistenceReadOnlyException {
343        checkReadWrite();
344        _value.setPreferredDateTimeFormatPK(preferredDateTimeFormatPK);
345    }
346    
347    public void setPreferredDateTimeFormat(DateTimeFormat entity) {
348        setPreferredDateTimeFormatPK(entity == null? null: entity.getPrimaryKey());
349    }
350    
351    public boolean getPreferredDateTimeFormatPKHasBeenModified() {
352        return _value.getPreferredDateTimeFormatPKHasBeenModified();
353    }
354    
355    public Long getLastCommandTime() {
356        return _value.getLastCommandTime();
357    }
358    
359    public void setLastCommandTime(Long lastCommandTime)
360            throws PersistenceNotNullException, PersistenceReadOnlyException {
361        checkReadWrite();
362        _value.setLastCommandTime(lastCommandTime);
363    }
364    
365    public boolean getLastCommandTimeHasBeenModified() {
366        return _value.getLastCommandTimeHasBeenModified();
367    }
368    
369    public OfferUsePK getOfferUsePK() {
370        return _value.getOfferUsePK();
371    }
372    
373    public OfferUse getOfferUse(EntityPermission entityPermission) {
374        OfferUsePK pk = getOfferUsePK();
375        OfferUse entity = pk == null? null: OfferUseFactory.getInstance().getEntityFromPK(entityPermission, pk);
376        
377        return entity;
378    }
379    
380    public OfferUse getOfferUse() {
381        return getOfferUse(EntityPermission.READ_ONLY);
382    }
383    
384    public OfferUse getOfferUseForUpdate() {
385        return getOfferUse(EntityPermission.READ_WRITE);
386    }
387    
388    public void setOfferUsePK(OfferUsePK offerUsePK)
389            throws PersistenceNotNullException, PersistenceReadOnlyException {
390        checkReadWrite();
391        _value.setOfferUsePK(offerUsePK);
392    }
393    
394    public void setOfferUse(OfferUse entity) {
395        setOfferUsePK(entity == null? null: entity.getPrimaryKey());
396    }
397    
398    public boolean getOfferUsePKHasBeenModified() {
399        return _value.getOfferUsePKHasBeenModified();
400    }
401    
402    public AssociateReferralPK getAssociateReferralPK() {
403        return _value.getAssociateReferralPK();
404    }
405    
406    public AssociateReferral getAssociateReferral(EntityPermission entityPermission) {
407        AssociateReferralPK pk = getAssociateReferralPK();
408        AssociateReferral entity = pk == null? null: AssociateReferralFactory.getInstance().getEntityFromPK(entityPermission, pk);
409        
410        return entity;
411    }
412    
413    public AssociateReferral getAssociateReferral() {
414        return getAssociateReferral(EntityPermission.READ_ONLY);
415    }
416    
417    public AssociateReferral getAssociateReferralForUpdate() {
418        return getAssociateReferral(EntityPermission.READ_WRITE);
419    }
420    
421    public void setAssociateReferralPK(AssociateReferralPK associateReferralPK)
422            throws PersistenceNotNullException, PersistenceReadOnlyException {
423        checkReadWrite();
424        _value.setAssociateReferralPK(associateReferralPK);
425    }
426    
427    public void setAssociateReferral(AssociateReferral entity) {
428        setAssociateReferralPK(entity == null? null: entity.getPrimaryKey());
429    }
430    
431    public boolean getAssociateReferralPKHasBeenModified() {
432        return _value.getAssociateReferralPKHasBeenModified();
433    }
434    
435    public Long getRetainUntilTime() {
436        return _value.getRetainUntilTime();
437    }
438    
439    public void setRetainUntilTime(Long retainUntilTime)
440            throws PersistenceNotNullException, PersistenceReadOnlyException {
441        checkReadWrite();
442        _value.setRetainUntilTime(retainUntilTime);
443    }
444    
445    public boolean getRetainUntilTimeHasBeenModified() {
446        return _value.getRetainUntilTimeHasBeenModified();
447    }
448    
449    public Long getFromTime() {
450        return _value.getFromTime();
451    }
452    
453    public void setFromTime(Long fromTime)
454            throws PersistenceNotNullException, PersistenceReadOnlyException {
455        checkReadWrite();
456        _value.setFromTime(fromTime);
457    }
458    
459    public boolean getFromTimeHasBeenModified() {
460        return _value.getFromTimeHasBeenModified();
461    }
462    
463    public Long getThruTime() {
464        return _value.getThruTime();
465    }
466    
467    public void setThruTime(Long thruTime)
468            throws PersistenceNotNullException, PersistenceReadOnlyException {
469        checkReadWrite();
470        _value.setThruTime(thruTime);
471    }
472    
473    public boolean getThruTimeHasBeenModified() {
474        return _value.getThruTimeHasBeenModified();
475    }
476    
477}