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 * AssociateProgramDetail.java 021 */ 022 023package com.echothree.model.data.associate.server.entity; 024 025import com.echothree.model.data.associate.common.pk.AssociateProgramDetailPK; 026 027import com.echothree.model.data.associate.common.pk.AssociateProgramPK; 028import com.echothree.model.data.sequence.common.pk.SequencePK; 029 030import com.echothree.model.data.associate.server.entity.AssociateProgram; 031import com.echothree.model.data.sequence.server.entity.Sequence; 032 033import com.echothree.model.data.associate.server.factory.AssociateProgramFactory; 034import com.echothree.model.data.sequence.server.factory.SequenceFactory; 035 036import com.echothree.model.data.associate.common.pk.AssociateProgramDetailPK; 037 038import com.echothree.model.data.associate.server.value.AssociateProgramDetailValue; 039 040import com.echothree.model.data.associate.server.factory.AssociateProgramDetailFactory; 041 042import com.echothree.util.common.exception.PersistenceException; 043import com.echothree.util.common.exception.PersistenceDatabaseException; 044import com.echothree.util.common.exception.PersistenceNotNullException; 045import com.echothree.util.common.exception.PersistenceReadOnlyException; 046 047import com.echothree.util.common.persistence.BasePK; 048 049import com.echothree.util.common.persistence.type.ByteArray; 050 051import com.echothree.util.server.persistence.BaseEntity; 052import com.echothree.util.server.persistence.EntityPermission; 053import com.echothree.util.server.persistence.Session; 054import com.echothree.util.server.persistence.ThreadSession; 055 056import java.io.Serializable; 057 058import javax.annotation.Nonnull; 059import javax.annotation.Nullable; 060 061public class AssociateProgramDetail 062 extends BaseEntity 063 implements Serializable { 064 065 private AssociateProgramDetailPK _pk; 066 private AssociateProgramDetailValue _value; 067 068 /** Creates a new instance of AssociateProgramDetail */ 069 public AssociateProgramDetail() 070 throws PersistenceException { 071 super(); 072 } 073 074 /** Creates a new instance of AssociateProgramDetail */ 075 public AssociateProgramDetail(AssociateProgramDetailValue value, EntityPermission entityPermission) { 076 super(entityPermission); 077 078 _value = value; 079 _pk = value.getPrimaryKey(); 080 } 081 082 @Override 083 @Nonnull 084 public AssociateProgramDetailFactory getBaseFactoryInstance() { 085 return AssociateProgramDetailFactory.getInstance(); 086 } 087 088 @Override 089 public boolean hasBeenModified() { 090 return _value.hasBeenModified(); 091 } 092 093 @Override 094 public int hashCode() { 095 return _pk.hashCode(); 096 } 097 098 @Override 099 @Nonnull 100 public String toString() { 101 return _pk.toString(); 102 } 103 104 @Override 105 public boolean equals(Object other) { 106 if(this == other) 107 return true; 108 109 if(other instanceof AssociateProgramDetail that) { 110 AssociateProgramDetailValue thatValue = that.getAssociateProgramDetailValue(); 111 return _value.equals(thatValue); 112 } else { 113 return false; 114 } 115 } 116 117 @Override 118 public void store() 119 throws PersistenceDatabaseException { 120 getBaseFactoryInstance().store(this); 121 } 122 123 @Override 124 public void remove() 125 throws PersistenceDatabaseException { 126 getBaseFactoryInstance().remove(this); 127 } 128 129 @Nonnull 130 public AssociateProgramDetailValue getAssociateProgramDetailValue() { 131 return _value; 132 } 133 134 public void setAssociateProgramDetailValue(@Nonnull AssociateProgramDetailValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 @Nonnull 142 public AssociateProgramDetailPK getPrimaryKey() { 143 return _pk; 144 } 145 146 @Nullable 147 public AssociateProgramPK getAssociateProgramPK() { 148 return _value.getAssociateProgramPK(); 149 } 150 151 @Nullable 152 public AssociateProgram getAssociateProgram(EntityPermission entityPermission) { 153 AssociateProgramPK pk = getAssociateProgramPK(); 154 AssociateProgram entity = pk == null? null: AssociateProgramFactory.getInstance().getEntityFromPK(entityPermission, pk); 155 156 return entity; 157 } 158 159 @Nullable 160 public AssociateProgram getAssociateProgram() { 161 return getAssociateProgram(EntityPermission.READ_ONLY); 162 } 163 164 @Nullable 165 public AssociateProgram getAssociateProgramForUpdate() { 166 return getAssociateProgram(EntityPermission.READ_WRITE); 167 } 168 169 public void setAssociateProgramPK(@Nullable AssociateProgramPK associateProgramPK) 170 throws PersistenceNotNullException, PersistenceReadOnlyException { 171 checkReadWrite(); 172 _value.setAssociateProgramPK(associateProgramPK); 173 } 174 175 public void setAssociateProgram(@Nullable AssociateProgram entity) { 176 setAssociateProgramPK(entity == null ? null : entity.getPrimaryKey()); 177 } 178 179 public boolean getAssociateProgramPKHasBeenModified() { 180 return _value.getAssociateProgramPKHasBeenModified(); 181 } 182 183 @Nonnull 184 public String getAssociateProgramName() { 185 return _value.getAssociateProgramName(); 186 } 187 188 public void setAssociateProgramName(@Nonnull String associateProgramName) 189 throws PersistenceNotNullException, PersistenceReadOnlyException { 190 checkReadWrite(); 191 _value.setAssociateProgramName(associateProgramName); 192 } 193 194 public boolean getAssociateProgramNameHasBeenModified() { 195 return _value.getAssociateProgramNameHasBeenModified(); 196 } 197 198 @Nullable 199 public SequencePK getAssociateSequencePK() { 200 return _value.getAssociateSequencePK(); 201 } 202 203 @Nullable 204 public Sequence getAssociateSequence(EntityPermission entityPermission) { 205 SequencePK pk = getAssociateSequencePK(); 206 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 207 208 return entity; 209 } 210 211 @Nullable 212 public Sequence getAssociateSequence() { 213 return getAssociateSequence(EntityPermission.READ_ONLY); 214 } 215 216 @Nullable 217 public Sequence getAssociateSequenceForUpdate() { 218 return getAssociateSequence(EntityPermission.READ_WRITE); 219 } 220 221 public void setAssociateSequencePK(@Nullable SequencePK associateSequencePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setAssociateSequencePK(associateSequencePK); 225 } 226 227 public void setAssociateSequence(@Nullable Sequence entity) { 228 setAssociateSequencePK(entity == null ? null : entity.getPrimaryKey()); 229 } 230 231 public boolean getAssociateSequencePKHasBeenModified() { 232 return _value.getAssociateSequencePKHasBeenModified(); 233 } 234 235 @Nullable 236 public SequencePK getAssociatePartyContactMechanismSequencePK() { 237 return _value.getAssociatePartyContactMechanismSequencePK(); 238 } 239 240 @Nullable 241 public Sequence getAssociatePartyContactMechanismSequence(EntityPermission entityPermission) { 242 SequencePK pk = getAssociatePartyContactMechanismSequencePK(); 243 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 244 245 return entity; 246 } 247 248 @Nullable 249 public Sequence getAssociatePartyContactMechanismSequence() { 250 return getAssociatePartyContactMechanismSequence(EntityPermission.READ_ONLY); 251 } 252 253 @Nullable 254 public Sequence getAssociatePartyContactMechanismSequenceForUpdate() { 255 return getAssociatePartyContactMechanismSequence(EntityPermission.READ_WRITE); 256 } 257 258 public void setAssociatePartyContactMechanismSequencePK(@Nullable SequencePK associatePartyContactMechanismSequencePK) 259 throws PersistenceNotNullException, PersistenceReadOnlyException { 260 checkReadWrite(); 261 _value.setAssociatePartyContactMechanismSequencePK(associatePartyContactMechanismSequencePK); 262 } 263 264 public void setAssociatePartyContactMechanismSequence(@Nullable Sequence entity) { 265 setAssociatePartyContactMechanismSequencePK(entity == null ? null : entity.getPrimaryKey()); 266 } 267 268 public boolean getAssociatePartyContactMechanismSequencePKHasBeenModified() { 269 return _value.getAssociatePartyContactMechanismSequencePKHasBeenModified(); 270 } 271 272 @Nullable 273 public SequencePK getAssociateReferralSequencePK() { 274 return _value.getAssociateReferralSequencePK(); 275 } 276 277 @Nullable 278 public Sequence getAssociateReferralSequence(EntityPermission entityPermission) { 279 SequencePK pk = getAssociateReferralSequencePK(); 280 Sequence entity = pk == null? null: SequenceFactory.getInstance().getEntityFromPK(entityPermission, pk); 281 282 return entity; 283 } 284 285 @Nullable 286 public Sequence getAssociateReferralSequence() { 287 return getAssociateReferralSequence(EntityPermission.READ_ONLY); 288 } 289 290 @Nullable 291 public Sequence getAssociateReferralSequenceForUpdate() { 292 return getAssociateReferralSequence(EntityPermission.READ_WRITE); 293 } 294 295 public void setAssociateReferralSequencePK(@Nullable SequencePK associateReferralSequencePK) 296 throws PersistenceNotNullException, PersistenceReadOnlyException { 297 checkReadWrite(); 298 _value.setAssociateReferralSequencePK(associateReferralSequencePK); 299 } 300 301 public void setAssociateReferralSequence(@Nullable Sequence entity) { 302 setAssociateReferralSequencePK(entity == null ? null : entity.getPrimaryKey()); 303 } 304 305 public boolean getAssociateReferralSequencePKHasBeenModified() { 306 return _value.getAssociateReferralSequencePKHasBeenModified(); 307 } 308 309 @Nullable 310 public Integer getItemIndirectSalePercent() { 311 return _value.getItemIndirectSalePercent(); 312 } 313 314 public void setItemIndirectSalePercent(@Nullable Integer itemIndirectSalePercent) 315 throws PersistenceNotNullException, PersistenceReadOnlyException { 316 checkReadWrite(); 317 _value.setItemIndirectSalePercent(itemIndirectSalePercent); 318 } 319 320 public boolean getItemIndirectSalePercentHasBeenModified() { 321 return _value.getItemIndirectSalePercentHasBeenModified(); 322 } 323 324 @Nullable 325 public Integer getItemDirectSalePercent() { 326 return _value.getItemDirectSalePercent(); 327 } 328 329 public void setItemDirectSalePercent(@Nullable Integer itemDirectSalePercent) 330 throws PersistenceNotNullException, PersistenceReadOnlyException { 331 checkReadWrite(); 332 _value.setItemDirectSalePercent(itemDirectSalePercent); 333 } 334 335 public boolean getItemDirectSalePercentHasBeenModified() { 336 return _value.getItemDirectSalePercentHasBeenModified(); 337 } 338 339 @Nonnull 340 public Boolean getIsDefault() { 341 return _value.getIsDefault(); 342 } 343 344 public void setIsDefault(@Nonnull Boolean isDefault) 345 throws PersistenceNotNullException, PersistenceReadOnlyException { 346 checkReadWrite(); 347 _value.setIsDefault(isDefault); 348 } 349 350 public boolean getIsDefaultHasBeenModified() { 351 return _value.getIsDefaultHasBeenModified(); 352 } 353 354 @Nonnull 355 public Integer getSortOrder() { 356 return _value.getSortOrder(); 357 } 358 359 public void setSortOrder(@Nonnull Integer sortOrder) 360 throws PersistenceNotNullException, PersistenceReadOnlyException { 361 checkReadWrite(); 362 _value.setSortOrder(sortOrder); 363 } 364 365 public boolean getSortOrderHasBeenModified() { 366 return _value.getSortOrderHasBeenModified(); 367 } 368 369 @Nonnull 370 public Long getFromTime() { 371 return _value.getFromTime(); 372 } 373 374 public void setFromTime(@Nonnull Long fromTime) 375 throws PersistenceNotNullException, PersistenceReadOnlyException { 376 checkReadWrite(); 377 _value.setFromTime(fromTime); 378 } 379 380 public boolean getFromTimeHasBeenModified() { 381 return _value.getFromTimeHasBeenModified(); 382 } 383 384 @Nonnull 385 public Long getThruTime() { 386 return _value.getThruTime(); 387 } 388 389 public void setThruTime(@Nonnull Long thruTime) 390 throws PersistenceNotNullException, PersistenceReadOnlyException { 391 checkReadWrite(); 392 _value.setThruTime(thruTime); 393 } 394 395 public boolean getThruTimeHasBeenModified() { 396 return _value.getThruTimeHasBeenModified(); 397 } 398 399}