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 * EntityClobAttribute.java 021 */ 022 023package com.echothree.model.data.core.server.entity; 024 025import com.echothree.model.data.core.common.pk.EntityClobAttributePK; 026 027import com.echothree.model.data.core.common.pk.EntityAttributePK; 028import com.echothree.model.data.core.common.pk.EntityInstancePK; 029import com.echothree.model.data.party.common.pk.LanguagePK; 030import com.echothree.model.data.core.common.pk.MimeTypePK; 031 032import com.echothree.model.data.core.server.entity.EntityAttribute; 033import com.echothree.model.data.core.server.entity.EntityInstance; 034import com.echothree.model.data.party.server.entity.Language; 035import com.echothree.model.data.core.server.entity.MimeType; 036 037import com.echothree.model.data.core.server.factory.EntityAttributeFactory; 038import com.echothree.model.data.core.server.factory.EntityInstanceFactory; 039import com.echothree.model.data.party.server.factory.LanguageFactory; 040import com.echothree.model.data.core.server.factory.MimeTypeFactory; 041 042import com.echothree.model.data.core.common.pk.EntityClobAttributePK; 043 044import com.echothree.model.data.core.server.value.EntityClobAttributeValue; 045 046import com.echothree.model.data.core.server.factory.EntityClobAttributeFactory; 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 EntityClobAttribute 065 extends BaseEntity 066 implements Serializable { 067 068 private EntityClobAttributePK _pk; 069 private EntityClobAttributeValue _value; 070 071 /** Creates a new instance of EntityClobAttribute */ 072 public EntityClobAttribute() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of EntityClobAttribute */ 078 public EntityClobAttribute(EntityClobAttributeValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public EntityClobAttributeFactory getBaseFactoryInstance() { 087 return EntityClobAttributeFactory.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 EntityClobAttribute that) { 111 EntityClobAttributeValue thatValue = that.getEntityClobAttributeValue(); 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 EntityClobAttributeValue getEntityClobAttributeValue() { 137 return _value; 138 } 139 140 public void setEntityClobAttributeValue(EntityClobAttributeValue value) 141 throws PersistenceReadOnlyException { 142 checkReadWrite(); 143 _value = value; 144 } 145 146 @Override 147 public EntityClobAttributePK getPrimaryKey() { 148 return _pk; 149 } 150 151 public EntityAttributePK getEntityAttributePK() { 152 return _value.getEntityAttributePK(); 153 } 154 155 public EntityAttribute getEntityAttribute(Session session, EntityPermission entityPermission) { 156 return EntityAttributeFactory.getInstance().getEntityFromPK(session, entityPermission, getEntityAttributePK()); 157 } 158 159 public EntityAttribute getEntityAttribute(EntityPermission entityPermission) { 160 return getEntityAttribute(ThreadSession.currentSession(), entityPermission); 161 } 162 163 public EntityAttribute getEntityAttribute(Session session) { 164 return getEntityAttribute(session, EntityPermission.READ_ONLY); 165 } 166 167 public EntityAttribute getEntityAttribute() { 168 return getEntityAttribute(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 169 } 170 171 public EntityAttribute getEntityAttributeForUpdate(Session session) { 172 return getEntityAttribute(session, EntityPermission.READ_WRITE); 173 } 174 175 public EntityAttribute getEntityAttributeForUpdate() { 176 return getEntityAttribute(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 177 } 178 179 public void setEntityAttributePK(EntityAttributePK entityAttributePK) 180 throws PersistenceNotNullException, PersistenceReadOnlyException { 181 checkReadWrite(); 182 _value.setEntityAttributePK(entityAttributePK); 183 } 184 185 public void setEntityAttribute(EntityAttribute entity) { 186 setEntityAttributePK(entity == null? null: entity.getPrimaryKey()); 187 } 188 189 public boolean getEntityAttributePKHasBeenModified() { 190 return _value.getEntityAttributePKHasBeenModified(); 191 } 192 193 public EntityInstancePK getEntityInstancePK() { 194 return _value.getEntityInstancePK(); 195 } 196 197 public EntityInstance getEntityInstance(Session session, EntityPermission entityPermission) { 198 return EntityInstanceFactory.getInstance().getEntityFromPK(session, entityPermission, getEntityInstancePK()); 199 } 200 201 public EntityInstance getEntityInstance(EntityPermission entityPermission) { 202 return getEntityInstance(ThreadSession.currentSession(), entityPermission); 203 } 204 205 public EntityInstance getEntityInstance(Session session) { 206 return getEntityInstance(session, EntityPermission.READ_ONLY); 207 } 208 209 public EntityInstance getEntityInstance() { 210 return getEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 211 } 212 213 public EntityInstance getEntityInstanceForUpdate(Session session) { 214 return getEntityInstance(session, EntityPermission.READ_WRITE); 215 } 216 217 public EntityInstance getEntityInstanceForUpdate() { 218 return getEntityInstance(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 219 } 220 221 public void setEntityInstancePK(EntityInstancePK entityInstancePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setEntityInstancePK(entityInstancePK); 225 } 226 227 public void setEntityInstance(EntityInstance entity) { 228 setEntityInstancePK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getEntityInstancePKHasBeenModified() { 232 return _value.getEntityInstancePKHasBeenModified(); 233 } 234 235 public LanguagePK getLanguagePK() { 236 return _value.getLanguagePK(); 237 } 238 239 public Language getLanguage(Session session, EntityPermission entityPermission) { 240 return LanguageFactory.getInstance().getEntityFromPK(session, entityPermission, getLanguagePK()); 241 } 242 243 public Language getLanguage(EntityPermission entityPermission) { 244 return getLanguage(ThreadSession.currentSession(), entityPermission); 245 } 246 247 public Language getLanguage(Session session) { 248 return getLanguage(session, EntityPermission.READ_ONLY); 249 } 250 251 public Language getLanguage() { 252 return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 253 } 254 255 public Language getLanguageForUpdate(Session session) { 256 return getLanguage(session, EntityPermission.READ_WRITE); 257 } 258 259 public Language getLanguageForUpdate() { 260 return getLanguage(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 261 } 262 263 public void setLanguagePK(LanguagePK languagePK) 264 throws PersistenceNotNullException, PersistenceReadOnlyException { 265 checkReadWrite(); 266 _value.setLanguagePK(languagePK); 267 } 268 269 public void setLanguage(Language entity) { 270 setLanguagePK(entity == null? null: entity.getPrimaryKey()); 271 } 272 273 public boolean getLanguagePKHasBeenModified() { 274 return _value.getLanguagePKHasBeenModified(); 275 } 276 277 public String getClobAttribute() { 278 return _value.getClobAttribute(); 279 } 280 281 public void setClobAttribute(String clobAttribute) 282 throws PersistenceNotNullException, PersistenceReadOnlyException { 283 checkReadWrite(); 284 _value.setClobAttribute(clobAttribute); 285 } 286 287 public boolean getClobAttributeHasBeenModified() { 288 return _value.getClobAttributeHasBeenModified(); 289 } 290 291 public MimeTypePK getMimeTypePK() { 292 return _value.getMimeTypePK(); 293 } 294 295 public MimeType getMimeType(Session session, EntityPermission entityPermission) { 296 return MimeTypeFactory.getInstance().getEntityFromPK(session, entityPermission, getMimeTypePK()); 297 } 298 299 public MimeType getMimeType(EntityPermission entityPermission) { 300 return getMimeType(ThreadSession.currentSession(), entityPermission); 301 } 302 303 public MimeType getMimeType(Session session) { 304 return getMimeType(session, EntityPermission.READ_ONLY); 305 } 306 307 public MimeType getMimeType() { 308 return getMimeType(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 309 } 310 311 public MimeType getMimeTypeForUpdate(Session session) { 312 return getMimeType(session, EntityPermission.READ_WRITE); 313 } 314 315 public MimeType getMimeTypeForUpdate() { 316 return getMimeType(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 317 } 318 319 public void setMimeTypePK(MimeTypePK mimeTypePK) 320 throws PersistenceNotNullException, PersistenceReadOnlyException { 321 checkReadWrite(); 322 _value.setMimeTypePK(mimeTypePK); 323 } 324 325 public void setMimeType(MimeType entity) { 326 setMimeTypePK(entity == null? null: entity.getPrimaryKey()); 327 } 328 329 public boolean getMimeTypePKHasBeenModified() { 330 return _value.getMimeTypePKHasBeenModified(); 331 } 332 333 public Long getFromTime() { 334 return _value.getFromTime(); 335 } 336 337 public void setFromTime(Long fromTime) 338 throws PersistenceNotNullException, PersistenceReadOnlyException { 339 checkReadWrite(); 340 _value.setFromTime(fromTime); 341 } 342 343 public boolean getFromTimeHasBeenModified() { 344 return _value.getFromTimeHasBeenModified(); 345 } 346 347 public Long getThruTime() { 348 return _value.getThruTime(); 349 } 350 351 public void setThruTime(Long thruTime) 352 throws PersistenceNotNullException, PersistenceReadOnlyException { 353 checkReadWrite(); 354 _value.setThruTime(thruTime); 355 } 356 357 public boolean getThruTimeHasBeenModified() { 358 return _value.getThruTimeHasBeenModified(); 359 } 360 361}