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