001// -------------------------------------------------------------------------------- 002// Copyright 2002-2024 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 * AppearanceDetail.java 021 */ 022 023package com.echothree.model.data.core.server.entity; 024 025import com.echothree.model.data.core.common.pk.AppearanceDetailPK; 026 027import com.echothree.model.data.core.common.pk.AppearancePK; 028import com.echothree.model.data.core.common.pk.ColorPK; 029import com.echothree.model.data.core.common.pk.FontStylePK; 030import com.echothree.model.data.core.common.pk.FontWeightPK; 031 032import com.echothree.model.data.core.server.entity.Appearance; 033import com.echothree.model.data.core.server.entity.Color; 034import com.echothree.model.data.core.server.entity.FontStyle; 035import com.echothree.model.data.core.server.entity.FontWeight; 036 037import com.echothree.model.data.core.server.factory.AppearanceFactory; 038import com.echothree.model.data.core.server.factory.ColorFactory; 039import com.echothree.model.data.core.server.factory.FontStyleFactory; 040import com.echothree.model.data.core.server.factory.FontWeightFactory; 041 042import com.echothree.model.data.core.common.pk.AppearanceDetailPK; 043 044import com.echothree.model.data.core.server.value.AppearanceDetailValue; 045 046import com.echothree.model.data.core.server.factory.AppearanceDetailFactory; 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 AppearanceDetail 065 extends BaseEntity 066 implements Serializable { 067 068 private AppearanceDetailPK _pk; 069 private AppearanceDetailValue _value; 070 071 /** Creates a new instance of AppearanceDetail */ 072 public AppearanceDetail() 073 throws PersistenceException { 074 super(); 075 } 076 077 /** Creates a new instance of AppearanceDetail */ 078 public AppearanceDetail(AppearanceDetailValue value, EntityPermission entityPermission) { 079 super(entityPermission); 080 081 _value = value; 082 _pk = value.getPrimaryKey(); 083 } 084 085 @Override 086 public AppearanceDetailFactory getBaseFactoryInstance() { 087 return AppearanceDetailFactory.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 AppearanceDetail) { 111 AppearanceDetail that = (AppearanceDetail)other; 112 113 AppearanceDetailValue thatValue = that.getAppearanceDetailValue(); 114 return _value.equals(thatValue); 115 } else { 116 return false; 117 } 118 } 119 120 @Override 121 public void store(Session session) 122 throws PersistenceDatabaseException { 123 getBaseFactoryInstance().store(session, this); 124 } 125 126 @Override 127 public void remove(Session session) 128 throws PersistenceDatabaseException { 129 getBaseFactoryInstance().remove(session, this); 130 } 131 132 @Override 133 public void remove() 134 throws PersistenceDatabaseException { 135 getBaseFactoryInstance().remove(ThreadSession.currentSession(), this); 136 } 137 138 public AppearanceDetailValue getAppearanceDetailValue() { 139 return _value; 140 } 141 142 public void setAppearanceDetailValue(AppearanceDetailValue value) 143 throws PersistenceReadOnlyException { 144 checkReadWrite(); 145 _value = value; 146 } 147 148 @Override 149 public AppearanceDetailPK getPrimaryKey() { 150 return _pk; 151 } 152 153 public AppearancePK getAppearancePK() { 154 return _value.getAppearancePK(); 155 } 156 157 public Appearance getAppearance(Session session, EntityPermission entityPermission) { 158 return AppearanceFactory.getInstance().getEntityFromPK(session, entityPermission, getAppearancePK()); 159 } 160 161 public Appearance getAppearance(EntityPermission entityPermission) { 162 return getAppearance(ThreadSession.currentSession(), entityPermission); 163 } 164 165 public Appearance getAppearance(Session session) { 166 return getAppearance(session, EntityPermission.READ_ONLY); 167 } 168 169 public Appearance getAppearance() { 170 return getAppearance(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 171 } 172 173 public Appearance getAppearanceForUpdate(Session session) { 174 return getAppearance(session, EntityPermission.READ_WRITE); 175 } 176 177 public Appearance getAppearanceForUpdate() { 178 return getAppearance(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 179 } 180 181 public void setAppearancePK(AppearancePK appearancePK) 182 throws PersistenceNotNullException, PersistenceReadOnlyException { 183 checkReadWrite(); 184 _value.setAppearancePK(appearancePK); 185 } 186 187 public void setAppearance(Appearance entity) { 188 setAppearancePK(entity == null? null: entity.getPrimaryKey()); 189 } 190 191 public boolean getAppearancePKHasBeenModified() { 192 return _value.getAppearancePKHasBeenModified(); 193 } 194 195 public String getAppearanceName() { 196 return _value.getAppearanceName(); 197 } 198 199 public void setAppearanceName(String appearanceName) 200 throws PersistenceNotNullException, PersistenceReadOnlyException { 201 checkReadWrite(); 202 _value.setAppearanceName(appearanceName); 203 } 204 205 public boolean getAppearanceNameHasBeenModified() { 206 return _value.getAppearanceNameHasBeenModified(); 207 } 208 209 public ColorPK getTextColorPK() { 210 return _value.getTextColorPK(); 211 } 212 213 public Color getTextColor(Session session, EntityPermission entityPermission) { 214 ColorPK pk = getTextColorPK(); 215 Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 216 217 return entity; 218 } 219 220 public Color getTextColor(EntityPermission entityPermission) { 221 return getTextColor(ThreadSession.currentSession(), entityPermission); 222 } 223 224 public Color getTextColor(Session session) { 225 return getTextColor(session, EntityPermission.READ_ONLY); 226 } 227 228 public Color getTextColor() { 229 return getTextColor(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 230 } 231 232 public Color getTextColorForUpdate(Session session) { 233 return getTextColor(session, EntityPermission.READ_WRITE); 234 } 235 236 public Color getTextColorForUpdate() { 237 return getTextColor(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 238 } 239 240 public void setTextColorPK(ColorPK textColorPK) 241 throws PersistenceNotNullException, PersistenceReadOnlyException { 242 checkReadWrite(); 243 _value.setTextColorPK(textColorPK); 244 } 245 246 public void setTextColor(Color entity) { 247 setTextColorPK(entity == null? null: entity.getPrimaryKey()); 248 } 249 250 public boolean getTextColorPKHasBeenModified() { 251 return _value.getTextColorPKHasBeenModified(); 252 } 253 254 public ColorPK getBackgroundColorPK() { 255 return _value.getBackgroundColorPK(); 256 } 257 258 public Color getBackgroundColor(Session session, EntityPermission entityPermission) { 259 ColorPK pk = getBackgroundColorPK(); 260 Color entity = pk == null? null: ColorFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 261 262 return entity; 263 } 264 265 public Color getBackgroundColor(EntityPermission entityPermission) { 266 return getBackgroundColor(ThreadSession.currentSession(), entityPermission); 267 } 268 269 public Color getBackgroundColor(Session session) { 270 return getBackgroundColor(session, EntityPermission.READ_ONLY); 271 } 272 273 public Color getBackgroundColor() { 274 return getBackgroundColor(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 275 } 276 277 public Color getBackgroundColorForUpdate(Session session) { 278 return getBackgroundColor(session, EntityPermission.READ_WRITE); 279 } 280 281 public Color getBackgroundColorForUpdate() { 282 return getBackgroundColor(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 283 } 284 285 public void setBackgroundColorPK(ColorPK backgroundColorPK) 286 throws PersistenceNotNullException, PersistenceReadOnlyException { 287 checkReadWrite(); 288 _value.setBackgroundColorPK(backgroundColorPK); 289 } 290 291 public void setBackgroundColor(Color entity) { 292 setBackgroundColorPK(entity == null? null: entity.getPrimaryKey()); 293 } 294 295 public boolean getBackgroundColorPKHasBeenModified() { 296 return _value.getBackgroundColorPKHasBeenModified(); 297 } 298 299 public FontStylePK getFontStylePK() { 300 return _value.getFontStylePK(); 301 } 302 303 public FontStyle getFontStyle(Session session, EntityPermission entityPermission) { 304 FontStylePK pk = getFontStylePK(); 305 FontStyle entity = pk == null? null: FontStyleFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 306 307 return entity; 308 } 309 310 public FontStyle getFontStyle(EntityPermission entityPermission) { 311 return getFontStyle(ThreadSession.currentSession(), entityPermission); 312 } 313 314 public FontStyle getFontStyle(Session session) { 315 return getFontStyle(session, EntityPermission.READ_ONLY); 316 } 317 318 public FontStyle getFontStyle() { 319 return getFontStyle(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 320 } 321 322 public FontStyle getFontStyleForUpdate(Session session) { 323 return getFontStyle(session, EntityPermission.READ_WRITE); 324 } 325 326 public FontStyle getFontStyleForUpdate() { 327 return getFontStyle(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 328 } 329 330 public void setFontStylePK(FontStylePK fontStylePK) 331 throws PersistenceNotNullException, PersistenceReadOnlyException { 332 checkReadWrite(); 333 _value.setFontStylePK(fontStylePK); 334 } 335 336 public void setFontStyle(FontStyle entity) { 337 setFontStylePK(entity == null? null: entity.getPrimaryKey()); 338 } 339 340 public boolean getFontStylePKHasBeenModified() { 341 return _value.getFontStylePKHasBeenModified(); 342 } 343 344 public FontWeightPK getFontWeightPK() { 345 return _value.getFontWeightPK(); 346 } 347 348 public FontWeight getFontWeight(Session session, EntityPermission entityPermission) { 349 FontWeightPK pk = getFontWeightPK(); 350 FontWeight entity = pk == null? null: FontWeightFactory.getInstance().getEntityFromPK(session, entityPermission, pk); 351 352 return entity; 353 } 354 355 public FontWeight getFontWeight(EntityPermission entityPermission) { 356 return getFontWeight(ThreadSession.currentSession(), entityPermission); 357 } 358 359 public FontWeight getFontWeight(Session session) { 360 return getFontWeight(session, EntityPermission.READ_ONLY); 361 } 362 363 public FontWeight getFontWeight() { 364 return getFontWeight(ThreadSession.currentSession(), EntityPermission.READ_ONLY); 365 } 366 367 public FontWeight getFontWeightForUpdate(Session session) { 368 return getFontWeight(session, EntityPermission.READ_WRITE); 369 } 370 371 public FontWeight getFontWeightForUpdate() { 372 return getFontWeight(ThreadSession.currentSession(), EntityPermission.READ_WRITE); 373 } 374 375 public void setFontWeightPK(FontWeightPK fontWeightPK) 376 throws PersistenceNotNullException, PersistenceReadOnlyException { 377 checkReadWrite(); 378 _value.setFontWeightPK(fontWeightPK); 379 } 380 381 public void setFontWeight(FontWeight entity) { 382 setFontWeightPK(entity == null? null: entity.getPrimaryKey()); 383 } 384 385 public boolean getFontWeightPKHasBeenModified() { 386 return _value.getFontWeightPKHasBeenModified(); 387 } 388 389 public Boolean getIsDefault() { 390 return _value.getIsDefault(); 391 } 392 393 public void setIsDefault(Boolean isDefault) 394 throws PersistenceNotNullException, PersistenceReadOnlyException { 395 checkReadWrite(); 396 _value.setIsDefault(isDefault); 397 } 398 399 public boolean getIsDefaultHasBeenModified() { 400 return _value.getIsDefaultHasBeenModified(); 401 } 402 403 public Integer getSortOrder() { 404 return _value.getSortOrder(); 405 } 406 407 public void setSortOrder(Integer sortOrder) 408 throws PersistenceNotNullException, PersistenceReadOnlyException { 409 checkReadWrite(); 410 _value.setSortOrder(sortOrder); 411 } 412 413 public boolean getSortOrderHasBeenModified() { 414 return _value.getSortOrderHasBeenModified(); 415 } 416 417 public Long getFromTime() { 418 return _value.getFromTime(); 419 } 420 421 public void setFromTime(Long fromTime) 422 throws PersistenceNotNullException, PersistenceReadOnlyException { 423 checkReadWrite(); 424 _value.setFromTime(fromTime); 425 } 426 427 public boolean getFromTimeHasBeenModified() { 428 return _value.getFromTimeHasBeenModified(); 429 } 430 431 public Long getThruTime() { 432 return _value.getThruTime(); 433 } 434 435 public void setThruTime(Long thruTime) 436 throws PersistenceNotNullException, PersistenceReadOnlyException { 437 checkReadWrite(); 438 _value.setThruTime(thruTime); 439 } 440 441 public boolean getThruTimeHasBeenModified() { 442 return _value.getThruTimeHasBeenModified(); 443 } 444 445}