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