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 * AssociateDetail.java 021 */ 022 023package com.echothree.model.data.associate.server.entity; 024 025import com.echothree.model.data.associate.common.pk.AssociateDetailPK; 026 027import com.echothree.model.data.associate.common.pk.AssociatePK; 028import com.echothree.model.data.associate.common.pk.AssociateProgramPK; 029import com.echothree.model.data.party.common.pk.PartyPK; 030import com.echothree.model.data.core.common.pk.MimeTypePK; 031 032import com.echothree.model.data.associate.server.entity.Associate; 033import com.echothree.model.data.associate.server.entity.AssociateProgram; 034import com.echothree.model.data.party.server.entity.Party; 035import com.echothree.model.data.core.server.entity.MimeType; 036 037import com.echothree.model.data.associate.server.factory.AssociateFactory; 038import com.echothree.model.data.associate.server.factory.AssociateProgramFactory; 039import com.echothree.model.data.party.server.factory.PartyFactory; 040import com.echothree.model.data.core.server.factory.MimeTypeFactory; 041 042import com.echothree.model.data.associate.common.pk.AssociateDetailPK; 043 044import com.echothree.model.data.associate.server.value.AssociateDetailValue; 045 046import com.echothree.model.data.associate.server.factory.AssociateDetailFactory; 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 AssociateDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private AssociateDetailPK _pk; 069 private AssociateDetailValue _value; 070 071 /** Creates a new instance of AssociateDetail */ 072 public AssociateDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of AssociateDetail */ 078 public AssociateDetail(AssociateDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public AssociateDetailFactory getBaseFactoryInstance() { 087 return AssociateDetailFactory.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 AssociateDetail that) { 111 AssociateDetailValue thatValue = that.getAssociateDetailValue(); 112 return _value.equals(thatValue); 113 } else { 114 return false; 115 } 116 } 117 118 @Override 119 public void store() 120 throws PersistenceDatabaseException { 121 getBaseFactoryInstance().store(this); 122 } 123 124 @Override 125 public void remove() 126 throws PersistenceDatabaseException { 127 getBaseFactoryInstance().remove(this); 128 } 129 130 public AssociateDetailValue getAssociateDetailValue() { 131 return _value; 132 } 133 134 public void setAssociateDetailValue(AssociateDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public AssociateDetailPK getPrimaryKey() { 142 return _pk; 143 } 144 145 public AssociatePK getAssociatePK() { 146 return _value.getAssociatePK(); 147 } 148 149 public Associate getAssociate(EntityPermission entityPermission) { 150 AssociatePK pk = getAssociatePK(); 151 Associate entity = pk == null? null: AssociateFactory.getInstance().getEntityFromPK(entityPermission, pk); 152 153 return entity; 154 } 155 156 public Associate getAssociate() { 157 return getAssociate(EntityPermission.READ_ONLY); 158 } 159 160 public Associate getAssociateForUpdate() { 161 return getAssociate(EntityPermission.READ_WRITE); 162 } 163 164 public void setAssociatePK(AssociatePK associatePK) 165 throws PersistenceNotNullException, PersistenceReadOnlyException { 166 checkReadWrite(); 167 _value.setAssociatePK(associatePK); 168 } 169 170 public void setAssociate(Associate entity) { 171 setAssociatePK(entity == null? null: entity.getPrimaryKey()); 172 } 173 174 public boolean getAssociatePKHasBeenModified() { 175 return _value.getAssociatePKHasBeenModified(); 176 } 177 178 public AssociateProgramPK getAssociateProgramPK() { 179 return _value.getAssociateProgramPK(); 180 } 181 182 public AssociateProgram getAssociateProgram(EntityPermission entityPermission) { 183 return AssociateProgramFactory.getInstance().getEntityFromPK(entityPermission, getAssociateProgramPK()); 184 } 185 186 public AssociateProgram getAssociateProgram() { 187 return getAssociateProgram(EntityPermission.READ_ONLY); 188 } 189 190 public AssociateProgram getAssociateProgramForUpdate() { 191 return getAssociateProgram(EntityPermission.READ_WRITE); 192 } 193 194 public void setAssociateProgramPK(AssociateProgramPK associateProgramPK) 195 throws PersistenceNotNullException, PersistenceReadOnlyException { 196 checkReadWrite(); 197 _value.setAssociateProgramPK(associateProgramPK); 198 } 199 200 public void setAssociateProgram(AssociateProgram entity) { 201 setAssociateProgramPK(entity == null? null: entity.getPrimaryKey()); 202 } 203 204 public boolean getAssociateProgramPKHasBeenModified() { 205 return _value.getAssociateProgramPKHasBeenModified(); 206 } 207 208 public String getAssociateName() { 209 return _value.getAssociateName(); 210 } 211 212 public void setAssociateName(String associateName) 213 throws PersistenceNotNullException, PersistenceReadOnlyException { 214 checkReadWrite(); 215 _value.setAssociateName(associateName); 216 } 217 218 public boolean getAssociateNameHasBeenModified() { 219 return _value.getAssociateNameHasBeenModified(); 220 } 221 222 public PartyPK getPartyPK() { 223 return _value.getPartyPK(); 224 } 225 226 public Party getParty(EntityPermission entityPermission) { 227 return PartyFactory.getInstance().getEntityFromPK(entityPermission, getPartyPK()); 228 } 229 230 public Party getParty() { 231 return getParty(EntityPermission.READ_ONLY); 232 } 233 234 public Party getPartyForUpdate() { 235 return getParty(EntityPermission.READ_WRITE); 236 } 237 238 public void setPartyPK(PartyPK partyPK) 239 throws PersistenceNotNullException, PersistenceReadOnlyException { 240 checkReadWrite(); 241 _value.setPartyPK(partyPK); 242 } 243 244 public void setParty(Party entity) { 245 setPartyPK(entity == null? null: entity.getPrimaryKey()); 246 } 247 248 public boolean getPartyPKHasBeenModified() { 249 return _value.getPartyPKHasBeenModified(); 250 } 251 252 public String getDescription() { 253 return _value.getDescription(); 254 } 255 256 public void setDescription(String description) 257 throws PersistenceNotNullException, PersistenceReadOnlyException { 258 checkReadWrite(); 259 _value.setDescription(description); 260 } 261 262 public boolean getDescriptionHasBeenModified() { 263 return _value.getDescriptionHasBeenModified(); 264 } 265 266 public MimeTypePK getSummaryMimeTypePK() { 267 return _value.getSummaryMimeTypePK(); 268 } 269 270 public MimeType getSummaryMimeType(EntityPermission entityPermission) { 271 return MimeTypeFactory.getInstance().getEntityFromPK(entityPermission, getSummaryMimeTypePK()); 272 } 273 274 public MimeType getSummaryMimeType() { 275 return getSummaryMimeType(EntityPermission.READ_ONLY); 276 } 277 278 public MimeType getSummaryMimeTypeForUpdate() { 279 return getSummaryMimeType(EntityPermission.READ_WRITE); 280 } 281 282 public void setSummaryMimeTypePK(MimeTypePK summaryMimeTypePK) 283 throws PersistenceNotNullException, PersistenceReadOnlyException { 284 checkReadWrite(); 285 _value.setSummaryMimeTypePK(summaryMimeTypePK); 286 } 287 288 public void setSummaryMimeType(MimeType entity) { 289 setSummaryMimeTypePK(entity == null? null: entity.getPrimaryKey()); 290 } 291 292 public boolean getSummaryMimeTypePKHasBeenModified() { 293 return _value.getSummaryMimeTypePKHasBeenModified(); 294 } 295 296 public String getSummary() { 297 return _value.getSummary(); 298 } 299 300 public void setSummary(String summary) 301 throws PersistenceNotNullException, PersistenceReadOnlyException { 302 checkReadWrite(); 303 _value.setSummary(summary); 304 } 305 306 public boolean getSummaryHasBeenModified() { 307 return _value.getSummaryHasBeenModified(); 308 } 309 310 public Long getFromTime() { 311 return _value.getFromTime(); 312 } 313 314 public void setFromTime(Long fromTime) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setFromTime(fromTime); 318 } 319 320 public boolean getFromTimeHasBeenModified() { 321 return _value.getFromTimeHasBeenModified(); 322 } 323 324 public Long getThruTime() { 325 return _value.getThruTime(); 326 } 327 328 public void setThruTime(Long thruTime) 329 throws PersistenceNotNullException, PersistenceReadOnlyException { 330 checkReadWrite(); 331 _value.setThruTime(thruTime); 332 } 333 334 public boolean getThruTimeHasBeenModified() { 335 return _value.getThruTimeHasBeenModified(); 336 } 337 338}