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 * CommunicationEmailSource.java 021 */ 022 023package com.echothree.model.data.communication.server.entity; 024 025import com.echothree.model.data.communication.common.pk.CommunicationEmailSourcePK; 026 027import com.echothree.model.data.communication.common.pk.CommunicationSourcePK; 028import com.echothree.model.data.core.common.pk.ServerPK; 029import com.echothree.model.data.workeffort.common.pk.WorkEffortScopePK; 030import com.echothree.model.data.selector.common.pk.SelectorPK; 031 032import com.echothree.model.data.communication.server.entity.CommunicationSource; 033import com.echothree.model.data.core.server.entity.Server; 034import com.echothree.model.data.workeffort.server.entity.WorkEffortScope; 035import com.echothree.model.data.selector.server.entity.Selector; 036 037import com.echothree.model.data.communication.server.factory.CommunicationSourceFactory; 038import com.echothree.model.data.core.server.factory.ServerFactory; 039import com.echothree.model.data.workeffort.server.factory.WorkEffortScopeFactory; 040import com.echothree.model.data.selector.server.factory.SelectorFactory; 041 042import com.echothree.model.data.communication.common.pk.CommunicationEmailSourcePK; 043 044import com.echothree.model.data.communication.server.value.CommunicationEmailSourceValue; 045 046import com.echothree.model.data.communication.server.factory.CommunicationEmailSourceFactory; 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 CommunicationEmailSource 065 extends BaseEntity 066 implements Serializable { 067 068 private CommunicationEmailSourcePK _pk; 069 private CommunicationEmailSourceValue _value; 070 071 /** Creates a new instance of CommunicationEmailSource */ 072 public CommunicationEmailSource() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of CommunicationEmailSource */ 078 public CommunicationEmailSource(CommunicationEmailSourceValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public CommunicationEmailSourceFactory getBaseFactoryInstance() { 087 return CommunicationEmailSourceFactory.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 CommunicationEmailSource that) { 111 CommunicationEmailSourceValue thatValue = that.getCommunicationEmailSourceValue(); 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 CommunicationEmailSourceValue getCommunicationEmailSourceValue() { 137 return _value; 138 } 139 140 public void setCommunicationEmailSourceValue(CommunicationEmailSourceValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public CommunicationEmailSourcePK getPrimaryKey() { 148 return _pk; 149 } 150 151 public CommunicationSourcePK getCommunicationSourcePK() { 152 return _value.getCommunicationSourcePK(); 153 } 154 155 public CommunicationSource getCommunicationSource(Session session, EntityPermission entityPermission) { 156 return CommunicationSourceFactory.getInstance().getEntityFromPK(session, entityPermission, getCommunicationSourcePK()); 157 } 158 159 public CommunicationSource getCommunicationSource(EntityPermission entityPermission) { 160 return getCommunicationSource(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public CommunicationSource getCommunicationSource(Session session) { 164 return getCommunicationSource(session, EntityPermission.READ_ONLY); 165 } 166 167 public CommunicationSource getCommunicationSource() { 168 return getCommunicationSource(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public CommunicationSource getCommunicationSourceForUpdate(Session session) { 172 return getCommunicationSource(session, EntityPermission.READ_WRITE); 173 } 174 175 public CommunicationSource getCommunicationSourceForUpdate() { 176 return getCommunicationSource(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setCommunicationSourcePK(CommunicationSourcePK communicationSourcePK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setCommunicationSourcePK(communicationSourcePK); 183 } 184 185 public void setCommunicationSource(CommunicationSource entity) { 186 setCommunicationSourcePK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getCommunicationSourcePKHasBeenModified() { 190 return _value.getCommunicationSourcePKHasBeenModified(); 191 } 192 193 public ServerPK getServerPK() { 194 return _value.getServerPK(); 195 } 196 197 public Server getServer(Session session, EntityPermission entityPermission) { 198 return ServerFactory.getInstance().getEntityFromPK(session, entityPermission, getServerPK()); 199 } 200 201 public Server getServer(EntityPermission entityPermission) { 202 return getServer(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public Server getServer(Session session) { 206 return getServer(session, EntityPermission.READ_ONLY); 207 } 208 209 public Server getServer() { 210 return getServer(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public Server getServerForUpdate(Session session) { 214 return getServer(session, EntityPermission.READ_WRITE); 215 } 216 217 public Server getServerForUpdate() { 218 return getServer(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setServerPK(ServerPK serverPK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setServerPK(serverPK); 225 } 226 227 public void setServer(Server entity) { 228 setServerPK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getServerPKHasBeenModified() { 232 return _value.getServerPKHasBeenModified(); 233 } 234 235 public String getUsername() { 236 return _value.getUsername(); 237 } 238 239 public void setUsername(String username) 240 throws PersistenceNotNullException, PersistenceReadOnlyException { 241 checkReadWrite(); 242 _value.setUsername(username); 243 } 244 245 public boolean getUsernameHasBeenModified() { 246 return _value.getUsernameHasBeenModified(); 247 } 248 249 public String getPassword() { 250 return _value.getPassword(); 251 } 252 253 public void setPassword(String password) 254 throws PersistenceNotNullException, PersistenceReadOnlyException { 255 checkReadWrite(); 256 _value.setPassword(password); 257 } 258 259 public boolean getPasswordHasBeenModified() { 260 return _value.getPasswordHasBeenModified(); 261 } 262 263 public WorkEffortScopePK getReceiveWorkEffortScopePK() { 264 return _value.getReceiveWorkEffortScopePK(); 265 } 266 267 public WorkEffortScope getReceiveWorkEffortScope(Session session, EntityPermission entityPermission) { 268 return WorkEffortScopeFactory.getInstance().getEntityFromPK(session, entityPermission, getReceiveWorkEffortScopePK()); 269 } 270 271 public WorkEffortScope getReceiveWorkEffortScope(EntityPermission entityPermission) { 272 return getReceiveWorkEffortScope(ThreadSession.currentSession(), entityPermission); 273 } 274 275 public WorkEffortScope getReceiveWorkEffortScope(Session session) { 276 return getReceiveWorkEffortScope(session, EntityPermission.READ_ONLY); 277 } 278 279 public WorkEffortScope getReceiveWorkEffortScope() { 280 return getReceiveWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 281 } 282 283 public WorkEffortScope getReceiveWorkEffortScopeForUpdate(Session session) { 284 return getReceiveWorkEffortScope(session, EntityPermission.READ_WRITE); 285 } 286 287 public WorkEffortScope getReceiveWorkEffortScopeForUpdate() { 288 return getReceiveWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 289 } 290 291 public void setReceiveWorkEffortScopePK(WorkEffortScopePK receiveWorkEffortScopePK) 292 throws PersistenceNotNullException, PersistenceReadOnlyException { 293 checkReadWrite(); 294 _value.setReceiveWorkEffortScopePK(receiveWorkEffortScopePK); 295 } 296 297 public void setReceiveWorkEffortScope(WorkEffortScope entity) { 298 setReceiveWorkEffortScopePK(entity == null? null: entity.getPrimaryKey()); 299 } 300 301 public boolean getReceiveWorkEffortScopePKHasBeenModified() { 302 return _value.getReceiveWorkEffortScopePKHasBeenModified(); 303 } 304 305 public WorkEffortScopePK getSendWorkEffortScopePK() { 306 return _value.getSendWorkEffortScopePK(); 307 } 308 309 public WorkEffortScope getSendWorkEffortScope(Session session, EntityPermission entityPermission) { 310 return WorkEffortScopeFactory.getInstance().getEntityFromPK(session, entityPermission, getSendWorkEffortScopePK()); 311 } 312 313 public WorkEffortScope getSendWorkEffortScope(EntityPermission entityPermission) { 314 return getSendWorkEffortScope(ThreadSession.currentSession(), entityPermission); 315 } 316 317 public WorkEffortScope getSendWorkEffortScope(Session session) { 318 return getSendWorkEffortScope(session, EntityPermission.READ_ONLY); 319 } 320 321 public WorkEffortScope getSendWorkEffortScope() { 322 return getSendWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 323 } 324 325 public WorkEffortScope getSendWorkEffortScopeForUpdate(Session session) { 326 return getSendWorkEffortScope(session, EntityPermission.READ_WRITE); 327 } 328 329 public WorkEffortScope getSendWorkEffortScopeForUpdate() { 330 return getSendWorkEffortScope(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 331 } 332 333 public void setSendWorkEffortScopePK(WorkEffortScopePK sendWorkEffortScopePK) 334 throws PersistenceNotNullException, PersistenceReadOnlyException { 335 checkReadWrite(); 336 _value.setSendWorkEffortScopePK(sendWorkEffortScopePK); 337 } 338 339 public void setSendWorkEffortScope(WorkEffortScope entity) { 340 setSendWorkEffortScopePK(entity == null? null: entity.getPrimaryKey()); 341 } 342 343 public boolean getSendWorkEffortScopePKHasBeenModified() { 344 return _value.getSendWorkEffortScopePKHasBeenModified(); 345 } 346 347 public SelectorPK getReviewEmployeeSelectorPK() { 348 return _value.getReviewEmployeeSelectorPK(); 349 } 350 351 public Selector getReviewEmployeeSelector(Session session, EntityPermission entityPermission) { 352 SelectorPK pk = getReviewEmployeeSelectorPK(); 353 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 354 355 return entity; 356 } 357 358 public Selector getReviewEmployeeSelector(EntityPermission entityPermission) { 359 return getReviewEmployeeSelector(ThreadSession.currentSession(), entityPermission); 360 } 361 362 public Selector getReviewEmployeeSelector(Session session) { 363 return getReviewEmployeeSelector(session, EntityPermission.READ_ONLY); 364 } 365 366 public Selector getReviewEmployeeSelector() { 367 return getReviewEmployeeSelector(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 368 } 369 370 public Selector getReviewEmployeeSelectorForUpdate(Session session) { 371 return getReviewEmployeeSelector(session, EntityPermission.READ_WRITE); 372 } 373 374 public Selector getReviewEmployeeSelectorForUpdate() { 375 return getReviewEmployeeSelector(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 376 } 377 378 public void setReviewEmployeeSelectorPK(SelectorPK reviewEmployeeSelectorPK) 379 throws PersistenceNotNullException, PersistenceReadOnlyException { 380 checkReadWrite(); 381 _value.setReviewEmployeeSelectorPK(reviewEmployeeSelectorPK); 382 } 383 384 public void setReviewEmployeeSelector(Selector entity) { 385 setReviewEmployeeSelectorPK(entity == null? null: entity.getPrimaryKey()); 386 } 387 388 public boolean getReviewEmployeeSelectorPKHasBeenModified() { 389 return _value.getReviewEmployeeSelectorPKHasBeenModified(); 390 } 391 392 public Long getFromTime() { 393 return _value.getFromTime(); 394 } 395 396 public void setFromTime(Long fromTime) 397 throws PersistenceNotNullException, PersistenceReadOnlyException { 398 checkReadWrite(); 399 _value.setFromTime(fromTime); 400 } 401 402 public boolean getFromTimeHasBeenModified() { 403 return _value.getFromTimeHasBeenModified(); 404 } 405 406 public Long getThruTime() { 407 return _value.getThruTime(); 408 } 409 410 public void setThruTime(Long thruTime) 411 throws PersistenceNotNullException, PersistenceReadOnlyException { 412 checkReadWrite(); 413 _value.setThruTime(thruTime); 414 } 415 416 public boolean getThruTimeHasBeenModified() { 417 return _value.getThruTimeHasBeenModified(); 418 } 419 420}