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 * 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() 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 EntityClobAttributeValue getEntityClobAttributeValue() { 131 return _value; 132 } 133 134 public void setEntityClobAttributeValue(EntityClobAttributeValue value) 135 throws PersistenceReadOnlyException { 136 checkReadWrite(); 137 _value = value; 138 } 139 140 @Override 141 public EntityClobAttributePK getPrimaryKey() { 142 return _pk; 143 } 144 145 public EntityAttributePK getEntityAttributePK() { 146 return _value.getEntityAttributePK(); 147 } 148 149 public EntityAttribute getEntityAttribute(EntityPermission entityPermission) { 150 return EntityAttributeFactory.getInstance().getEntityFromPK(entityPermission, getEntityAttributePK()); 151 } 152 153 public EntityAttribute getEntityAttribute() { 154 return getEntityAttribute(EntityPermission.READ_ONLY); 155 } 156 157 public EntityAttribute getEntityAttributeForUpdate() { 158 return getEntityAttribute(EntityPermission.READ_WRITE); 159 } 160 161 public void setEntityAttributePK(EntityAttributePK entityAttributePK) 162 throws PersistenceNotNullException, PersistenceReadOnlyException { 163 checkReadWrite(); 164 _value.setEntityAttributePK(entityAttributePK); 165 } 166 167 public void setEntityAttribute(EntityAttribute entity) { 168 setEntityAttributePK(entity == null? null: entity.getPrimaryKey()); 169 } 170 171 public boolean getEntityAttributePKHasBeenModified() { 172 return _value.getEntityAttributePKHasBeenModified(); 173 } 174 175 public EntityInstancePK getEntityInstancePK() { 176 return _value.getEntityInstancePK(); 177 } 178 179 public EntityInstance getEntityInstance(EntityPermission entityPermission) { 180 return EntityInstanceFactory.getInstance().getEntityFromPK(entityPermission, getEntityInstancePK()); 181 } 182 183 public EntityInstance getEntityInstance() { 184 return getEntityInstance(EntityPermission.READ_ONLY); 185 } 186 187 public EntityInstance getEntityInstanceForUpdate() { 188 return getEntityInstance(EntityPermission.READ_WRITE); 189 } 190 191 public void setEntityInstancePK(EntityInstancePK entityInstancePK) 192 throws PersistenceNotNullException, PersistenceReadOnlyException { 193 checkReadWrite(); 194 _value.setEntityInstancePK(entityInstancePK); 195 } 196 197 public void setEntityInstance(EntityInstance entity) { 198 setEntityInstancePK(entity == null? null: entity.getPrimaryKey()); 199 } 200 201 public boolean getEntityInstancePKHasBeenModified() { 202 return _value.getEntityInstancePKHasBeenModified(); 203 } 204 205 public LanguagePK getLanguagePK() { 206 return _value.getLanguagePK(); 207 } 208 209 public Language getLanguage(EntityPermission entityPermission) { 210 return LanguageFactory.getInstance().getEntityFromPK(entityPermission, getLanguagePK()); 211 } 212 213 public Language getLanguage() { 214 return getLanguage(EntityPermission.READ_ONLY); 215 } 216 217 public Language getLanguageForUpdate() { 218 return getLanguage(EntityPermission.READ_WRITE); 219 } 220 221 public void setLanguagePK(LanguagePK languagePK) 222 throws PersistenceNotNullException, PersistenceReadOnlyException { 223 checkReadWrite(); 224 _value.setLanguagePK(languagePK); 225 } 226 227 public void setLanguage(Language entity) { 228 setLanguagePK(entity == null? null: entity.getPrimaryKey()); 229 } 230 231 public boolean getLanguagePKHasBeenModified() { 232 return _value.getLanguagePKHasBeenModified(); 233 } 234 235 public String getClobAttribute() { 236 return _value.getClobAttribute(); 237 } 238 239 public void setClobAttribute(String clobAttribute) 240 throws PersistenceNotNullException, PersistenceReadOnlyException { 241 checkReadWrite(); 242 _value.setClobAttribute(clobAttribute); 243 } 244 245 public boolean getClobAttributeHasBeenModified() { 246 return _value.getClobAttributeHasBeenModified(); 247 } 248 249 public MimeTypePK getMimeTypePK() { 250 return _value.getMimeTypePK(); 251 } 252 253 public MimeType getMimeType(EntityPermission entityPermission) { 254 return MimeTypeFactory.getInstance().getEntityFromPK(entityPermission, getMimeTypePK()); 255 } 256 257 public MimeType getMimeType() { 258 return getMimeType(EntityPermission.READ_ONLY); 259 } 260 261 public MimeType getMimeTypeForUpdate() { 262 return getMimeType(EntityPermission.READ_WRITE); 263 } 264 265 public void setMimeTypePK(MimeTypePK mimeTypePK) 266 throws PersistenceNotNullException, PersistenceReadOnlyException { 267 checkReadWrite(); 268 _value.setMimeTypePK(mimeTypePK); 269 } 270 271 public void setMimeType(MimeType entity) { 272 setMimeTypePK(entity == null? null: entity.getPrimaryKey()); 273 } 274 275 public boolean getMimeTypePKHasBeenModified() { 276 return _value.getMimeTypePKHasBeenModified(); 277 } 278 279 public Long getFromTime() { 280 return _value.getFromTime(); 281 } 282 283 public void setFromTime(Long fromTime) 284 throws PersistenceNotNullException, PersistenceReadOnlyException { 285 checkReadWrite(); 286 _value.setFromTime(fromTime); 287 } 288 289 public boolean getFromTimeHasBeenModified() { 290 return _value.getFromTimeHasBeenModified(); 291 } 292 293 public Long getThruTime() { 294 return _value.getThruTime(); 295 } 296 297 public void setThruTime(Long thruTime) 298 throws PersistenceNotNullException, PersistenceReadOnlyException { 299 checkReadWrite(); 300 _value.setThruTime(thruTime); 301 } 302 303 public boolean getThruTimeHasBeenModified() { 304 return _value.getThruTimeHasBeenModified(); 305 } 306 307}