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 * PartyContactListDetail.java 021 */ 022 023package com.echothree.model.data.contactlist.server.entity; 024 025import com.echothree.model.data.contactlist.common.pk.PartyContactListDetailPK; 026 027import com.echothree.model.data.contactlist.common.pk.PartyContactListPK; 028import com.echothree.model.data.party.common.pk.PartyPK; 029import com.echothree.model.data.contactlist.common.pk.ContactListPK; 030import com.echothree.model.data.contactlist.common.pk.ContactListContactMechanismPurposePK; 031 032import com.echothree.model.data.contactlist.server.entity.PartyContactList; 033import com.echothree.model.data.party.server.entity.Party; 034import com.echothree.model.data.contactlist.server.entity.ContactList; 035import com.echothree.model.data.contactlist.server.entity.ContactListContactMechanismPurpose; 036 037import com.echothree.model.data.contactlist.server.factory.PartyContactListFactory; 038import com.echothree.model.data.party.server.factory.PartyFactory; 039import com.echothree.model.data.contactlist.server.factory.ContactListFactory; 040import com.echothree.model.data.contactlist.server.factory.ContactListContactMechanismPurposeFactory; 041 042import com.echothree.model.data.contactlist.common.pk.PartyContactListDetailPK; 043 044import com.echothree.model.data.contactlist.server.value.PartyContactListDetailValue; 045 046import com.echothree.model.data.contactlist.server.factory.PartyContactListDetailFactory; 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 PartyContactListDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private PartyContactListDetailPK _pk; 069 private PartyContactListDetailValue _value; 070 071 /** Creates a new instance of PartyContactListDetail */ 072 public PartyContactListDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of PartyContactListDetail */ 078 public PartyContactListDetail(PartyContactListDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public PartyContactListDetailFactory getBaseFactoryInstance() { 087 return PartyContactListDetailFactory.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 PartyContactListDetail that) { 111 PartyContactListDetailValue thatValue = that.getPartyContactListDetailValue(); 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 PartyContactListDetailValue getPartyContactListDetailValue() { 137 return _value; 138 } 139 140 public void setPartyContactListDetailValue(PartyContactListDetailValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public PartyContactListDetailPK getPrimaryKey() { 148 return _pk; 149 } 150 151 public PartyContactListPK getPartyContactListPK() { 152 return _value.getPartyContactListPK(); 153 } 154 155 public PartyContactList getPartyContactList(Session session, EntityPermission entityPermission) { 156 return PartyContactListFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyContactListPK()); 157 } 158 159 public PartyContactList getPartyContactList(EntityPermission entityPermission) { 160 return getPartyContactList(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public PartyContactList getPartyContactList(Session session) { 164 return getPartyContactList(session, EntityPermission.READ_ONLY); 165 } 166 167 public PartyContactList getPartyContactList() { 168 return getPartyContactList(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public PartyContactList getPartyContactListForUpdate(Session session) { 172 return getPartyContactList(session, EntityPermission.READ_WRITE); 173 } 174 175 public PartyContactList getPartyContactListForUpdate() { 176 return getPartyContactList(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setPartyContactListPK(PartyContactListPK partyContactListPK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setPartyContactListPK(partyContactListPK); 183 } 184 185 public void setPartyContactList(PartyContactList entity) { 186 setPartyContactListPK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getPartyContactListPKHasBeenModified() { 190 return _value.getPartyContactListPKHasBeenModified(); 191 } 192 193 public PartyPK getPartyPK() { 194 return _value.getPartyPK(); 195 } 196 197 public Party getParty(Session session, EntityPermission entityPermission) { 198 return PartyFactory.getInstance().getEntityFromPK(session, entityPermission, getPartyPK()); 199 } 200 201 public Party getParty(EntityPermission entityPermission) { 202 return getParty(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public Party getParty(Session session) { 206 return getParty(session, EntityPermission.READ_ONLY); 207 } 208 209 public Party getParty() { 210 return getParty(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public Party getPartyForUpdate(Session session) { 214 return getParty(session, EntityPermission.READ_WRITE); 215 } 216 217 public Party getPartyForUpdate() { 218 return getParty(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setPartyPK(PartyPK partyPK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setPartyPK(partyPK); 225 } 226 227 public void setParty(Party entity) { 228 setPartyPK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getPartyPKHasBeenModified() { 232 return _value.getPartyPKHasBeenModified(); 233 } 234 235 public ContactListPK getContactListPK() { 236 return _value.getContactListPK(); 237 } 238 239 public ContactList getContactList(Session session, EntityPermission entityPermission) { 240 return ContactListFactory.getInstance().getEntityFromPK(session, entityPermission, getContactListPK()); 241 } 242 243 public ContactList getContactList(EntityPermission entityPermission) { 244 return getContactList(ThreadSession.currentSession(), entityPermission); 245 } 246 247 public ContactList getContactList(Session session) { 248 return getContactList(session, EntityPermission.READ_ONLY); 249 } 250 251 public ContactList getContactList() { 252 return getContactList(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 253 } 254 255 public ContactList getContactListForUpdate(Session session) { 256 return getContactList(session, EntityPermission.READ_WRITE); 257 } 258 259 public ContactList getContactListForUpdate() { 260 return getContactList(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 261 } 262 263 public void setContactListPK(ContactListPK contactListPK) 264 throws PersistenceNotNullException, PersistenceReadOnlyException { 265 checkReadWrite(); 266 _value.setContactListPK(contactListPK); 267 } 268 269 public void setContactList(ContactList entity) { 270 setContactListPK(entity == null? null: entity.getPrimaryKey()); 271 } 272 273 public boolean getContactListPKHasBeenModified() { 274 return _value.getContactListPKHasBeenModified(); 275 } 276 277 public ContactListContactMechanismPurposePK getPreferredContactListContactMechanismPurposePK() { 278 return _value.getPreferredContactListContactMechanismPurposePK(); 279 } 280 281 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurpose(Session session, EntityPermission entityPermission) { 282 ContactListContactMechanismPurposePK pk = getPreferredContactListContactMechanismPurposePK(); 283 ContactListContactMechanismPurpose entity = pk == null? null: ContactListContactMechanismPurposeFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 284 285 return entity; 286 } 287 288 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurpose(EntityPermission entityPermission) { 289 return getPreferredContactListContactMechanismPurpose(ThreadSession.currentSession(), entityPermission); 290 } 291 292 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurpose(Session session) { 293 return getPreferredContactListContactMechanismPurpose(session, EntityPermission.READ_ONLY); 294 } 295 296 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurpose() { 297 return getPreferredContactListContactMechanismPurpose(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 298 } 299 300 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurposeForUpdate(Session session) { 301 return getPreferredContactListContactMechanismPurpose(session, EntityPermission.READ_WRITE); 302 } 303 304 public ContactListContactMechanismPurpose getPreferredContactListContactMechanismPurposeForUpdate() { 305 return getPreferredContactListContactMechanismPurpose(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 306 } 307 308 public void setPreferredContactListContactMechanismPurposePK(ContactListContactMechanismPurposePK preferredContactListContactMechanismPurposePK) 309 throws PersistenceNotNullException, PersistenceReadOnlyException { 310 checkReadWrite(); 311 _value.setPreferredContactListContactMechanismPurposePK(preferredContactListContactMechanismPurposePK); 312 } 313 314 public void setPreferredContactListContactMechanismPurpose(ContactListContactMechanismPurpose entity) { 315 setPreferredContactListContactMechanismPurposePK(entity == null? null: entity.getPrimaryKey()); 316 } 317 318 public boolean getPreferredContactListContactMechanismPurposePKHasBeenModified() { 319 return _value.getPreferredContactListContactMechanismPurposePKHasBeenModified(); 320 } 321 322 public Long getFromTime() { 323 return _value.getFromTime(); 324 } 325 326 public void setFromTime(Long fromTime) 327 throws PersistenceNotNullException, PersistenceReadOnlyException { 328 checkReadWrite(); 329 _value.setFromTime(fromTime); 330 } 331 332 public boolean getFromTimeHasBeenModified() { 333 return _value.getFromTimeHasBeenModified(); 334 } 335 336 public Long getThruTime() { 337 return _value.getThruTime(); 338 } 339 340 public void setThruTime(Long thruTime) 341 throws PersistenceNotNullException, PersistenceReadOnlyException { 342 checkReadWrite(); 343 _value.setThruTime(thruTime); 344 } 345 346 public boolean getThruTimeHasBeenModified() { 347 return _value.getThruTimeHasBeenModified(); 348 } 349 350}