001// -------------------------------------------------------------------------------- 002// Copyright 2002-2025 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 * AssociateReferralDetail.java 021 */ 022 023package com.echothree.model.data.associate.server.entity; 024 025import com.echothree.model.data.associate.common.pk.AssociateReferralDetailPK; 026 027import com.echothree.model.data.associate.common.pk.AssociateReferralPK; 028import com.echothree.model.data.associate.common.pk.AssociatePK; 029import com.echothree.model.data.associate.common.pk.AssociatePartyContactMechanismPK; 030import com.echothree.model.data.core.common.pk.EntityInstancePK; 031 032import com.echothree.model.data.associate.server.entity.AssociateReferral; 033import com.echothree.model.data.associate.server.entity.Associate; 034import com.echothree.model.data.associate.server.entity.AssociatePartyContactMechanism; 035import com.echothree.model.data.core.server.entity.EntityInstance; 036 037import com.echothree.model.data.associate.server.factory.AssociateReferralFactory; 038import com.echothree.model.data.associate.server.factory.AssociateFactory; 039import com.echothree.model.data.associate.server.factory.AssociatePartyContactMechanismFactory; 040import com.echothree.model.data.core.server.factory.EntityInstanceFactory; 041 042import com.echothree.model.data.associate.common.pk.AssociateReferralDetailPK; 043 044import com.echothree.model.data.associate.server.value.AssociateReferralDetailValue; 045 046import com.echothree.model.data.associate.server.factory.AssociateReferralDetailFactory; 047 048import com.echothree.util.common.exception.PersistenceException; 049import com.echothree.util.common.exception.PersistenceDatabaseException; 050import com.echothree.util.common.exception.PersistenceNotNullException; 051import com.echothree.util.common.exception.PersistenceReadOnlyException; 052 053import com.echothree.util.common.persistence.BasePK; 054 055import com.echothree.util.common.persistence.type.ByteArray; 056 057import com.echothree.util.server.persistence.BaseEntity; 058import com.echothree.util.server.persistence.EntityPermission; 059import com.echothree.util.server.persistence.Session; 060import com.echothree.util.server.persistence.ThreadSession; 061 062import java.io.Serializable; 063 064public class AssociateReferralDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private AssociateReferralDetailPK _pk; 069 private AssociateReferralDetailValue _value; 070 071 /** Creates a new instance of AssociateReferralDetail */ 072 public AssociateReferralDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of AssociateReferralDetail */ 078 public AssociateReferralDetail(AssociateReferralDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public AssociateReferralDetailFactory getBaseFactoryInstance() { 087 return AssociateReferralDetailFactory.getInstance(); 088 } 089 090 @Override 091 public boolean hasBeenModified() { 092 return _value.hasBeenModified(); 093 } 094 095 @Override 096 public int hashCode() { 097 return _pk.hashCode(); 098 } 099 100 @Override 101 public String toString() { 102 return _pk.toString(); 103 } 104 105 @Override 106 public boolean equals(Object other) { 107 if(this == other) 108 return true; 109 110 if(other instanceof AssociateReferralDetail that) { 111 AssociateReferralDetailValue thatValue = that.getAssociateReferralDetailValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store(Session session) 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(session, this); 122 } 123 124 @Override 125 public void remove(Session session) 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(session, this); 128 } 129 130 @Override 131 public void remove() 132 throws PersistenceDatabaseException { 133 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 134 } 135 136 public AssociateReferralDetailValue getAssociateReferralDetailValue() { 137 return _value; 138 } 139 140 public void setAssociateReferralDetailValue(AssociateReferralDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public AssociateReferralDetailPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public AssociateReferralPK getAssociateReferralPK() { 152 return _value.getAssociateReferralPK(); 153 } 154 155 public AssociateReferral getAssociateReferral(Session session, EntityPermission entityPermission) { 156 AssociateReferralPK pk = getAssociateReferralPK(); 157 AssociateReferral entity = pk == null? null: AssociateReferralFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 158 159 return entity; 160 } 161 162 public AssociateReferral getAssociateReferral(EntityPermission entityPermission) { 163 return getAssociateReferral(ThreadSession.currentSession(), entityPermission); 164 } 165 166 public AssociateReferral getAssociateReferral(Session session) { 167 return getAssociateReferral(session, EntityPermission.READ_ONLY); 168 } 169 170 public AssociateReferral getAssociateReferral() { 171 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 172 } 173 174 public AssociateReferral getAssociateReferralForUpdate(Session session) { 175 return getAssociateReferral(session, EntityPermission.READ_WRITE); 176 } 177 178 public AssociateReferral getAssociateReferralForUpdate() { 179 return getAssociateReferral(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 180 } 181 182 public void setAssociateReferralPK(AssociateReferralPK associateReferralPK) 183 throws PersistenceNotNullException, PersistenceReadOnlyException { 184 checkReadWrite(); 185 _value.setAssociateReferralPK(associateReferralPK); 186 } 187 188 public void setAssociateReferral(AssociateReferral entity) { 189 setAssociateReferralPK(entity == null? null: entity.getPrimaryKey()); 190 } 191 192 public boolean getAssociateReferralPKHasBeenModified() { 193 return _value.getAssociateReferralPKHasBeenModified(); 194 } 195 196 public String getAssociateReferralName() { 197 return _value.getAssociateReferralName(); 198 } 199 200 public void setAssociateReferralName(String associateReferralName) 201 throws PersistenceNotNullException, PersistenceReadOnlyException { 202 checkReadWrite(); 203 _value.setAssociateReferralName(associateReferralName); 204 } 205 206 public boolean getAssociateReferralNameHasBeenModified() { 207 return _value.getAssociateReferralNameHasBeenModified(); 208 } 209 210 public AssociatePK getAssociatePK() { 211 return _value.getAssociatePK(); 212 } 213 214 public Associate getAssociate(Session session, EntityPermission entityPermission) { 215 return AssociateFactory.getInstance().getEntityFromPK(session, entityPermission, getAssociatePK()); 216 } 217 218 public Associate getAssociate(EntityPermission entityPermission) { 219 return getAssociate(ThreadSession.currentSession(), entityPermission); 220 } 221 222 public Associate getAssociate(Session session) { 223 return getAssociate(session, EntityPermission.READ_ONLY); 224 } 225 226 public Associate getAssociate() { 227 return getAssociate(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 228 } 229 230 public Associate getAssociateForUpdate(Session session) { 231 return getAssociate(session, EntityPermission.READ_WRITE); 232 } 233 234 public Associate getAssociateForUpdate() { 235 return getAssociate(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 236 } 237 238 public void setAssociatePK(AssociatePK associatePK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setAssociatePK(associatePK); 242 } 243 244 public void setAssociate(Associate entity) { 245 setAssociatePK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getAssociatePKHasBeenModified() { 249 return _value.getAssociatePKHasBeenModified(); 250 } 251 252 public AssociatePartyContactMechanismPK getAssociatePartyContactMechanismPK() { 253 return _value.getAssociatePartyContactMechanismPK(); 254 } 255 256 public AssociatePartyContactMechanism getAssociatePartyContactMechanism(Session session, EntityPermission entityPermission) { 257 AssociatePartyContactMechanismPK pk = getAssociatePartyContactMechanismPK(); 258 AssociatePartyContactMechanism entity = pk == null? null: AssociatePartyContactMechanismFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 259 260 return entity; 261 } 262 263 public AssociatePartyContactMechanism getAssociatePartyContactMechanism(EntityPermission entityPermission) { 264 return getAssociatePartyContactMechanism(ThreadSession.currentSession(), entityPermission); 265 } 266 267 public AssociatePartyContactMechanism getAssociatePartyContactMechanism(Session session) { 268 return getAssociatePartyContactMechanism(session, EntityPermission.READ_ONLY); 269 } 270 271 public AssociatePartyContactMechanism getAssociatePartyContactMechanism() { 272 return getAssociatePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 273 } 274 275 public AssociatePartyContactMechanism getAssociatePartyContactMechanismForUpdate(Session session) { 276 return getAssociatePartyContactMechanism(session, EntityPermission.READ_WRITE); 277 } 278 279 public AssociatePartyContactMechanism getAssociatePartyContactMechanismForUpdate() { 280 return getAssociatePartyContactMechanism(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 281 } 282 283 public void setAssociatePartyContactMechanismPK(AssociatePartyContactMechanismPK associatePartyContactMechanismPK) 284 throws PersistenceNotNullException, PersistenceReadOnlyException { 285 checkReadWrite(); 286 _value.setAssociatePartyContactMechanismPK(associatePartyContactMechanismPK); 287 } 288 289 public void setAssociatePartyContactMechanism(AssociatePartyContactMechanism entity) { 290 setAssociatePartyContactMechanismPK(entity == null? null: entity.getPrimaryKey()); 291 } 292 293 public boolean getAssociatePartyContactMechanismPKHasBeenModified() { 294 return _value.getAssociatePartyContactMechanismPKHasBeenModified(); 295 } 296 297 public EntityInstancePK getTargetEntityInstancePK() { 298 return _value.getTargetEntityInstancePK(); 299 } 300 301 public EntityInstance getTargetEntityInstance(Session session, EntityPermission entityPermission) { 302 EntityInstancePK pk = getTargetEntityInstancePK(); 303 EntityInstance entity = pk == null? null: EntityInstanceFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 304 305 return entity; 306 } 307 308 public EntityInstance getTargetEntityInstance(EntityPermission entityPermission) { 309 return getTargetEntityInstance(ThreadSession.currentSession(), entityPermission); 310 } 311 312 public EntityInstance getTargetEntityInstance(Session session) { 313 return getTargetEntityInstance(session, EntityPermission.READ_ONLY); 314 } 315 316 public EntityInstance getTargetEntityInstance() { 317 return getTargetEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 318 } 319 320 public EntityInstance getTargetEntityInstanceForUpdate(Session session) { 321 return getTargetEntityInstance(session, EntityPermission.READ_WRITE); 322 } 323 324 public EntityInstance getTargetEntityInstanceForUpdate() { 325 return getTargetEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 326 } 327 328 public void setTargetEntityInstancePK(EntityInstancePK targetEntityInstancePK) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setTargetEntityInstancePK(targetEntityInstancePK); 332 } 333 334 public void setTargetEntityInstance(EntityInstance entity) { 335 setTargetEntityInstancePK(entity == null? null: entity.getPrimaryKey()); 336 } 337 338 public boolean getTargetEntityInstancePKHasBeenModified() { 339 return _value.getTargetEntityInstancePKHasBeenModified(); 340 } 341 342 public Long getAssociateReferralTime() { 343 return _value.getAssociateReferralTime(); 344 } 345 346 public void setAssociateReferralTime(Long associateReferralTime) 347 throws PersistenceNotNullException, PersistenceReadOnlyException { 348 checkReadWrite(); 349 _value.setAssociateReferralTime(associateReferralTime); 350 } 351 352 public boolean getAssociateReferralTimeHasBeenModified() { 353 return _value.getAssociateReferralTimeHasBeenModified(); 354 } 355 356 public Long getFromTime() { 357 return _value.getFromTime(); 358 } 359 360 public void setFromTime(Long fromTime) 361 throws PersistenceNotNullException, PersistenceReadOnlyException { 362 checkReadWrite(); 363 _value.setFromTime(fromTime); 364 } 365 366 public boolean getFromTimeHasBeenModified() { 367 return _value.getFromTimeHasBeenModified(); 368 } 369 370 public Long getThruTime() { 371 return _value.getThruTime(); 372 } 373 374 public void setThruTime(Long thruTime) 375 throws PersistenceNotNullException, PersistenceReadOnlyException { 376 checkReadWrite(); 377 _value.setThruTime(thruTime); 378 } 379 380 public boolean getThruTimeHasBeenModified() { 381 return _value.getThruTimeHasBeenModified(); 382 } 383 384}