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 * 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() 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 CommunicationEmailSourceValue getCommunicationEmailSourceValue() { 131 return _value; 132 } 133 134 public void setCommunicationEmailSourceValue(CommunicationEmailSourceValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public CommunicationEmailSourcePK getPrimaryKey() { 142 return _pk; 143 } 144 145 public CommunicationSourcePK getCommunicationSourcePK() { 146 return _value.getCommunicationSourcePK(); 147 } 148 149 public CommunicationSource getCommunicationSource(EntityPermission entityPermission) { 150 return CommunicationSourceFactory.getInstance().getEntityFromPK(entityPermission, getCommunicationSourcePK()); 151 } 152 153 public CommunicationSource getCommunicationSource() { 154 return getCommunicationSource(EntityPermission.READ_ONLY); 155 } 156 157 public CommunicationSource getCommunicationSourceForUpdate() { 158 return getCommunicationSource(EntityPermission.READ_WRITE); 159 } 160 161 public void setCommunicationSourcePK(CommunicationSourcePK communicationSourcePK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setCommunicationSourcePK(communicationSourcePK); 165 } 166 167 public void setCommunicationSource(CommunicationSource entity) { 168 setCommunicationSourcePK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getCommunicationSourcePKHasBeenModified() { 172 return _value.getCommunicationSourcePKHasBeenModified(); 173 } 174 175 public ServerPK getServerPK() { 176 return _value.getServerPK(); 177 } 178 179 public Server getServer(EntityPermission entityPermission) { 180 return ServerFactory.getInstance().getEntityFromPK(entityPermission, getServerPK()); 181 } 182 183 public Server getServer() { 184 return getServer(EntityPermission.READ_ONLY); 185 } 186 187 public Server getServerForUpdate() { 188 return getServer(EntityPermission.READ_WRITE); 189 } 190 191 public void setServerPK(ServerPK serverPK) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setServerPK(serverPK); 195 } 196 197 public void setServer(Server entity) { 198 setServerPK(entity == null? null: entity.getPrimaryKey()); 199 } 200 201 public boolean getServerPKHasBeenModified() { 202 return _value.getServerPKHasBeenModified(); 203 } 204 205 public String getUsername() { 206 return _value.getUsername(); 207 } 208 209 public void setUsername(String username) 210 throws PersistenceNotNullException, PersistenceReadOnlyException { 211 checkReadWrite(); 212 _value.setUsername(username); 213 } 214 215 public boolean getUsernameHasBeenModified() { 216 return _value.getUsernameHasBeenModified(); 217 } 218 219 public String getPassword() { 220 return _value.getPassword(); 221 } 222 223 public void setPassword(String password) 224 throws PersistenceNotNullException, PersistenceReadOnlyException { 225 checkReadWrite(); 226 _value.setPassword(password); 227 } 228 229 public boolean getPasswordHasBeenModified() { 230 return _value.getPasswordHasBeenModified(); 231 } 232 233 public WorkEffortScopePK getReceiveWorkEffortScopePK() { 234 return _value.getReceiveWorkEffortScopePK(); 235 } 236 237 public WorkEffortScope getReceiveWorkEffortScope(EntityPermission entityPermission) { 238 return WorkEffortScopeFactory.getInstance().getEntityFromPK(entityPermission, getReceiveWorkEffortScopePK()); 239 } 240 241 public WorkEffortScope getReceiveWorkEffortScope() { 242 return getReceiveWorkEffortScope(EntityPermission.READ_ONLY); 243 } 244 245 public WorkEffortScope getReceiveWorkEffortScopeForUpdate() { 246 return getReceiveWorkEffortScope(EntityPermission.READ_WRITE); 247 } 248 249 public void setReceiveWorkEffortScopePK(WorkEffortScopePK receiveWorkEffortScopePK) 250 throws PersistenceNotNullException, PersistenceReadOnlyException { 251 checkReadWrite(); 252 _value.setReceiveWorkEffortScopePK(receiveWorkEffortScopePK); 253 } 254 255 public void setReceiveWorkEffortScope(WorkEffortScope entity) { 256 setReceiveWorkEffortScopePK(entity == null? null: entity.getPrimaryKey()); 257 } 258 259 public boolean getReceiveWorkEffortScopePKHasBeenModified() { 260 return _value.getReceiveWorkEffortScopePKHasBeenModified(); 261 } 262 263 public WorkEffortScopePK getSendWorkEffortScopePK() { 264 return _value.getSendWorkEffortScopePK(); 265 } 266 267 public WorkEffortScope getSendWorkEffortScope(EntityPermission entityPermission) { 268 return WorkEffortScopeFactory.getInstance().getEntityFromPK(entityPermission, getSendWorkEffortScopePK()); 269 } 270 271 public WorkEffortScope getSendWorkEffortScope() { 272 return getSendWorkEffortScope(EntityPermission.READ_ONLY); 273 } 274 275 public WorkEffortScope getSendWorkEffortScopeForUpdate() { 276 return getSendWorkEffortScope(EntityPermission.READ_WRITE); 277 } 278 279 public void setSendWorkEffortScopePK(WorkEffortScopePK sendWorkEffortScopePK) 280 throws PersistenceNotNullException, PersistenceReadOnlyException { 281 checkReadWrite(); 282 _value.setSendWorkEffortScopePK(sendWorkEffortScopePK); 283 } 284 285 public void setSendWorkEffortScope(WorkEffortScope entity) { 286 setSendWorkEffortScopePK(entity == null? null: entity.getPrimaryKey()); 287 } 288 289 public boolean getSendWorkEffortScopePKHasBeenModified() { 290 return _value.getSendWorkEffortScopePKHasBeenModified(); 291 } 292 293 public SelectorPK getReviewEmployeeSelectorPK() { 294 return _value.getReviewEmployeeSelectorPK(); 295 } 296 297 public Selector getReviewEmployeeSelector(EntityPermission entityPermission) { 298 SelectorPK pk = getReviewEmployeeSelectorPK(); 299 Selector entity = pk == null? null: SelectorFactory.getInstance().getEntityFromPK(entityPermission, pk); 300 301 return entity; 302 } 303 304 public Selector getReviewEmployeeSelector() { 305 return getReviewEmployeeSelector(EntityPermission.READ_ONLY); 306 } 307 308 public Selector getReviewEmployeeSelectorForUpdate() { 309 return getReviewEmployeeSelector(EntityPermission.READ_WRITE); 310 } 311 312 public void setReviewEmployeeSelectorPK(SelectorPK reviewEmployeeSelectorPK) 313 throws PersistenceNotNullException, PersistenceReadOnlyException { 314 checkReadWrite(); 315 _value.setReviewEmployeeSelectorPK(reviewEmployeeSelectorPK); 316 } 317 318 public void setReviewEmployeeSelector(Selector entity) { 319 setReviewEmployeeSelectorPK(entity == null? null: entity.getPrimaryKey()); 320 } 321 322 public boolean getReviewEmployeeSelectorPKHasBeenModified() { 323 return _value.getReviewEmployeeSelectorPKHasBeenModified(); 324 } 325 326 public Long getFromTime() { 327 return _value.getFromTime(); 328 } 329 330 public void setFromTime(Long fromTime) 331 throws PersistenceNotNullException, PersistenceReadOnlyException { 332 checkReadWrite(); 333 _value.setFromTime(fromTime); 334 } 335 336 public boolean getFromTimeHasBeenModified() { 337 return _value.getFromTimeHasBeenModified(); 338 } 339 340 public Long getThruTime() { 341 return _value.getThruTime(); 342 } 343 344 public void setThruTime(Long thruTime) 345 throws PersistenceNotNullException, PersistenceReadOnlyException { 346 checkReadWrite(); 347 _value.setThruTime(thruTime); 348 } 349 350 public boolean getThruTimeHasBeenModified() { 351 return _value.getThruTimeHasBeenModified(); 352 } 353 354}