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 * UserVisitCommand.java 021 */ 022 023package com.echothree.model.data.user.server.entity; 024 025import com.echothree.model.data.user.common.pk.UserVisitCommandPK; 026 027import com.echothree.model.data.user.common.pk.UserVisitPK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.core.common.pk.CommandPK; 030 031import com.echothree.model.data.user.server.entity.UserVisit; 032import com.echothree.model.data.party.server.entity.Party; 033import com.echothree.model.data.core.server.entity.Command; 034 035import com.echothree.model.data.user.server.factory.UserVisitFactory; 036import com.echothree.model.data.party.server.factory.PartyFactory; 037import com.echothree.model.data.core.server.factory.CommandFactory; 038 039import com.echothree.model.data.user.common.pk.UserVisitCommandPK; 040 041import com.echothree.model.data.user.server.value.UserVisitCommandValue; 042 043import com.echothree.model.data.user.server.factory.UserVisitCommandFactory; 044 045import com.echothree.util.common.exception.PersistenceException; 046import com.echothree.util.common.exception.PersistenceDatabaseException; 047import com.echothree.util.common.exception.PersistenceNotNullException; 048import com.echothree.util.common.exception.PersistenceReadOnlyException; 049 050import com.echothree.util.common.persistence.BasePK; 051 052import com.echothree.util.common.persistence.type.ByteArray; 053 054import com.echothree.util.server.persistence.BaseEntity; 055import com.echothree.util.server.persistence.EntityPermission; 056import com.echothree.util.server.persistence.Session; 057import com.echothree.util.server.persistence.ThreadSession; 058 059import java.io.Serializable; 060 061public class UserVisitCommand 062 extends BaseEntity 063 implements Serializable { 064 065 private UserVisitCommandPK _pk; 066 private UserVisitCommandValue _value; 067 068 /** Creates a new instance of UserVisitCommand */ 069 public UserVisitCommand() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of UserVisitCommand */ 075 public UserVisitCommand(UserVisitCommandValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 public UserVisitCommandFactory getBaseFactoryInstance() { 084 return UserVisitCommandFactory.getInstance(); 085 } 086 087 @Override 088 public boolean hasBeenModified() { 089 return _value.hasBeenModified(); 090 } 091 092 @Override 093 public int hashCode() { 094 return _pk.hashCode(); 095 } 096 097 @Override 098 public String toString() { 099 return _pk.toString(); 100 } 101 102 @Override 103 public boolean equals(Object other) { 104 if(this == other) 105 return true; 106 107 if(other instanceof UserVisitCommand that) { 108 UserVisitCommandValue thatValue = that.getUserVisitCommandValue(); 109 return _value.equals(thatValue); 110 } else { 111 return false; 112 } 113 } 114 115 @Override 116 public void store() 117 throws PersistenceDatabaseException { 118 getBaseFactoryInstance().store(this); 119 } 120 121 @Override 122 public void remove() 123 throws PersistenceDatabaseException { 124 getBaseFactoryInstance().remove(this); 125 } 126 127 public UserVisitCommandValue getUserVisitCommandValue() { 128 return _value; 129 } 130 131 public void setUserVisitCommandValue(UserVisitCommandValue value) 132 throws PersistenceReadOnlyException { 133 checkReadWrite(); 134 _value = value; 135 } 136 137 @Override 138 public UserVisitCommandPK getPrimaryKey() { 139 return _pk; 140 } 141 142 public UserVisitPK getUserVisitPK() { 143 return _value.getUserVisitPK(); 144 } 145 146 public UserVisit getUserVisit(EntityPermission entityPermission) { 147 return UserVisitFactory.getInstance().getEntityFromPK(entityPermission, getUserVisitPK()); 148 } 149 150 public UserVisit getUserVisit() { 151 return getUserVisit(EntityPermission.READ_ONLY); 152 } 153 154 public UserVisit getUserVisitForUpdate() { 155 return getUserVisit(EntityPermission.READ_WRITE); 156 } 157 158 public void setUserVisitPK(UserVisitPK userVisitPK) 159 throws PersistenceNotNullException, PersistenceReadOnlyException { 160 checkReadWrite(); 161 _value.setUserVisitPK(userVisitPK); 162 } 163 164 public void setUserVisit(UserVisit entity) { 165 setUserVisitPK(entity == null? null: entity.getPrimaryKey()); 166 } 167 168 public boolean getUserVisitPKHasBeenModified() { 169 return _value.getUserVisitPKHasBeenModified(); 170 } 171 172 public Integer getUserVisitCommandSequence() { 173 return _value.getUserVisitCommandSequence(); 174 } 175 176 public void setUserVisitCommandSequence(Integer userVisitCommandSequence) 177 throws PersistenceNotNullException, PersistenceReadOnlyException { 178 checkReadWrite(); 179 _value.setUserVisitCommandSequence(userVisitCommandSequence); 180 } 181 182 public boolean getUserVisitCommandSequenceHasBeenModified() { 183 return _value.getUserVisitCommandSequenceHasBeenModified(); 184 } 185 186 public PartyPK getPartyPK() { 187 return _value.getPartyPK(); 188 } 189 190 public Party getParty(EntityPermission entityPermission) { 191 PartyPK pk = getPartyPK(); 192 Party entity = pk == null? null: PartyFactory.getInstance().getEntityFromPK(entityPermission, pk); 193 194 return entity; 195 } 196 197 public Party getParty() { 198 return getParty(EntityPermission.READ_ONLY); 199 } 200 201 public Party getPartyForUpdate() { 202 return getParty(EntityPermission.READ_WRITE); 203 } 204 205 public void setPartyPK(PartyPK partyPK) 206 throws PersistenceNotNullException, PersistenceReadOnlyException { 207 checkReadWrite(); 208 _value.setPartyPK(partyPK); 209 } 210 211 public void setParty(Party entity) { 212 setPartyPK(entity == null? null: entity.getPrimaryKey()); 213 } 214 215 public boolean getPartyPKHasBeenModified() { 216 return _value.getPartyPKHasBeenModified(); 217 } 218 219 public CommandPK getCommandPK() { 220 return _value.getCommandPK(); 221 } 222 223 public Command getCommand(EntityPermission entityPermission) { 224 return CommandFactory.getInstance().getEntityFromPK(entityPermission, getCommandPK()); 225 } 226 227 public Command getCommand() { 228 return getCommand(EntityPermission.READ_ONLY); 229 } 230 231 public Command getCommandForUpdate() { 232 return getCommand(EntityPermission.READ_WRITE); 233 } 234 235 public void setCommandPK(CommandPK commandPK) 236 throws PersistenceNotNullException, PersistenceReadOnlyException { 237 checkReadWrite(); 238 _value.setCommandPK(commandPK); 239 } 240 241 public void setCommand(Command entity) { 242 setCommandPK(entity == null? null: entity.getPrimaryKey()); 243 } 244 245 public boolean getCommandPKHasBeenModified() { 246 return _value.getCommandPKHasBeenModified(); 247 } 248 249 public Long getStartTime() { 250 return _value.getStartTime(); 251 } 252 253 public void setStartTime(Long startTime) 254 throws PersistenceNotNullException, PersistenceReadOnlyException { 255 checkReadWrite(); 256 _value.setStartTime(startTime); 257 } 258 259 public boolean getStartTimeHasBeenModified() { 260 return _value.getStartTimeHasBeenModified(); 261 } 262 263 public Long getEndTime() { 264 return _value.getEndTime(); 265 } 266 267 public void setEndTime(Long endTime) 268 throws PersistenceNotNullException, PersistenceReadOnlyException { 269 checkReadWrite(); 270 _value.setEndTime(endTime); 271 } 272 273 public boolean getEndTimeHasBeenModified() { 274 return _value.getEndTimeHasBeenModified(); 275 } 276 277 public Boolean getHadSecurityErrors() { 278 return _value.getHadSecurityErrors(); 279 } 280 281 public void setHadSecurityErrors(Boolean hadSecurityErrors) 282 throws PersistenceNotNullException, PersistenceReadOnlyException { 283 checkReadWrite(); 284 _value.setHadSecurityErrors(hadSecurityErrors); 285 } 286 287 public boolean getHadSecurityErrorsHasBeenModified() { 288 return _value.getHadSecurityErrorsHasBeenModified(); 289 } 290 291 public Boolean getHadValidationErrors() { 292 return _value.getHadValidationErrors(); 293 } 294 295 public void setHadValidationErrors(Boolean hadValidationErrors) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setHadValidationErrors(hadValidationErrors); 299 } 300 301 public boolean getHadValidationErrorsHasBeenModified() { 302 return _value.getHadValidationErrorsHasBeenModified(); 303 } 304 305 public Boolean getHadExecutionErrors() { 306 return _value.getHadExecutionErrors(); 307 } 308 309 public void setHadExecutionErrors(Boolean hadExecutionErrors) 310 throws PersistenceNotNullException, PersistenceReadOnlyException { 311 checkReadWrite(); 312 _value.setHadExecutionErrors(hadExecutionErrors); 313 } 314 315 public boolean getHadExecutionErrorsHasBeenModified() { 316 return _value.getHadExecutionErrorsHasBeenModified(); 317 } 318 319}